platform/upstream/libSkiaSharp.git
7 years agoexperimental/tools/mskp_parser.py
halcanary [Tue, 23 Aug 2016 17:32:53 +0000 (10:32 -0700)]
experimental/tools/mskp_parser.py

TBR=
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268403003

Review-Url: https://codereview.chromium.org/2268403003

7 years agoRevert of Moving SkBlurImageFilter into core (patchset #9 id:160001 of https://codere...
bungeman [Tue, 23 Aug 2016 17:04:53 +0000 (10:04 -0700)]
Revert of Moving SkBlurImageFilter into core (patchset #9 id:160001 of https://codereview.chromium.org/2255803003/ )

Reason for revert:
Breaking internal roll. Still needs 'Create'.

Original issue's description:
> Moving SkBlurImageFilter into core
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003
>
> Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
> Committed: https://skia.googlesource.com/skia/+/e426babe7552b1cb4e27cdf4e90826feabb9e3b0
> Committed: https://skia.googlesource.com/skia/+/4d760175686df8f61a11b66946eb307d89dd2c75
> Committed: https://skia.googlesource.com/skia/+/a97a1ab5719d5c355f7900b7f17dec1e467cf57e

TBR=reed@google.com,fmalita@chromium.org,vjiaoblack@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2274603003

7 years agofix conic path fuzz
caryclark [Tue, 23 Aug 2016 16:41:00 +0000 (09:41 -0700)]
fix conic path fuzz

The test conic has a very large weight, so it reduces to a pair
of lines. Detect this case rather than subdividing the conic
so much that the answers are meaningless.

R=herb@google.com, reed@google.com
BUG=638223
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268073004

Review-Url: https://codereview.chromium.org/2268073004

7 years agoSkMultiSKP: version 2
halcanary [Tue, 23 Aug 2016 16:15:04 +0000 (09:15 -0700)]
SkMultiSKP: version 2

Measurable size improvement.

BUG=skia:5370

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255333003

Review-Url: https://codereview.chromium.org/2255333003

7 years agoSkPDF: PDFDevice cleanup.
halcanary [Tue, 23 Aug 2016 16:02:12 +0000 (09:02 -0700)]
SkPDF: PDFDevice cleanup.

Remove unused fContentSize.

Combine SkPDFDevice::writeContent and SkPDFDevice::content.

Remove unused SkPDFDevice::initialTransform().

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2264113003

Review-Url: https://codereview.chromium.org/2264113003

7 years agof16<->f32 ftz is an optional thing for speed.
mtklein [Tue, 23 Aug 2016 15:58:12 +0000 (08:58 -0700)]
f16<->f32 ftz is an optional thing for speed.

The ARMv8 asm path actually does it right... that should be okay.

My Nexus 5x fails `dm -m _finite_ftz` before this and passes after it.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2276533002

TBR=msarett@google.com

Review-Url: https://codereview.chromium.org/2276533002

7 years agoMoving SkBlurImageFilter into core
vjiaoblack [Tue, 23 Aug 2016 14:50:52 +0000 (07:50 -0700)]
Moving SkBlurImageFilter into core

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003

Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
Committed: https://skia.googlesource.com/skia/+/e426babe7552b1cb4e27cdf4e90826feabb9e3b0
Committed: https://skia.googlesource.com/skia/+/4d760175686df8f61a11b66946eb307d89dd2c75
Review-Url: https://codereview.chromium.org/2255803003

7 years agofix pathops fuzz
caryclark [Tue, 23 Aug 2016 14:38:48 +0000 (07:38 -0700)]
fix pathops fuzz

Extreme cubics may split so that one half is a point.
Discard this rather than generating a degenerate line.

TBR=reed@google.com
BUG=640025
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2276503002

Review-Url: https://codereview.chromium.org/2276503002

7 years agoGN: make libwebp an optional dependency
mtklein [Tue, 23 Aug 2016 14:38:09 +0000 (07:38 -0700)]
GN: make libwebp an optional dependency

This will be handy for folks who don't have libwebp, like Fuchsia.

I convinced myself that this is done right by:
  - building in all three modes (default and explicitly set both ways);
  - looking at verbose Ninja logs to see the presence/lack of SK_HAS_WEBP_LIBRARY;
  - running dm -m Codec, which passes with libwebp and segfault without it.

If this is viable, I intend to make all third-party dependencies optional
and follow this pattern.  :skia should link and degrade gracefully without
any of //third_party.  It's okay for tools to have hard third-party
dependencies; we just need them to get past the `gn gen` stage without them.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2270693004

Review-Url: https://codereview.chromium.org/2270693004

7 years agoReduce window rectangles cap to 8
csmartdalton [Tue, 23 Aug 2016 13:51:00 +0000 (06:51 -0700)]
Reduce window rectangles cap to 8

Lowers the cap to 8 and adds a warning message if this value is ever
exceeded. The largest (only) implementation currently supports 8, so
there isn't yet reason to go higher.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254013002

Committed: https://skia.googlesource.com/skia/+/52d721580ee22525c285e2d13cf3975a7a1b2843
Review-Url: https://codereview.chromium.org/2254013002

7 years agoCleanup use of legacy SkSurface creation methods a bit
robertphillips [Tue, 23 Aug 2016 13:39:35 +0000 (06:39 -0700)]
Cleanup use of legacy SkSurface creation methods a bit

This CL cleans up some remaining uses of the old API

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2223023002

Committed: https://skia.googlesource.com/skia/+/f21cd16228c20927fa4e9b937d6951471cfaa37a
Review-Url: https://codereview.chromium.org/2223023002

7 years agoFix valgrind issue in CircleBatch__Test
robertphillips [Tue, 23 Aug 2016 13:19:15 +0000 (06:19 -0700)]
Fix valgrind issue in CircleBatch__Test

TBR=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2271653002

Review-Url: https://codereview.chromium.org/2271653002

7 years agoRemove file samplecode/SampleDraw.cpp
martina.kollarova [Tue, 23 Aug 2016 07:17:42 +0000 (00:17 -0700)]
Remove file samplecode/SampleDraw.cpp

The file is not used in any build target and seems dead, i.e. failed to compile when I added it to
the SampleApp target.

BUG=None
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2269583002

Review-Url: https://codereview.chromium.org/2269583002

7 years agoFix Ganesh analytic blurred rect draws
robertphillips [Mon, 22 Aug 2016 23:13:48 +0000 (16:13 -0700)]
Fix Ganesh analytic blurred rect draws

This CL does two things:
 It fixes the SkBlurMaskFilterImpl::directFilterRRectMaskGPU draw path to explicitly handle rects
 It fixes the SkGpuDevice::drawTextureProducerImpl draw path to provide the correct (src & device space) inputs to directFilterRRectMaskGPU.

How this was working before was that GrRRectBlurEffect::Make would reject rect-rrects and the code would fallback to
GrBlurUtils::drawPathWithMaskFilter which mapped the rect-rrect into device space correctly (of course,
the rect-ness of the path was removed at that point so it was going through the slow path).

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268583002

Review-Url: https://codereview.chromium.org/2268583002

7 years agoFix GLSL int to float error in arc code in GrOvalRenderer.
bsalomon [Mon, 22 Aug 2016 22:17:48 +0000 (15:17 -0700)]
Fix GLSL int to float error in arc code in GrOvalRenderer.

BUG=skia:
TBR=robertphillips@google.com
NOTRY=true
NOTREECHECKS=true

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263213004

Review-Url: https://codereview.chromium.org/2263213004

7 years agoMore robust check for sRGB gamma tables
msarett [Mon, 22 Aug 2016 21:58:56 +0000 (14:58 -0700)]
More robust check for sRGB gamma tables

This is in response to a UMA showing that 5% dst gammas are
unidentified tables.  We want to see if some of these tables
should be marked as sRGB.
https://uma.googleplex.com/p/chrome/histograms?endDate=latest&dayCount=1&histograms=Blink.ColorSpace.Destination&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial

This check is not fast.  If we find that it doesn't help
us recognize sRGB curves, we should delete it.

BUG=skia:5656
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263233003

Review-Url: https://codereview.chromium.org/2263233003

7 years agoRemove virtual from overrides in SkGpuDevice.h
bsalomon [Mon, 22 Aug 2016 21:48:36 +0000 (14:48 -0700)]
Remove virtual from overrides in SkGpuDevice.h
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265323002

Review-Url: https://codereview.chromium.org/2265323002

7 years agoFix CircleBatch::TestCreate to always use a legal matrix
bsalomon [Mon, 22 Aug 2016 21:24:24 +0000 (14:24 -0700)]
Fix CircleBatch::TestCreate to always use a legal matrix

TBR=robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267953002

NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2267953002

7 years agoMark temporary paths created by SkCanvas for clipping as volatile
bsalomon [Mon, 22 Aug 2016 20:42:17 +0000 (13:42 -0700)]
Mark temporary paths created by SkCanvas for clipping as volatile
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268723002

Review-Url: https://codereview.chromium.org/2268723002

7 years agoRemove vulkan from most build variants
liyuqian [Mon, 22 Aug 2016 20:36:57 +0000 (13:36 -0700)]
Remove vulkan from most build variants

Since many devices don't support vulkan, we have to remove it for most
build variants and only turn it on manually by selecting arm64vulkan
build variant.

BUG=skia:5516
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255973003

Review-Url: https://codereview.chromium.org/2255973003

7 years agoFlush denorm half floats to zero.
mtklein [Mon, 22 Aug 2016 20:20:18 +0000 (13:20 -0700)]
Flush denorm half floats to zero.

I think we convinced ourselves that denorms, while a good chunk of half floats,
cover a rather small fraction of the representable range, which is always
close enough to zero to flush.

This makes both paths of the conversion to or from float considerably simpler.

These functions now work for zero-or-normal half floats (excluding infinite, NaN).
I'm not aware of a term for this class so I've called them "ordinary".

A handful of GMs and SKPs draw differently in --config f16, but all imperceptibly.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256023002

Review-Url: https://codereview.chromium.org/2256023002

7 years agoGPU implementation of drawArc.
bsalomon [Mon, 22 Aug 2016 20:14:26 +0000 (13:14 -0700)]
GPU implementation of drawArc.

This adds analytic shaders for filled arcs and butt-cap stroked arcs where the center point is not used.

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259323003

Review-Url: https://codereview.chromium.org/2259323003

7 years agoAdd cap type variations to circular arcs GMs
bsalomon [Mon, 22 Aug 2016 20:10:46 +0000 (13:10 -0700)]
Add cap type variations to circular arcs GMs

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2269723002

Review-Url: https://codereview.chromium.org/2269723002

7 years agocheck for wide-open inside quickContains
reed [Mon, 22 Aug 2016 20:03:47 +0000 (13:03 -0700)]
check for wide-open inside quickContains

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263373002

Review-Url: https://codereview.chromium.org/2263373002

7 years agoFix MSAN - mark temporary memory as kNo_ZeroInitialized
msarett [Mon, 22 Aug 2016 20:00:05 +0000 (13:00 -0700)]
Fix MSAN - mark temporary memory as kNo_ZeroInitialized

TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261173004

Review-Url: https://codereview.chromium.org/2261173004

7 years agoAdd trooper documentation for CT bots and for iOS "the service is invalid"
rmistry [Mon, 22 Aug 2016 19:54:54 +0000 (12:54 -0700)]
Add trooper documentation for CT bots and for iOS "the service is invalid"

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263103003
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2263103003

Review-Url: https://codereview.chromium.org/2263103003

7 years agoFix Equals and serialization for rare pngs
msarett [Mon, 22 Aug 2016 19:29:31 +0000 (12:29 -0700)]
Fix Equals and serialization for rare pngs

PNGs may contain a gAMA chunk that specifies gamma
values as floats.  If so, we will use these floats
to create an SkColorSpace.

This CL fixes Equals(), serialize(), and
Deserialize() to correctly handle SkColorSpaces
with strange gammas, where we are unable to fall
back on the profile data.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221983002

Review-Url: https://codereview.chromium.org/2221983002

7 years agoRevert of Moving SkBlurImageFilter into core (patchset #8 id:140001 of https://codere...
vjiaoblack [Mon, 22 Aug 2016 19:04:41 +0000 (12:04 -0700)]
Revert of Moving SkBlurImageFilter into core (patchset #8 id:140001 of https://codereview.chromium.org/2255803003/ )

Reason for revert:
Misnamed function.

Original issue's description:
> Moving SkBlurImageFilter into core
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003
>
> Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
> Committed: https://skia.googlesource.com/skia/+/e426babe7552b1cb4e27cdf4e90826feabb9e3b0
> Committed: https://skia.googlesource.com/skia/+/4d760175686df8f61a11b66946eb307d89dd2c75

TBR=reed@google.com,fmalita@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2265263002

7 years agoMoving SkBlurImageFilter into core
vjiaoblack [Mon, 22 Aug 2016 19:00:25 +0000 (12:00 -0700)]
Moving SkBlurImageFilter into core

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003

Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
Committed: https://skia.googlesource.com/skia/+/e426babe7552b1cb4e27cdf4e90826feabb9e3b0
Review-Url: https://codereview.chromium.org/2255803003

7 years agoRemove quantization of device-space dest rect for Ganesh analytic rrect blurs
robertphillips [Mon, 22 Aug 2016 18:48:44 +0000 (11:48 -0700)]
Remove quantization of device-space dest rect for Ganesh analytic rrect blurs

At least on Windows, this fixes a lot of the horrible banded blurs. AFAICT there is no good reason to quantize the device space rect passed to the GrRectBlurEffect.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2262263002

Review-Url: https://codereview.chromium.org/2262263002

7 years agoMark temp paths in SkBaseDevice::drawArc and ::drawDRRect as volatile
bsalomon [Mon, 22 Aug 2016 18:46:35 +0000 (11:46 -0700)]
Mark temp paths in SkBaseDevice::drawArc and ::drawDRRect as volatile
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261123004

Review-Url: https://codereview.chromium.org/2261123004

7 years agoFix touch event parameter order
liyuqian [Mon, 22 Aug 2016 18:31:09 +0000 (11:31 -0700)]
Fix touch event parameter order

The issue is so obvious... However, all newer Android devices (e.g.,
Nexus 6P, 5X, 9) are immune to this bug. So I didn't notice this until I
tested Viewer app on Nexus 7 yesterday...

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254223002

Review-Url: https://codereview.chromium.org/2254223002

7 years agoRevert of Moving SkBlurImageFilter into core (patchset #8 id:140001 of https://codere...
vjiaoblack [Mon, 22 Aug 2016 18:30:39 +0000 (11:30 -0700)]
Revert of Moving SkBlurImageFilter into core (patchset #8 id:140001 of https://codereview.chromium.org/2255803003/ )

Reason for revert:
Fixed it wrong, needs to revert to re-discuss and re-land.

Original issue's description:
> Moving SkBlurImageFilter into core
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003
>
> Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
> Committed: https://skia.googlesource.com/skia/+/e426babe7552b1cb4e27cdf4e90826feabb9e3b0

TBR=reed@google.com,fmalita@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2266063002

7 years agoMoving SkBlurImageFilter into core
vjiaoblack [Mon, 22 Aug 2016 17:51:27 +0000 (10:51 -0700)]
Moving SkBlurImageFilter into core

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003

Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48
Review-Url: https://codereview.chromium.org/2255803003

7 years agoAdd stroke-and-fill circular arc test, test near 180deg arc in all circular_arc_tests
bsalomon [Mon, 22 Aug 2016 17:00:14 +0000 (10:00 -0700)]
Add stroke-and-fill circular arc test, test near 180deg arc in all circular_arc_tests

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261233002

Review-Url: https://codereview.chromium.org/2261233002

7 years agoDetect all named gammas
msarett [Mon, 22 Aug 2016 16:44:35 +0000 (09:44 -0700)]
Detect all named gammas

Our DstColorSpace UMA is showing some named gammas that are
not appropriately detected and placed in named categories.
https://uma.googleplex.com/p/chrome/histograms?endDate=latest&dayCount=1&histograms=Blink.ColorSpace.Destination&fixupData=true&showMax=true&filters=isofficial%2Ceq%2CTrue&implicitFilters=isofficial

This CL should fix that.

I'm not sure (yet) how I feel about this landing permanently.
Seems a little messy.

But it will be interesting to see how this affects the UMA.
My best guess is that we are hitting this case when all
three gammas are "invalid" in different ways.  I'm expecting
to see some profiles end up in the "invalid" category now.

It's also possible that we'll see these cases being absorbed
into sRGB or somewhere else.

BUG=skia:5656
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261213002

Review-Url: https://codereview.chromium.org/2261213002

7 years agocompress_r11eac_blocks() required more alignment than dst has.
mtklein [Mon, 22 Aug 2016 16:30:53 +0000 (09:30 -0700)]
compress_r11eac_blocks() required more alignment than dst has.

This shouldn't change any behavior except that the stores to dst
will no longer require 8-byte alignment.

Empirically it seems like we can use 4-byte alignment here,
but u8 (i.e. 1-byte alignment) is always safe.

BUG=skia:5637
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2264103002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2264103002

7 years agoRevert of Moving SkBlurImageFilter into core (patchset #6 id:100001 of https://codere...
mtklein [Mon, 22 Aug 2016 16:25:59 +0000 (09:25 -0700)]
Revert of Moving SkBlurImageFilter into core (patchset #6 id:100001 of https://codereview.chromium.org/2255803003/ )

Reason for revert:
It looks like this breaks our roll into Google3:
https://test.corp.google.com/ui#id=OCL:130943857:BASE:130944046:1471881622765:61dbdd3

Original issue's description:
> Moving SkBlurImageFilter into core
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003
>
> Committed: https://skia.googlesource.com/skia/+/dd3259eb95c3b47e11eefa3b176365a112a32b48

TBR=reed@google.com,fmalita@chromium.org,vjiaoblack@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2263283002

7 years agoUse ARMv8 CRC32 instructions for SkOpts::hash().
mtklein [Mon, 22 Aug 2016 15:53:45 +0000 (08:53 -0700)]
Use ARMv8 CRC32 instructions for SkOpts::hash().

For large inputs, this runs ~11x faster than Murmur3.
My bench drops from 1µs to 88ns.

Like x86-64, this runs fastest if we work in 24 byte chunks.  16 byte chunks
run at about 0.75x this speed, 8 byte chunks at about 0.4x (which would still
be about 5x faster than Murmur3).

This'll require plumbing support for opts_crc32 into Chrome first before it can roll.

perf.skia.org charts we want to watch: https://perf.skia.org/#5490

Seach for compute_hash in these logs to see the difference:
baseline: https://luci-milo.appspot.com/swarming/task/30ba22f3dfe30e10/steps/nanobench/0/stdout
trybot: https://luci-milo.appspot.com/swarming/task/30bbc406cbf62d10/steps/nanobench/0/stdout

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2260823002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2260823002

7 years agoMoving SkBlurImageFilter into core
vjiaoblack [Mon, 22 Aug 2016 15:50:20 +0000 (08:50 -0700)]
Moving SkBlurImageFilter into core

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255803003

Review-Url: https://codereview.chromium.org/2255803003

7 years agoSupport color xforms for kIndex8 pngs
msarett [Mon, 22 Aug 2016 15:48:40 +0000 (08:48 -0700)]
Support color xforms for kIndex8 pngs

This change started as: "Always use color xforms to
premultiply".  We need to be in a linear space to
premultiply correctly.

It became clear that we also need to support kIndex8
color xforms in order to make this change.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246143002

Review-Url: https://codereview.chromium.org/2246143002

7 years ago'g' key toggles showgrid for PerlinPatch
reed [Mon, 22 Aug 2016 15:45:15 +0000 (08:45 -0700)]
'g' key toggles showgrid for PerlinPatch

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2269673002

TBR=

Review-Url: https://codereview.chromium.org/2269673002

7 years agoSupply a color space in sRGB/F16 mode of SampleApp
brianosman [Mon, 22 Aug 2016 15:23:09 +0000 (08:23 -0700)]
Supply a color space in sRGB/F16 mode of SampleApp

Ganesh now uses this to decide if it should perform gamma-correct
rendering, so the color space is necessary to get correct results in
S32/F16.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2266763004

Review-Url: https://codereview.chromium.org/2266763004

7 years agoRoll recipe DEPS
rmistry [Mon, 22 Aug 2016 15:01:28 +0000 (08:01 -0700)]
Roll recipe DEPS

BUG=skia:5627
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2266933002

Review-Url: https://codereview.chromium.org/2266933002

7 years ago'F' will toggle filtering for the --picture sample
reed [Mon, 22 Aug 2016 14:41:46 +0000 (07:41 -0700)]
'F' will toggle filtering for the --picture sample

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263203002

TBR=

Review-Url: https://codereview.chromium.org/2263203002

7 years agoFix color xform width bug when scaling/subsetting
msarett [Mon, 22 Aug 2016 14:41:28 +0000 (07:41 -0700)]
Fix color xform width bug when scaling/subsetting

This was not caught by the bots because we don't test
color correct modes with our many image decoding tests
(takes too long).

Adding a unit test.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2247743002

Review-Url: https://codereview.chromium.org/2247743002

7 years agoBuild command buffer with is_component_build=false
borenet [Mon, 22 Aug 2016 14:31:43 +0000 (07:31 -0700)]
Build command buffer with is_component_build=false

BUG=skia:5630
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265913002

Review-Url: https://codereview.chromium.org/2265913002

7 years agoAdjust angles in circular arcs GMs to test smaller arcs
bsalomon [Mon, 22 Aug 2016 14:26:08 +0000 (07:26 -0700)]
Adjust angles in circular arcs GMs to test smaller arcs

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267713002

Review-Url: https://codereview.chromium.org/2267713002

7 years agoadd SkMatrixPriv for specialized helpers
reed [Mon, 22 Aug 2016 13:39:49 +0000 (06:39 -0700)]
add SkMatrixPriv for specialized helpers

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268443002

Review-Url: https://codereview.chromium.org/2268443002

7 years agoGN: _turbo -> -turbo to match Fuchsia
mtklein [Mon, 22 Aug 2016 13:32:39 +0000 (06:32 -0700)]
GN: _turbo -> -turbo to match Fuchsia

We might as well match the folks who are using our GN files now.

We've got plenty of strategies in our pocket for when we try to move Chrome
onto our GN files (and who knows, there may be even a new better way by then):
  * Same sort of rename in Chrome's third_party
  * Aliased targets via //build/secondary in Chrome.
  * Indirection via build_overrides

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265503002

Review-Url: https://codereview.chromium.org/2265503002

7 years agoSimplify the gradient color stop optimizer
fmalita [Mon, 22 Aug 2016 13:28:57 +0000 (06:28 -0700)]
Simplify the gradient color stop optimizer

We're just discarding the leftmost/rightmost stops -- this can be
achieved by simply adjusting the start offset and count.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265803002

Review-Url: https://codereview.chromium.org/2265803002

7 years agoAdd a gradient edge optimization test
fmalita [Mon, 22 Aug 2016 13:22:28 +0000 (06:22 -0700)]
Add a gradient edge optimization test

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267593002

Review-Url: https://codereview.chromium.org/2267593002

7 years agomake zoomer text clearer
reed [Mon, 22 Aug 2016 02:30:13 +0000 (19:30 -0700)]
make zoomer text clearer

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267623002

TBR=

Review-Url: https://codereview.chromium.org/2267623002

7 years agoadd translate to exercise non-identity ctm performance
reed [Sun, 21 Aug 2016 22:03:47 +0000 (15:03 -0700)]
add translate to exercise non-identity ctm performance

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261063002

TBR=

Review-Url: https://codereview.chromium.org/2261063002

7 years agoUpdate SKP version
update-skps [Sun, 21 Aug 2016 08:51:30 +0000 (01:51 -0700)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261983002

Review-Url: https://codereview.chromium.org/2261983002

7 years agoremove unused field from SkDrawIter
reed [Sat, 20 Aug 2016 18:32:48 +0000 (11:32 -0700)]
remove unused field from SkDrawIter

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267553002

TBR=

Review-Url: https://codereview.chromium.org/2267553002

7 years agostore info in basedevice, change getter to non-virtual const&
reed [Sat, 20 Aug 2016 14:59:19 +0000 (07:59 -0700)]
store info in basedevice, change getter to non-virtual const&

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261003003

Review-Url: https://codereview.chromium.org/2261003003

7 years agosrc/utils/SkBitSet: simplify
halcanary [Fri, 19 Aug 2016 23:23:23 +0000 (16:23 -0700)]
src/utils/SkBitSet: simplify

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265623002

Review-Url: https://codereview.chromium.org/2265623002

7 years agoRename circular_arcs_circular_arcs_fill to circular_arcs_fill.
bsalomon [Fri, 19 Aug 2016 20:41:28 +0000 (13:41 -0700)]
Rename circular_arcs_circular_arcs_fill to circular_arcs_fill.

Also fix issue with second paint's alpha getting overwritten.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2265643002

Review-Url: https://codereview.chromium.org/2265643002

7 years agoMove GrFixedClip into src directory
csmartdalton [Fri, 19 Aug 2016 20:29:27 +0000 (13:29 -0700)]
Move GrFixedClip into src directory

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254343003

Review-Url: https://codereview.chromium.org/2254343003

7 years agoAdded a small widget framework to the interactive bevel SampleApp
dvonbeck [Fri, 19 Aug 2016 19:41:48 +0000 (12:41 -0700)]
Added a small widget framework to the interactive bevel SampleApp

I made a small framework to add slider and radial controls more easily.
The Sample now has controls for light direction and color.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259183003

Review-Url: https://codereview.chromium.org/2259183003

7 years agoPlumb drawArc to SkDevice.
bsalomon [Fri, 19 Aug 2016 18:25:19 +0000 (11:25 -0700)]
Plumb drawArc to SkDevice.

Plumbs the drawArc canvas method down to SkDevice without converting to a path. Plumbs through the various recording canvas classes.

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257023003

Review-Url: https://codereview.chromium.org/2257023003

7 years agoAdded SkColor4f::FromColor3f(SkColor3f, float a)
dvonbeck [Fri, 19 Aug 2016 18:23:15 +0000 (11:23 -0700)]
Added SkColor4f::FromColor3f(SkColor3f, float a)

Planning to use this for the ColorDisplay widget in https://codereview.chromium.org/2259183003/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2264643002

Review-Url: https://codereview.chromium.org/2264643002

7 years agoAdd GMs for testing drawArc.
bsalomon [Fri, 19 Aug 2016 17:53:13 +0000 (10:53 -0700)]
Add GMs for testing drawArc.

This is in preparation for virtualizing this on SkCanvas/SkDevice.

Tests the following variations:

aa and non-aa
stroke/hairline/fill
cap types
using center point and not

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2264593002

Review-Url: https://codereview.chromium.org/2264593002

7 years agoFast path translate() in SkCanvas and SkLiteDL.
mtklein [Fri, 19 Aug 2016 16:05:27 +0000 (09:05 -0700)]
Fast path translate() in SkCanvas and SkLiteDL.

This adds didTranslate() so that SkLiteDL (and other canvas recorders)
can record the translate rather than the full concat.

It also adds a case to SkMatrix::preTranslate() to fast path
translate x translate -> translate (i.e. +=).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002

Committed: https://skia.googlesource.com/skia/+/5fa47f4fd13b3158de4599414c86d17649c2dd1c

Misc bots failing in pictureimagefilter replay modes.
https://luci-milo.appspot.com/swarming/task/30b8e53f3a1f4f10/steps/dm/0/stdout

Problem is FMA vs. not.

CQ_INCLUDE_TRYBOTS=master.client.skia:
Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot

Review-Url: https://codereview.chromium.org/2255283002

7 years agoImplement gradient simplification for 0,0,1 and 0,1,1 gradients
fmenozzi [Fri, 19 Aug 2016 15:56:56 +0000 (08:56 -0700)]
Implement gradient simplification for 0,0,1 and 0,1,1 gradients

Depends on https://codereview.chromium.org/2259823005/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256843004

Review-Url: https://codereview.chromium.org/2256843004

7 years agoSimplify embeddability test.
bungeman [Fri, 19 Aug 2016 15:45:37 +0000 (08:45 -0700)]
Simplify embeddability test.

There is no reason to read the whole OS/2 table, and no need to spell
out the full names of all the types over and over.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256783002

Review-Url: https://codereview.chromium.org/2256783002

7 years agoFix bug, always keep fIsScaleTranslate in correct state
msarett [Fri, 19 Aug 2016 15:38:36 +0000 (08:38 -0700)]
Fix bug, always keep fIsScaleTranslate in correct state

BUG:639179
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263513003

Review-Url: https://codereview.chromium.org/2263513003

7 years agoStep 1 of opts_crc32 rollout.
mtklein [Fri, 19 Aug 2016 15:07:51 +0000 (08:07 -0700)]
Step 1 of opts_crc32 rollout.

  - This adds an crc32_sources variable to opts.gypi and hooks it into
    our GYP build with a dummy source file.

Step 2 will hook crc32_sources into Chrome's GN build.
Step 3 will actually land some code using CRC32 instructions.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259233002

Review-Url: https://codereview.chromium.org/2259233002

7 years agoSome assert fixes for running the Fuzzer sample in GPU mode.
senorblanco [Fri, 19 Aug 2016 15:07:22 +0000 (08:07 -0700)]
Some assert fixes for running the Fuzzer sample in GPU mode.

quadraticPointCount, cubicPointCount: passing NaN to GrNextPow2 causes
it to assert, so detect that and return the max points per curve
instead.

Passing a zero scale to GrStyle::applyToPath() makes it assert, so
draw nothing (likely what drawing with a zero scale is going to do
anyway).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257423002

Review-Url: https://codereview.chromium.org/2257423002

7 years agoReturn color shader instead of 2-color gradient when color count is 1
fmenozzi [Fri, 19 Aug 2016 14:50:57 +0000 (07:50 -0700)]
Return color shader instead of 2-color gradient when color count is 1

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259823005

Committed: https://skia.googlesource.com/skia/+/da082a5767d7edfd3abe74fc683392422565a606
Review-Url: https://codereview.chromium.org/2259823005

7 years agofix fuzzes
caryclark [Fri, 19 Aug 2016 14:01:33 +0000 (07:01 -0700)]
fix fuzzes

TBR=reed@google.com
BUG=639157, 638783
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255243003

Review-Url: https://codereview.chromium.org/2255243003

7 years agoSkFontMgr_android clean up.
bungeman [Fri, 19 Aug 2016 12:03:26 +0000 (05:03 -0700)]
SkFontMgr_android clean up.

This removes the never used defaultTypeface, uses 'StyleSet' in field
names consistently, fixes potential leaks of names, and moves fields to
sk_sp.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256253003

Review-Url: https://codereview.chromium.org/2256253003

7 years agoinclude extra_cflags* in the step description
mtklein [Fri, 19 Aug 2016 11:27:34 +0000 (04:27 -0700)]
include extra_cflags* in the step description

This keeps them visible on the bots.
E.g. https://luci-milo.appspot.com/swarming/task/30b9147a09f2ac10/steps/ninja/0/stdout

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254733008

Review-Url: https://codereview.chromium.org/2254733008

7 years agomust call rand in reliable order for bots
reed [Fri, 19 Aug 2016 02:35:52 +0000 (19:35 -0700)]
must call rand in reliable order for bots

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254403002

TBR=

Review-Url: https://codereview.chromium.org/2254403002

7 years agoExpand Issue Tracking docs to include triage, Chrome instructions
hcm [Fri, 19 Aug 2016 01:32:17 +0000 (18:32 -0700)]
Expand Issue Tracking docs to include triage, Chrome instructions

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255133003
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2255133003

Review-Url: https://codereview.chromium.org/2255133003

7 years agoRevert of Fast path translate() in SkCanvas and SkLiteDL. (patchset #5 id:80001 of...
mtklein [Fri, 19 Aug 2016 00:43:59 +0000 (17:43 -0700)]
Revert of Fast path translate() in SkCanvas and SkLiteDL. (patchset #5 id:80001 of https://codereview.chromium.org/2255283002/ )

Reason for revert:
speculative

Original issue's description:
> Fast path translate() in SkCanvas and SkLiteDL.
>
> This adds didTranslate() so that SkLiteDL (and other canvas recorders)
> can record the translate rather than the full concat.
>
> It also adds a case to SkMatrix::preTranslate() to fast path
> translate x translate -> translate (i.e. +=).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002
>
> Committed: https://skia.googlesource.com/skia/+/5fa47f4fd13b3158de4599414c86d17649c2dd1c

TBR=herb@google.com,reed@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2264433002

7 years agoquick check to not use AutoDrawLooper
reed [Fri, 19 Aug 2016 00:15:25 +0000 (17:15 -0700)]
quick check to not use AutoDrawLooper

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248373004

Review-Url: https://codereview.chromium.org/2248373004

7 years agoRevert of Return color shader instead of 2-color gradient when color count is 1 ...
reed [Thu, 18 Aug 2016 23:13:50 +0000 (16:13 -0700)]
Revert of Return color shader instead of 2-color gradient when color count is 1 (patchset #3 id:40001 of https://codereview.chromium.org/2259823005/ )

Reason for revert:
breaks 2-pt-conical, which can sometimes not draw anything

Original issue's description:
> Return color shader instead of 2-color gradient when color count is 1
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259823005
>
> Committed: https://skia.googlesource.com/skia/+/da082a5767d7edfd3abe74fc683392422565a606

TBR=fmenozzi@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2257993002

7 years agoDetect CRC32 instructions on ARMv8.
mtklein [Thu, 18 Aug 2016 22:59:08 +0000 (15:59 -0700)]
Detect CRC32 instructions on ARMv8.

I have successfully detected CRC32 instruction support on my Nexus 5x.

Use of these instructions to follow... I am not yet sure which compilers if any will give me instrinsics or let me write them in asm.

defined(__ARM_FEATURE_CRC32) should cover users like Android Framework who build with the best settings possible.  cpu-features.h covers use cases like Clank and our bots.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259133002

Review-Url: https://codereview.chromium.org/2259133002

7 years agoBatched implementation of drawLattice() for GPU
msarett [Thu, 18 Aug 2016 22:46:03 +0000 (15:46 -0700)]
Batched implementation of drawLattice() for GPU

Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    30.9us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    31.8us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    38.2us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    38.4us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002

Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d
Review-Url: https://codereview.chromium.org/2255963002

7 years agoFast path translate() in SkCanvas and SkLiteDL.
mtklein [Thu, 18 Aug 2016 22:42:32 +0000 (15:42 -0700)]
Fast path translate() in SkCanvas and SkLiteDL.

This adds didTranslate() so that SkLiteDL (and other canvas recorders)
can record the translate rather than the full concat.

It also adds a case to SkMatrix::preTranslate() to fast path
translate x translate -> translate (i.e. +=).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002

Review-Url: https://codereview.chromium.org/2255283002

7 years agoRelax check for gpu use of static src-over XP
egdaniel [Thu, 18 Aug 2016 22:21:55 +0000 (15:21 -0700)]
Relax check for gpu use of static src-over XP

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259113002

Review-Url: https://codereview.chromium.org/2259113002

7 years agoadd simplerect gm
reed [Thu, 18 Aug 2016 22:01:10 +0000 (15:01 -0700)]
add simplerect gm

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257263002

TBR=bsalomon
NOTRY=True

Review-Url: https://codereview.chromium.org/2257263002

7 years agoReturn color shader instead of 2-color gradient when color count is 1
fmenozzi [Thu, 18 Aug 2016 21:50:56 +0000 (14:50 -0700)]
Return color shader instead of 2-color gradient when color count is 1

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259823005

Review-Url: https://codereview.chromium.org/2259823005

7 years agoUse CSS3 style matching on Android.
bungeman [Thu, 18 Aug 2016 21:36:02 +0000 (14:36 -0700)]
Use CSS3 style matching on Android.

Android framework doesn't really use this, the largest user is Chromium.
At the moment this doesn't resolve oblique requests in a nice way, but
the existing code is somewhat close to CSS3 rules already. Instead of
adding oblique handling manually, just use the existing CSS3 style
matching.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256843003

Review-Url: https://codereview.chromium.org/2256843003

7 years agoRevert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001...
msarett [Thu, 18 Aug 2016 21:29:22 +0000 (14:29 -0700)]
Revert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001 of https://codereview.chromium.org/2255963002/ )

Reason for revert:
Things drawing weird.

Original issue's description:
> Batched implementation of drawLattice() for GPU
>
> Bechmarks (Nexus 6P):
>
> Src=100x100, Dst=250x250, NumRects=9
> Android              77.7us
> Skia (without patch) 57.2us
> Skia (with patch)    34.7us
>
> Src=100x100, Dst=500x500, NumRects=9
> Android              77.0us
> Skia (without patch) 56.9us
> Skia (with patch)    44.5us
>
> Src=100x100, Dst=1000x1000, NumRects=9
> Android              180us
> Skia (without patch) 96.8us
> Skia (with patch)    70.5us
>
> Src=100x100, Dst=250x250, NumRects=15
> Android              208us
> Skia (without patch) 155us
> Skia (with patch)    55.9us
>
> Src=100x100, Dst=500x500, NumRects=15
> Android              207us
> Skia (without patch) 152us
> Skia (with patch)    63.0us
>
> Src=100x100, Dst=1000x1000, NumRects=15
> Android              233us
> Skia (without patch) 156us
> Skia (with patch)    99.9us
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002
>
> Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d

TBR=bsalomon@google.com,reed@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2255683004

7 years agoSkPDF: in-place font subsetting
halcanary [Thu, 18 Aug 2016 21:22:52 +0000 (14:22 -0700)]
SkPDF: in-place font subsetting

Motivation: gross code simplification, also no bitset lookups at draw time.

SkPDFFont owns its glyph useage bitset.

SkPDFSubstituteMap goes away.

SkPDFObject interface is simplified.

SkPDFDocument tracks font usage (as hash set), not glyph usage.

SkPDFFont gets a simpler constructor.

SkPDFFont has first and last glyph set in constructor, not adjusted later.

SkPDFFont implementations are simplified.

SkPDFGlyphSet is replaced with simple SkBitSet.

SkPDFFont sizes its SkBitSets based on glyph count.

SkPDFGlyphSetMap goes away.

SkBitSet is now non-copyable.

SkBitSet now how utility methods to match old SkPDFGlyphSet.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253283004

7 years agoFix initialization bug for fConservativeIsScaleTranslate
msarett [Thu, 18 Aug 2016 21:03:30 +0000 (14:03 -0700)]
Fix initialization bug for fConservativeIsScaleTranslate

Also don't mark it as conservative, we expect it to be correct all
the time.

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2261573002

Review-Url: https://codereview.chromium.org/2261573002

7 years agoDelay creation of cpu-side buffer memory until actually needed
robertphillips [Thu, 18 Aug 2016 21:01:14 +0000 (14:01 -0700)]
Delay creation of cpu-side buffer memory until actually needed

IIUC what is going on, this won't really do anything bad but will defer allocation of the cpu-side buffer until it is actually needed.

BUG=635015
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248283007

Review-Url: https://codereview.chromium.org/2248283007

7 years agoBatched implementation of drawLattice() for GPU
msarett [Thu, 18 Aug 2016 20:11:48 +0000 (13:11 -0700)]
Batched implementation of drawLattice() for GPU

Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    34.7us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    44.5us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    55.9us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    63.0us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002

Review-Url: https://codereview.chromium.org/2255963002

7 years agomake LayerIter private, and remove skipClip option
reed [Thu, 18 Aug 2016 19:45:34 +0000 (12:45 -0700)]
make LayerIter private, and remove skipClip option

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257203002

Review-Url: https://codereview.chromium.org/2257203002

7 years agoGN: make libjpeg_turbo target Chrome-compatible
mtklein [Thu, 18 Aug 2016 19:04:13 +0000 (12:04 -0700)]
GN: make libjpeg_turbo target Chrome-compatible

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257903002

Review-Url: https://codereview.chromium.org/2257903002

7 years agoTessellator: better fix for reused-edges issue.
senorblanco [Thu, 18 Aug 2016 17:20:47 +0000 (10:20 -0700)]
Tessellator: better fix for reused-edges issue.

The GrTessellator fix for doubly-added edges in
https://codereview.chromium.org/2259493002/ could leave
a MonotonePoly with zero edges. This is a problem for
Poly::addEdge(), which assumes that MonotonePolys always have
at least one edge. The fix is to move the check and early-out up to
Poly::addEdge(). This should also tighten up the vertex count.

(Unfortunately, the only repro I have for this issue is very
convoluted, and requires non-landed code.)

BUG=skia:5636
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251643008

Review-Url: https://codereview.chromium.org/2251643008

7 years agoSkPDF: cache metrics once.
halcanary [Thu, 18 Aug 2016 16:52:48 +0000 (09:52 -0700)]
SkPDF:  cache metrics once.

Motivation: drawText can look up unicode mapping at draw time to see
if ActualText should be used after crrev.com/2084533004 lands.

For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
document.  Cache the result in the SkPDFCanon, indexed by SkFontID.
Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
(Type1 fonts only).

Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t.  Map
that uint64_t to SkPDFFonts.  Remove SkPDFCanon::findFont(),
SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.

SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
get metrics from canon.

SkPDFFont multybite bool is now a function of type.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253993002

7 years agoremove disable aa/dither flags from Props -- never used
reed [Thu, 18 Aug 2016 16:30:44 +0000 (09:30 -0700)]
remove disable aa/dither flags from Props -- never used

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257643003

TBR=bsalomon

Review-Url: https://codereview.chromium.org/2257643003

7 years agoInteractive Bevel Sample App
dvonbeck [Thu, 18 Aug 2016 15:55:48 +0000 (08:55 -0700)]
Interactive Bevel Sample App

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246243002

Review-Url: https://codereview.chromium.org/2246243002

7 years agoDon't emit dead code in circle shader when not using distance vectors.
bsalomon [Thu, 18 Aug 2016 15:32:27 +0000 (08:32 -0700)]
Don't emit dead code in circle shader when not using distance vectors.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254103004

Review-Url: https://codereview.chromium.org/2254103004

7 years agoRename WorseCaseSize to WorstCasSize
robertphillips [Thu, 18 Aug 2016 14:11:13 +0000 (07:11 -0700)]
Rename WorseCaseSize to WorstCasSize
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259863002

Review-Url: https://codereview.chromium.org/2259863002

7 years agoAdd alpha type to texture producer
brianosman [Thu, 18 Aug 2016 13:43:03 +0000 (06:43 -0700)]
Add alpha type to texture producer

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250403003

Review-Url: https://codereview.chromium.org/2250403003