platform/upstream/libSkiaSharp.git
7 years agoReland "Add RasterPipeline implementation for SkColorSpaceXform"
Matt Sarett [Thu, 1 Dec 2016 19:46:12 +0000 (14:46 -0500)]
Reland "Add RasterPipeline implementation for SkColorSpaceXform"

This is initially turned on for Linux debug builds,
which allows us to start testing.

Chrome for Android is a really good candidate for
this (will appreciate the code size savings), but
I'd first like to run some tests to understand the
performance/size tradeoffs a little better.

BUG:660416

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ifc80e663767df6bb767abb8b12b1ec5cec644ec5
Reviewed-on: https://skia-review.googlesource.com/5452
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agodocs: Update Perf docs.
Joe Gregorio [Thu, 1 Dec 2016 20:37:06 +0000 (15:37 -0500)]
docs: Update Perf docs.

BUG=skia:

NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=5458

Change-Id: If8a452711076bef19566fa64a5a52ca9b3e7b83c
Reviewed-on: https://skia-review.googlesource.com/5458
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>

7 years agoUpdate skimage version, test CMYK images
Matt Sarett [Thu, 1 Dec 2016 19:24:01 +0000 (14:24 -0500)]
Update skimage version, test CMYK images

BUG=skia:

Change-Id: Id0c9ba3c722304813e3605ef61b87fa00249eaf9
Reviewed-on: https://skia-review.googlesource.com/5449
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Robert Aftias <raftias@google.com>
7 years agoRevert "SkColorSpaceXform bug fixes"
Matt Sarett [Thu, 1 Dec 2016 20:28:35 +0000 (20:28 +0000)]
Revert "SkColorSpaceXform bug fixes"

This reverts commit d0fdc0f234b8b55cf418f4db9466d3883deadfb1.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> SkColorSpaceXform bug fixes
>
> (1) Clamp properly!
>
> Finally came to this realization: clamping in the
> store functions (after gamma encoding) is ridiculous.
> It is impossible to know how to clamp premul values
> to alpha when they are already gamma encoded.
>
> I've moved the clamp out of the store function.
> Whew, this actually makes the code look simpler.
>
> And I expect this to fix some buggy images on Gold!
>
> (2) Correctly handle the memcpy() case.
>
> Looks like this only ever worked for RGBA inputs,
> never got updated when we added BGRA inputs.
>
> This probably flew under the radar because the
> clients are smart enough to avoid performing a
> color xform altogether when the color spaces
> match.
>
> BUG=skia:
>
> Change-Id: I4870048105efcbecc70b4bd5f77c39537006363e
> Reviewed-on: https://skia-review.googlesource.com/5389
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Id9e4cfdaa7b30a3841e83c4cde16aa7d33acc0f2
Reviewed-on: https://skia-review.googlesource.com/5457
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAvoid creating std::function in run_pipeline().
Mike Klein [Thu, 1 Dec 2016 19:05:38 +0000 (14:05 -0500)]
Avoid creating std::function in run_pipeline().

This avoids a malloc/free per SkRasterPipeline::run(), with no downside.

  $ out/nanobench --benchType skcolorcodec --colorImages images/colorspace/201293.jpg --skps noskps --xform_only --srgb --ms 10000

  target:  273µs
  current: 395µs
  this CL: 375µs

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Icd62f505f555ebf4ca66ee77a476f59cab68433d
Reviewed-on: https://skia-review.googlesource.com/5447
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAdded CMYK support for ICC profiles.
raftias [Thu, 1 Dec 2016 18:44:07 +0000 (13:44 -0500)]
Added CMYK support for ICC profiles.

Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I11e3d17180244281be3eb43fd608609925a7f71e
Reviewed-on: https://skia-review.googlesource.com/5444
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRevert "Add RasterPipeline implementation for SkColorSpaceXform"
Brian Osman [Thu, 1 Dec 2016 19:06:23 +0000 (19:06 +0000)]
Revert "Add RasterPipeline implementation for SkColorSpaceXform"

This reverts commit dd19ac7d10c7c00dd6e9b1f4c4c6aae729c7e6d4.

Reason for revert: ASAN

Change-Id: I59aacc092398c4db40696a8343d657a5ad7c0f66
Reviewed-on: https://skia-review.googlesource.com/5448
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRemove use of makeDeferredRenderTargetContextWithFallback
Robert Phillips [Thu, 1 Dec 2016 17:57:20 +0000 (12:57 -0500)]
Remove use of makeDeferredRenderTargetContextWithFallback

This is a partial revert of https://codereview.chromium.org/2514543002 (Defer more renderTargetContexts in the GPU image filter paths - take 2)

I have been unable to reproduce the performance regression in crbug.com/668179 locally so intend to revert the above CL piecemeal.

BUG=668179

Change-Id: Idf3d66d71c452f5718d7b1d8d945ca7ff46b75d8
Reviewed-on: https://skia-review.googlesource.com/5441
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoRevert of Enable sRGB on iOS, make sRGB decode support optional (patchset #11 id...
brianosman [Thu, 1 Dec 2016 18:42:03 +0000 (10:42 -0800)]
Revert of Enable sRGB on iOS, make sRGB decode support optional (patchset #11 id:200001 of https://codereview.chromium.org/2539993002/ )

Reason for revert:
ANGLE tests are failing

Original issue's description:
> Two (related) changes here:
>
> 1) Our older iOS devices failed our sRGB tests, due to precision issues
> with alpha. At this point, we only test on iPadMini 4, and that appears
> not to have any problems.
>
> 2) iOS devices still don't have the sRGB texture decode extension. But,
> some clients have no interest in mixing legacy/color-correct rendering,
> and would like to use sRGB on these devices. This GrContextOptions flag
> enables sRGB support in those cases.
>
> Adjust the test code to produce sRGB capable contexts on these devices,
> but only for configs that have a color space. (See comment).
>
> BUG=skia:4148
>
> Committed: https://skia.googlesource.com/skia/+/9db12d2341f3f8722c8b90b11dd4cce138a8a64e

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

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

7 years agoAdd RasterPipeline implementation for SkColorSpaceXform
Matt Sarett [Thu, 1 Dec 2016 17:51:14 +0000 (12:51 -0500)]
Add RasterPipeline implementation for SkColorSpaceXform

This is initially turned on for Linux debug builds,
which allows us to start testing.

Chrome for Android is a really good candidate for
this (will appreciate the code size savings), but
I'd first like to run some tests to understand the
performance/size tradeoffs a little better.

BUG:660416

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I0fb2512216dfc0bda2e5388f9865318eec22291e
Reviewed-on: https://skia-review.googlesource.com/5348
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoAdd animating blur image filter GM/slide/bench
Robert Phillips [Thu, 1 Dec 2016 17:42:43 +0000 (12:42 -0500)]
Add animating blur image filter GM/slide/bench

Probably still worth having but I haven't been able to reproduce the perf regression in
crbug.com/668179 with it yet.

Change-Id: If3b0f2998ff38a17a173895ed9cea6950a81f6b7
Reviewed-on: https://skia-review.googlesource.com/5382
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoSkNoDrawCanvas - a public non-drawing canvas base class
Florin Malita [Thu, 1 Dec 2016 17:47:59 +0000 (12:47 -0500)]
SkNoDrawCanvas - a public non-drawing canvas base class

TODO:

  - convert SkDeferredCanvas, SkLiteRecorder, etc. to the new base
  - remove unused SkNoSaveLayerCanvas

BUG=chromium:668925
R=reed@google.com,mtklein@google.com

Change-Id: Ie9af577477a6b9eaa5ef55523287ad1635dca116
Reviewed-on: https://skia-review.googlesource.com/5349
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agoAdd srgb and f16 modes to fiddle
Matt Sarett [Tue, 29 Nov 2016 22:14:58 +0000 (17:14 -0500)]
Add srgb and f16 modes to fiddle

BUG=skia:5945

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

Change-Id: I29b87a3b2eb20b8d28f8fb970b5192807bebdc48
Reviewed-on: https://skia-review.googlesource.com/4546
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agothird_party/ktx: put WriteBitmapToKTX back
Hal Canary [Thu, 1 Dec 2016 17:40:02 +0000 (12:40 -0500)]
third_party/ktx: put WriteBitmapToKTX back

BUG=skia:

Change-Id: I876e802db370a7812cd53e42cb4927702e6c1fb6
Reviewed-on: https://skia-review.googlesource.com/5418
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRevert "Revert "Revert "remove (empty) SkXfermode.h"""
Mike Reed [Thu, 1 Dec 2016 17:32:30 +0000 (17:32 +0000)]
Revert "Revert "Revert "remove (empty) SkXfermode.h"""

This reverts commit 1c038af278a69186e988dd9348b4089d78759492.

Reason for revert: <INSERT REASONING HERE>

More breaks in g3 (e.g. blink_headless)

Original change's description:
> Revert "Revert "remove (empty) SkXfermode.h""
>
> This reverts commit c5d0147717e50acba106b76c6c345192274ddc06.
>
> g3 is updated to allow this to land
>
> BUG=skia:
>
> Change-Id: I5f4b06c2dc77dfa66d9b32348375151177511a65
> Reviewed-on: https://skia-review.googlesource.com/5406
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
>

TBR=reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I77f69512f616120382c31d90243f7df13985d76c
Reviewed-on: https://skia-review.googlesource.com/5419
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoTwo (related) changes here:
brianosman [Thu, 1 Dec 2016 17:02:03 +0000 (09:02 -0800)]
Two (related) changes here:

1) Our older iOS devices failed our sRGB tests, due to precision issues
with alpha. At this point, we only test on iPadMini 4, and that appears
not to have any problems.

2) iOS devices still don't have the sRGB texture decode extension. But,
some clients have no interest in mixing legacy/color-correct rendering,
and would like to use sRGB on these devices. This GrContextOptions flag
enables sRGB support in those cases.

Adjust the test code to produce sRGB capable contexts on these devices,
but only for configs that have a color space. (See comment).

BUG=skia:4148

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

7 years agoRename GrDrawBatch->GrDrawOp
Brian Salomon [Thu, 1 Dec 2016 15:59:09 +0000 (10:59 -0500)]
Rename GrDrawBatch->GrDrawOp

Change-Id: I18f520924b8a2548566fd61dbea4e3e12bd253dd
Reviewed-on: https://skia-review.googlesource.com/5411
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRevert "Added CMYK support for ICC profiles."
Mike Klein [Thu, 1 Dec 2016 16:38:16 +0000 (16:38 +0000)]
Revert "Added CMYK support for ICC profiles."

This reverts commit 51c3fcd376c5c9972d9476b5532f6164375a38d1.

Reason for revert: ASAN, MSAN both take issue with parse_and_load_gamma()

Original change's description:
> Added CMYK support for ICC profiles.
>
> Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
> inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
> (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
> parsing and color xforming of ICC CMYK images.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
>
>
> Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
> Reviewed-on: https://skia-review.googlesource.com/5197
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
>

TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,scroggo@google.com,brianosman@google.com,raftias@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ib43fef00bc233c0b4fa47ed29040d69601def267
Reviewed-on: https://skia-review.googlesource.com/5423
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoAdded CMYK support for ICC profiles.
raftias [Wed, 30 Nov 2016 16:19:22 +0000 (11:19 -0500)]
Added CMYK support for ICC profiles.

Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
Reviewed-on: https://skia-review.googlesource.com/5197
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agomove all memset() logic into blitter
Mike Klein [Thu, 1 Dec 2016 00:39:43 +0000 (19:39 -0500)]
move all memset() logic into blitter

It's cute in compile_pipeline(), but as before, clearer and simpler in the blitter.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ib83ff097e4e057e72aed785797e6ac0029ca5dbf
Reviewed-on: https://skia-review.googlesource.com/5399
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRename GrBatch to GrOp
Brian Salomon [Thu, 1 Dec 2016 14:36:50 +0000 (09:36 -0500)]
Rename GrBatch to GrOp

Change-Id: I27b6324f8040899fafeda23ca524bc54a4dbf090
Reviewed-on: https://skia-review.googlesource.com/5392
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRemove pipeline info dump from GrDrawBatch
Brian Salomon [Thu, 1 Dec 2016 14:35:30 +0000 (09:35 -0500)]
Remove pipeline info dump from GrDrawBatch

Also adds more overrides of GrBatch::dumpInfo.

This removes a use case of the GrPipeline member of GrDrawBatch.

Change-Id: I93f5f2993be41ffa290122f12a683d2bac453e1d
Reviewed-on: https://skia-review.googlesource.com/5354
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRevert "Revert "remove (empty) SkXfermode.h""
Mike Reed [Thu, 1 Dec 2016 14:30:08 +0000 (09:30 -0500)]
Revert "Revert "remove (empty) SkXfermode.h""

This reverts commit c5d0147717e50acba106b76c6c345192274ddc06.

g3 is updated to allow this to land

BUG=skia:

Change-Id: I5f4b06c2dc77dfa66d9b32348375151177511a65
Reviewed-on: https://skia-review.googlesource.com/5406
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoNo SkEncodeImageAsKTX for ANDROID_FRAMEWORK
Hal Canary [Thu, 1 Dec 2016 14:24:03 +0000 (09:24 -0500)]
No SkEncodeImageAsKTX for ANDROID_FRAMEWORK

BUG=skia:

Change-Id: Ia2925eb6aecd576d078256013fe122a468c30a5a
Reviewed-on: https://skia-review.googlesource.com/5421
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoSkColorSpaceXform bug fixes
Matt Sarett [Wed, 30 Nov 2016 23:49:40 +0000 (18:49 -0500)]
SkColorSpaceXform bug fixes

(1) Clamp properly!

Finally came to this realization: clamping in the
store functions (after gamma encoding) is ridiculous.
It is impossible to know how to clamp premul values
to alpha when they are already gamma encoded.

I've moved the clamp out of the store function.
Whew, this actually makes the code look simpler.

And I expect this to fix some buggy images on Gold!

(2) Correctly handle the memcpy() case.

Looks like this only ever worked for RGBA inputs,
never got updated when we added BGRA inputs.

This probably flew under the radar because the
clients are smart enough to avoid performing a
color xform altogether when the color spaces
match.

BUG=skia:

Change-Id: I4870048105efcbecc70b4bd5f77c39537006363e
Reviewed-on: https://skia-review.googlesource.com/5389
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years ago[nobuildbot] CT bots
Eric Boren [Wed, 30 Nov 2016 19:05:16 +0000 (14:05 -0500)]
[nobuildbot] CT bots

BUG=skia:

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

Change-Id: I2d131415c912790cf1aeceaccc23be85ade7f5f0
Reviewed-on: https://skia-review.googlesource.com/5183
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agosupport medium and high quality
Mike Klein [Tue, 29 Nov 2016 21:37:12 +0000 (16:37 -0500)]
support medium and high quality

Change-Id: I4ed750932cd6c768e21ca9f4a9e7f5f2408cfa4d
Reviewed-on: https://skia-review.googlesource.com/5323
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoSkEncodeImage: no more link-time registration
Hal Canary [Wed, 30 Nov 2016 22:07:59 +0000 (17:07 -0500)]
SkEncodeImage: no more link-time registration

Also, no more SkImageEncoder class.

SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS now only guards some
old API shims.

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

Change-Id: I3797f584f3e8e12ade10d31e8733163453725f40
Reviewed-on: https://skia-review.googlesource.com/5006
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoRemove GrBatch::renderTarget() and use GrBatch::renderTargetUniqueID() instead.
Brian Salomon [Wed, 30 Nov 2016 15:52:10 +0000 (10:52 -0500)]
Remove GrBatch::renderTarget() and use GrBatch::renderTargetUniqueID() instead.

Change-Id: I621ed38955e374c79a4d44c0020f9bae9655f001
Reviewed-on: https://skia-review.googlesource.com/5344
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove unused copySurfaceAsDraw code from GrVkGpu
Brian Osman [Wed, 30 Nov 2016 20:22:43 +0000 (15:22 -0500)]
Remove unused copySurfaceAsDraw code from GrVkGpu

The actual implementation of this lives in GrVkCopyManager now

BUG=skia:

Change-Id: I8b0577acef3ac3b9e835605d4044336975a96ee5
Reviewed-on: https://skia-review.googlesource.com/5390
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agofold more in SkRasterPipelineBlitter
Mike Klein [Wed, 30 Nov 2016 21:40:56 +0000 (16:40 -0500)]
fold more in SkRasterPipelineBlitter

No change in behavior.  This just moves the responsibility for this optimization to the blitter (which knows what it's doing) rather than to compile_pipeline(), which sort of has to guess.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I93ad0ac896075deab995b865b188b42de637f0f7
Reviewed-on: https://skia-review.googlesource.com/5398
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoconstant means constant
Mike Klein [Wed, 30 Nov 2016 21:05:10 +0000 (16:05 -0500)]
constant means constant

Strip all the "constant" verbiage out of stages that really just mean 1, single, scalar.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I3d71202b348fadc3ced8ecb6c18c939cf92d7243
Reviewed-on: https://skia-review.googlesource.com/5396
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRemove batch bounds drawing debug option
Brian Salomon [Wed, 30 Nov 2016 20:08:13 +0000 (15:08 -0500)]
Remove batch bounds drawing debug option

Change-Id: I6b8ffc81a1255974f8acd1dfc47cfd406fd4b0bf
Reviewed-on: https://skia-review.googlesource.com/5335
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRevert "Show constant-foldable runs in SkRasterPipeline::dump()."
Mike Klein [Wed, 30 Nov 2016 20:54:37 +0000 (20:54 +0000)]
Revert "Show constant-foldable runs in SkRasterPipeline::dump()."

This reverts commit 9ac7b2c545769a6b7c863b8e4c7f88096c9a9969.

Reason for revert: misguided.

Original change's description:
> Show constant-foldable runs in SkRasterPipeline::dump().
>
> Change-Id: I2f85249a09163dd21a8008f50340b8463718ada2
> Reviewed-on: https://skia-review.googlesource.com/5350
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3ae6c8ec11853592b332a17aefd611dc238e6c26
Reviewed-on: https://skia-review.googlesource.com/5394
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix error: ‘access’ may be used uninitialized in this function
Joe Gregorio [Wed, 30 Nov 2016 19:33:42 +0000 (14:33 -0500)]
Fix error: ‘access’ may be used uninitialized in this function
 [-Werror=maybe-uninitialized]
in GrGLGpu::bindImageStorage.

Found because this broke the compiles for the debugger, imageinfo, and fiddle,
but apparently not any bots?

BUG=skia:

Change-Id: Id8f964bca4f6493428b35c1b64df468b9d1419db
Reviewed-on: https://skia-review.googlesource.com/5380
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>

7 years agoremove more old cmake files
Hal Canary [Wed, 30 Nov 2016 20:35:33 +0000 (15:35 -0500)]
remove more old cmake files

NOTRY=true

Change-Id: I53326b62467aeb6346325597f0223e247fefed8c
Reviewed-on: https://skia-review.googlesource.com/5391
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoMake GrGpuCommandBuffer infer its render target from first draw
Brian Salomon [Wed, 30 Nov 2016 18:38:32 +0000 (13:38 -0500)]
Make GrGpuCommandBuffer infer its render target from first draw

This is a temporary workaround to allow removal of GrBatch::renderTarget().

Change-Id: Ic14710a369802064cf6446e8191a98ea3595556d
Reviewed-on: https://skia-review.googlesource.com/5342
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoBring back SkRasterPipeline::run() for one-off uses.
Mike Klein [Wed, 30 Nov 2016 18:45:06 +0000 (13:45 -0500)]
Bring back SkRasterPipeline::run() for one-off uses.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I308b6d75f2987a667eead9a55760a2ff6aec2984
Reviewed-on: https://skia-review.googlesource.com/5353
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRevert "remove (empty) SkXfermode.h"
Brian Osman [Wed, 30 Nov 2016 19:36:41 +0000 (19:36 +0000)]
Revert "remove (empty) SkXfermode.h"

This reverts commit c5619cd1702759990f278ed87c3654a292f044d1.

Reason for revert: Want to keep Google3 green & be able to detect other changes breaking it.

Change-Id: I3a651d0996838ed12bc0cfc6ed464a2cee37fba4
Reviewed-on: https://skia-review.googlesource.com/5381
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoDisable mipmap pre-generation path
Eric Karl [Wed, 30 Nov 2016 19:09:29 +0000 (11:09 -0800)]
Disable mipmap pre-generation path

There is a bug in the mipmap pre-generation logic in use in
getDeferredTextureImageData. This can cause runaway memory leaks, so we
are disabling this path until we can investigate further.

BUG=669775

Change-Id: I2027f6f7994e089edd4f3452284e894752b31779
Reviewed-on: https://skia-review.googlesource.com/5357
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years ago[nobuildbot] Rename Win bots back to Win8/Win10
Eric Boren [Wed, 30 Nov 2016 17:49:00 +0000 (12:49 -0500)]
[nobuildbot] Rename Win bots back to Win8/Win10

BUG=skia:

Change-Id: If66bdfc6cf15e11129048ee748430c3887132b75
Reviewed-on: https://skia-review.googlesource.com/5351
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agoShow constant-foldable runs in SkRasterPipeline::dump().
Mike Klein [Wed, 30 Nov 2016 17:18:15 +0000 (12:18 -0500)]
Show constant-foldable runs in SkRasterPipeline::dump().

Change-Id: I2f85249a09163dd21a8008f50340b8463718ada2
Reviewed-on: https://skia-review.googlesource.com/5350
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agorestore sRGB memset optimization
Mike Klein [Wed, 30 Nov 2016 14:55:08 +0000 (09:55 -0500)]
restore sRGB memset optimization

https://skia-review.googlesource.com/c/5275/ removed it, and perf noticed.

This is obviously not very pretty or scalable.  I plan to folow up with a more thorough and principled way to do this sort of constant-color + invariant-stage == constant-color optimization.

BUG=skia:6013

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I377386f67e66169cce6e0cb0831f3b7154496840
Reviewed-on: https://skia-review.googlesource.com/5338
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoremove (empty) SkXfermode.h
Mike Reed [Wed, 30 Nov 2016 14:55:19 +0000 (09:55 -0500)]
remove (empty) SkXfermode.h

BUG=skia:

Change-Id: Id45c378c8f6267c6cd9a187155e3934bb6d624bf
Reviewed-on: https://skia-review.googlesource.com/5339
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoClarify documentation for CQ_INCLUDE_TRYBOTS.
Ben Wagner [Tue, 29 Nov 2016 22:30:46 +0000 (17:30 -0500)]
Clarify documentation for CQ_INCLUDE_TRYBOTS.

BUG=skia:

DOCS_PREVIEW= https://skia.org/?cl=5330
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win-MSVC-ShuttleC-GPU-GTX960-x86_64-Debug-ANGLE

Change-Id: I2e9fa401c470951a8676c2357bb409d136b971ad
Reviewed-on: https://skia-review.googlesource.com/5330
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years ago[nobuildbot] Remaining Win bots
Eric Boren [Wed, 30 Nov 2016 13:46:14 +0000 (08:46 -0500)]
[nobuildbot] Remaining Win bots

Also renamed Win8 and Win10 to Win

BUG=skia:

Change-Id: If6439ba8108d9fec288223a5561230a1559dad44
Reviewed-on: https://skia-review.googlesource.com/5237
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoAdd support for resources on android Viewer
Greg Daniel [Tue, 29 Nov 2016 21:35:19 +0000 (16:35 -0500)]
Add support for resources on android Viewer

BUG=skia:

Change-Id: I1acc3e4fe6d0ce8bf29c52dd7280dff029a3abc2
Reviewed-on: https://skia-review.googlesource.com/5322
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoRemove cmake/
Mike Klein [Wed, 30 Nov 2016 12:43:19 +0000 (07:43 -0500)]
Remove cmake/

We've stopped testing and updating the experimental CMakeLists.txt file.

A guide to building Skia with GN is available at skia.org/user/build.

Change-Id: I3d3f8f2254f072b0520bd7a9b810c4e13b871680
Reviewed-on: https://skia-review.googlesource.com/5334
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>

7 years agoAdd additional guard to the Analytic AA change
Yuqian Li [Tue, 29 Nov 2016 22:28:39 +0000 (17:28 -0500)]
Add additional guard to the Analytic AA change

This shall fix the DEPS roll.

BUG=skia:

Change-Id: I3ac208a8025c3408729b9e24e9c01e9f007a1799
Reviewed-on: https://skia-review.googlesource.com/5329
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoMake pipeline getter a GrDrawBatch::pipeline() a protected method.
Brian Salomon [Tue, 29 Nov 2016 22:09:20 +0000 (17:09 -0500)]
Make pipeline getter a GrDrawBatch::pipeline() a protected method.

This is a baby step towards making getting GrPipeline off GrDrawBatch.

Change-Id: I7e0331f3bcd45d1920a150fefb91e307efeeced1
Reviewed-on: https://skia-review.googlesource.com/5327
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoFixes for SkColorLookUpTable::interp3D
Matt Sarett [Tue, 29 Nov 2016 15:14:03 +0000 (10:14 -0500)]
Fixes for SkColorLookUpTable::interp3D

(1) Fix subtle comparison bug so we interpolate the proper tetrahedral.
(2) Add new comments - the clamp is necessary.
(3) SkCSXformPrintf requires an extra friend class to compile.

BUG:668784

Change-Id: Id1a5c561f23ccfe25e141b8490cddee4c2482326
Reviewed-on: https://skia-review.googlesource.com/5238
Reviewed-by: Robert Aftias <raftias@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agosupport a8
Mike Klein [Tue, 29 Nov 2016 20:33:39 +0000 (15:33 -0500)]
support a8

Most of this is plumbing through the full paint to shaders instead of just the filter quality.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I6afde07566afa3a4391c24dca7017a9a4f5ec700
Reviewed-on: https://skia-review.googlesource.com/5317
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoFuzzer assert in GradientShaderBase4fContext::TSampler
Florin Malita [Mon, 21 Nov 2016 00:10:59 +0000 (19:10 -0500)]
Fuzzer assert in GradientShaderBase4fContext::TSampler

Similar to https://codereview.chromium.org/2472763002, we also need to
clamp the tiled value in kRepeat mode, to avoid snapping to 1.0f.

R=reed@google.com,herb@google.com
BUG=skia:5975

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

Change-Id: I8fdac36c0d112d5eb76e47c3e4156a79a4d13b36
Reviewed-on: https://skia-review.googlesource.com/5079
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agoRemove caps image storage caps hack.
Brian Salomon [Tue, 29 Nov 2016 20:29:41 +0000 (15:29 -0500)]
Remove caps image storage caps hack.

This was necessary because the number of fragment image storages couldn't be queried in shading language neutral code. We are no longer shading language neutral and this can be queried.

Change-Id: I065a38688919e7cdb1482877a232cb004c8f1511
Reviewed-on: https://skia-review.googlesource.com/5315
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRename SkSL::GLSLCapsFactory to SkSL::ShaderCapsFactory
Brian Salomon [Tue, 29 Nov 2016 20:27:52 +0000 (15:27 -0500)]
Rename SkSL::GLSLCapsFactory to SkSL::ShaderCapsFactory

Change-Id: Ibc478f1a24d9d96e4d67a907c756389d184857de
Reviewed-on: https://skia-review.googlesource.com/5316
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoMake SkNWayCanvas use conservative clipping.
Mike Klein [Tue, 29 Nov 2016 18:46:06 +0000 (13:46 -0500)]
Make SkNWayCanvas use conservative clipping.

Like most other canvas subclasses, its clips don't need to be perfect.

BUG=chromium:668925

Change-Id: I107f8ed6fa60654426fd52c066b1018d5801850d
Reviewed-on: https://skia-review.googlesource.com/5308
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoIn GetResourceAsBitmap, don't crash if the resource is missing
Brian Osman [Tue, 29 Nov 2016 20:10:13 +0000 (15:10 -0500)]
In GetResourceAsBitmap, don't crash if the resource is missing

NewFromEncoded returns nullptr if the resourceData is null or empty.

BUG=skia:

Change-Id: I8812b92b8664ebf5e5cf5cdd8b3bfb29963ed454
Reviewed-on: https://skia-review.googlesource.com/5314
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoAdd the missing shift to the dy
Yuqian Li [Tue, 29 Nov 2016 20:02:49 +0000 (15:02 -0500)]
Add the missing shift to the dy

This is identical to https://skia-review.googlesource.com/c/5266/ except for
the SK_ANALYTIC_AA_GUARD flag.

BUG=chromium:668907

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

Change-Id: I3fc225a925d21fe615c46a4a0be7fe33c5790766
Reviewed-on: https://skia-review.googlesource.com/5302
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
7 years agoRename vars and functions from 'glslcaps'->'shadercaps'
Brian Salomon [Tue, 29 Nov 2016 18:43:46 +0000 (13:43 -0500)]
Rename vars and functions from 'glslcaps'->'shadercaps'

Change-Id: I34d226d866dd4ba8e5f33f95cb8cbf01292f9314
Reviewed-on: https://skia-review.googlesource.com/5312
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoteach MSAN about maskload
Mike Klein [Tue, 29 Nov 2016 18:58:49 +0000 (13:58 -0500)]
teach MSAN about maskload

There is a very telling FIXME in the MSAN source code:
    // FIXME: detect and handle SSE maskstore/maskload

For now, just tell MSAN (correctly) that it's initialized.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I6aec67b99e4d930cb72e438458b33ed116535009
Reviewed-on: https://skia-review.googlesource.com/5311
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMerge GrGLSLCaps into GrShaderCaps
Brian Salomon [Tue, 29 Nov 2016 18:43:05 +0000 (13:43 -0500)]
Merge GrGLSLCaps into GrShaderCaps

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

Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8
Reviewed-on: https://skia-review.googlesource.com/5121
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoDelete unnecessary SkSurface_Base API
Matt Sarett [Mon, 28 Nov 2016 23:28:07 +0000 (18:28 -0500)]
Delete unnecessary SkSurface_Base API

BUG=skia:

Change-Id: I1263d390ffc1660a561b03c9dd866390754e59af
Reviewed-on: https://skia-review.googlesource.com/5231
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRemove duplicate storage of fCanvas in SkOverdrawCanvas
Matt Sarett [Mon, 28 Nov 2016 23:41:01 +0000 (18:41 -0500)]
Remove duplicate storage of fCanvas in SkOverdrawCanvas

BUG=skia:

Change-Id: I06827e286b13823fdd89090a75fc63467c9a74e9
Reviewed-on: https://skia-review.googlesource.com/5294
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agogather_i8
Mike Klein [Tue, 29 Nov 2016 17:57:22 +0000 (12:57 -0500)]
gather_i8

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ia7a133f515e29e16700aabc0633c77a703425f41
Reviewed-on: https://skia-review.googlesource.com/5239
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFix fuzzRange
Kevin Lubick [Tue, 29 Nov 2016 16:25:52 +0000 (11:25 -0500)]
Fix fuzzRange

Make the fuzzRange not crash if min == max, just set n to be min.

BUG=skia:

Change-Id: I138cefbec9b408d3b35e4258d770e6b396af0e5f
Reviewed-on: https://skia-review.googlesource.com/5305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoRm assert that image texture array is null unless GrCaps has images support.
Brian Salomon [Tue, 29 Nov 2016 18:18:20 +0000 (13:18 -0500)]
Rm assert that image texture array is null unless GrCaps has images support.

Change-Id: I4da01a533d2db3fab5b2fe1128eb8a7c8e09cc01
Reviewed-on: https://skia-review.googlesource.com/5309
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoUse AdditiveBlitter for partial rows
Yuqian Li [Tue, 29 Nov 2016 15:29:22 +0000 (10:29 -0500)]
Use AdditiveBlitter for partial rows

Previously, we forgot to use AdditiveBlitter in two places where partial
rows are blitterred. That causes SkAAClip to complain as in skia:6003.

BUG=skia:6003

Change-Id: I4f4a896072448bdb3f287a2eb61cb64b1256ea78
Reviewed-on: https://skia-review.googlesource.com/5273
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoAdd #define for Nsight compatibility
Jim Van Verth [Mon, 28 Nov 2016 20:23:57 +0000 (15:23 -0500)]
Add #define for Nsight compatibility

NVIDIA's Nsight tool is not compatible with certain GL calls. This
change places them behind a #define in GrGLGpu.cpp.

BUG=skia:

Change-Id: Id80ed291b6fe4fd777c5690b25d4fbb47de3c187
Reviewed-on: https://skia-review.googlesource.com/5281
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoRevert "Use /MD for Windows builds."
Joe Gregorio [Tue, 29 Nov 2016 18:20:44 +0000 (18:20 +0000)]
Revert "Use /MD for Windows builds."

This reverts commit cab79aadad30e48fc7b4ba9868d6badf3798beba.

Reason for revert: Bots crashing.

Original change's description:
> Use /MD for Windows builds.
>
> I think the default is /MT, static linking.
> This should make our builds smaller, and compatible with clients using /MD.
>
> Change-Id: Id8a39a029925eda2627532bbd0223c693300f5da
> Reviewed-on: https://skia-review.googlesource.com/5277
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,bungeman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iff644250a23175e44a4282e7aaea0e2a2adc1ce0
Reviewed-on: https://skia-review.googlesource.com/5310
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
7 years agoCompute slope using fSnappedY
Yuqian Li [Tue, 29 Nov 2016 15:27:16 +0000 (10:27 -0500)]
Compute slope using fSnappedY

If we use the oldy and dy directly as we did previously, the slope could
be very different from (newSnappedX - fSnappedX) / (newSnappedY -
fSnappedY) in the updateLine when the edge made a lot of updates with
small dy but large dx. That will cause bug skia:5995

BUG=skia:5995

Change-Id: If521976ed87195dfea5961afd58bedb98447c568
Reviewed-on: https://skia-review.googlesource.com/5269
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoFix DrawFunctions fuzzer to initialize bitmaps
Kevin Lubick [Tue, 29 Nov 2016 16:14:39 +0000 (11:14 -0500)]
Fix DrawFunctions fuzzer to initialize bitmaps

Patch by twsmith@mozilla.com

BUG=skia:5997

Change-Id: I3d4edd9fa5c8f5f2a5184d42b1c4944a1353556f
Reviewed-on: https://skia-review.googlesource.com/5304
Reviewed-by: twsmith@mozilla.com <twsmith@mozilla.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoFix documents for creating a GPU surface.
Brian Salomon [Mon, 28 Nov 2016 21:34:06 +0000 (16:34 -0500)]
Fix documents for creating a GPU surface.

NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=5284

Change-Id: I9ca559576d9e7fdff612cfe79628303bc7677bd7
Reviewed-on: https://skia-review.googlesource.com/5284
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoMake gather() look and work more like load().
Mike Klein [Tue, 29 Nov 2016 13:14:49 +0000 (08:14 -0500)]
Make gather() look and work more like load().

They're really similar, so let's make them look that way.
Finally use mask load, mask store, and gather instructions for 8888.

We avoid mask load and store when tail == 0.  It's faster (one memory load instead of two) and a cheap test.
For gather, the intrinsics make it look like we could do the same, but it really all boils down to the same masked instruction in the end.

There's probably a better way to implement mask() with math instead of memory loads, but this works for now.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I578f47d4562ea19d983057bf2f4c3e21d0ab9a0e
Reviewed-on: https://skia-review.googlesource.com/5234
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoUse /MD for Windows builds.
Mike Klein [Mon, 28 Nov 2016 18:09:40 +0000 (13:09 -0500)]
Use /MD for Windows builds.

I think the default is /MT, static linking.
This should make our builds smaller, and compatible with clients using /MD.

Change-Id: Id8a39a029925eda2627532bbd0223c693300f5da
Reviewed-on: https://skia-review.googlesource.com/5277
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agodocument x_tail encoding
Mike Klein [Tue, 29 Nov 2016 17:46:58 +0000 (12:46 -0500)]
document x_tail encoding

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Id9a6d00e68a7cf7464c6a561bd97e63abf6886c4
Reviewed-on: https://skia-review.googlesource.com/5307
Reviewed-by: Herb Derby <herb@google.com>
7 years agoReland image storage with fixes.
Brian Salomon [Tue, 29 Nov 2016 16:59:17 +0000 (11:59 -0500)]
Reland image storage with fixes.

Revert "Revert "Initial OpenGL Image support.""

This reverts commit 59dc41175d99d0a31c046aec0c26c4d82a3a3574.

BUG=skia:

Change-Id: Ibe3c87ce7f746f065fdbcc5a518388cc291112f5
Reviewed-on: https://skia-review.googlesource.com/5131
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoFix float/int bug in SkRawCodec
Matt Sarett [Mon, 28 Nov 2016 23:46:37 +0000 (18:46 -0500)]
Fix float/int bug in SkRawCodec

This will hopefully not change any behavior

BUG=android:32591644

Change-Id: Ia256d39c57a97db085d1d1c4cf003948eddf0771
Reviewed-on: https://skia-review.googlesource.com/5295
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoMake GrMemoryPool play nice with bucketing allocators.
dskiba [Tue, 29 Nov 2016 14:50:35 +0000 (06:50 -0800)]
Make GrMemoryPool play nice with bucketing allocators.

Some memory allocators have very coarse size buckets, so for example on
Android (jemalloc) an attempt to allocate 32 KiB + 1 byte will end up
allocating 40 KiB, wasting 8 KiB.

GrMemoryPool ctor takes two arguments that specify prealloc / block sizes,
and then inflates them to accommodate some bookkeeping structures. Since
most places create GrMemoryPools with pow2 numbers (which have buckets in
most allocators) the inflation causes allocator to select next size bucket,
wasting memory.

This CL makes GrMemoryPool to stop inflating sizes it was created with, and
allocate specified amounts exactly. Part of allocated memory is then used for
bookkeeping structures. Additionally, GrObjectMemoryPool template is provided,
which takes prealloc / block object counts (instead of sizes) and guarantees
that specified number of objects will fit in prealloc / block spaces.

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

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

7 years agouse fma() in accumulate
Mike Klein [Tue, 29 Nov 2016 04:17:19 +0000 (23:17 -0500)]
use fma() in accumulate

Was just reading the disassembly and noticed the opportunity.

Change-Id: I25d4b70802f9a9563491f3126da69829611a9b28
Reviewed-on: https://skia-review.googlesource.com/5235
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agodon't support converting from alpha to non-alpha
Mike Reed [Mon, 28 Nov 2016 22:17:38 +0000 (17:17 -0500)]
don't support converting from alpha to non-alpha

BUG=skia:

Change-Id: Ia06bef6c0bfc03b5ca9f569c07e993da0bbd67c3
Reviewed-on: https://skia-review.googlesource.com/5288
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoSkNx_abi is unused.
Mike Klein [Tue, 29 Nov 2016 01:00:06 +0000 (20:00 -0500)]
SkNx_abi is unused.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I082c34a1f484715cd2dca55a8d23101235755e6a
Reviewed-on: https://skia-review.googlesource.com/5233
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years ago[nobuildbot] Win GCE bots
Eric Boren [Mon, 28 Nov 2016 15:12:09 +0000 (10:12 -0500)]
[nobuildbot] Win GCE bots

BUG=skia:

Change-Id: Id0d0319f68a1c6d970c13bb5b6006786ae04ffec
Reviewed-on: https://skia-review.googlesource.com/5265
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoMoved A2B0 profile parsing before XYZ
raftias [Mon, 28 Nov 2016 23:43:43 +0000 (18:43 -0500)]
Moved A2B0 profile parsing before XYZ

This allows us to correctly display images with both a A2B0 tag
and *XYZ/*TRC tags, instead of ignoring the A2B0 information.

BUG=skia:

Change-Id: Icd63db5a55692ef4c5b3f098d963e7e3f583f9a4
Reviewed-on: https://skia-review.googlesource.com/5230
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoConsistent naming.
Mike Klein [Mon, 28 Nov 2016 23:23:23 +0000 (18:23 -0500)]
Consistent naming.

For stages that have {r,g,b,a} and {dr,dg,db,da} versions, name the {r,g,b,a} one "foo" and the {dr,dg,db,da} on "foo_d".  The {r,g,b,a} registers are the ones most commonly used and fastest, so they get short ordinary names, and the d-registers are less commonly used and sometimes slower, so they get a suffix.

Some stages naturally opearate on all 8 registers (the xfermodes, accumulate).  These names for those look fine and aren't ambiguous.

Also, a bit more re-arrangement in _opts.h.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ia20029247642798a60a2566e8a26b84ed101dbd0
Reviewed-on: https://skia-review.googlesource.com/5291
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agouse raster-pipeline in readPixels
Mike Reed [Mon, 28 Nov 2016 22:26:27 +0000 (17:26 -0500)]
use raster-pipeline in readPixels

1. tons of 565 diffs in gm, so skipping that for now
2. 32bit premul/unpremul conversions are slower than existing code, so for now use the pipeline after the existing special-cases.
BUG=skia:

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

Change-Id: I6ca43b6dd24434814f8f10cdaaabbaf396914d1a
Reviewed-on: https://skia-review.googlesource.com/5152
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoadded support for layout(offset=...) to skslc
Ethan Nicholas [Mon, 28 Nov 2016 21:30:17 +0000 (16:30 -0500)]
added support for layout(offset=...) to skslc

BUG=skia:

Change-Id: Idc1118503f9703496a0c852f0d8840b26e08b9fb
Reviewed-on: https://skia-review.googlesource.com/5283
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoMerge changes from internal cl/140385880.
Ben Wagner [Mon, 28 Nov 2016 20:30:37 +0000 (15:30 -0500)]
Merge changes from internal cl/140385880.

BUG=skia:

Change-Id: I1c4994a83a1669032b8dc2620fd5c3258f82a222
Reviewed-on: https://skia-review.googlesource.com/5282
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agosimplify
Mike Klein [Mon, 28 Nov 2016 21:30:30 +0000 (16:30 -0500)]
simplify

This file is getting complicated.  We're still in early days and I want to keep it nimble and easy to refactor.

Simplifications:
   - go back to one stage function type, packing x and tail together in one size_t
     (x_tail = x*N+tail; x = x_tail/N, tail = x_tail%N, all cheap for power of 2 N);
   - all stages call next(), ending in just_return;
   - stop coddling MSVC with kIsTail.

These simplifications should all make things a little slower, some only when using subpar compilers.
On a positive note, this should cut code size by about half.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I7de87c5a3cb0cbbf1e0ed0588f1ccb860a498e66
Reviewed-on: https://skia-review.googlesource.com/5285
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRevert "Add the missing shift to the dy"
Yuqian Li [Mon, 28 Nov 2016 21:38:18 +0000 (21:38 +0000)]
Revert "Add the missing shift to the dy"

This reverts commit dd13c020793b0a7fb2ac1f22024e9fb91ea483ef.

Reason for revert: this breaks the Chromium DEPS roll as we break the layout_tests. I'll add a flag to guard the change in the future and enable the flag while change the layout_tests.

Original change's description:
> Add the missing shift to the dy
>
> BUG=chromium:668907
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5266
>
> Change-Id: I6d3e56ffc149fbeac6f7a2df740542abbf84dac8
> Reviewed-on: https://skia-review.googlesource.com/5266
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>
>

TBR=mtklein@chromium.org,caryclark@google.com,liyuqian@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ifd5aa50f155c3ebe2f1495cbf3b8dd706211a639
Reviewed-on: https://skia-review.googlesource.com/5286
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
7 years agoConvert blitter over to new style from_srgb, to_srgb.
Mike Klein [Mon, 28 Nov 2016 18:24:27 +0000 (13:24 -0500)]
Convert blitter over to new style from_srgb, to_srgb.

Every sRGB GM changes, none noticeably.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I632845aea0f40751639cccbcfde8fa270cae0301
Reviewed-on: https://skia-review.googlesource.com/5275
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agouse __BYTE_ORDER__ macro to detect endianness when available
Lee Salzman [Mon, 28 Nov 2016 19:57:14 +0000 (14:57 -0500)]
use __BYTE_ORDER__ macro to detect endianness when available

BUG=skia:

Change-Id: Iff27097c248a643319e930a6212c5a7155bd0064
Reviewed-on: https://skia-review.googlesource.com/5280
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoNarrow the SkImageGenerator interface
Brian Osman [Mon, 28 Nov 2016 16:54:42 +0000 (11:54 -0500)]
Narrow the SkImageGenerator interface

Remove some unused variants of bitmap generation and a helper that
serves no purpose.

BUG=skia:
TBR=reed@google.com

Change-Id: I16022e7f0242c4511eebdc06d890f6bfdf81d1f9
Reviewed-on: https://skia-review.googlesource.com/5229
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoRemove old driver bug workaround for glTexStorage.
Brian Salomon [Mon, 28 Nov 2016 18:14:00 +0000 (13:14 -0500)]
Remove old driver bug workaround for glTexStorage.

Apparently we had issues with this on Qualcomm over 3 years ago.

Today it works fine on a Nexus 6P. If we still need this on some devices we should add back a narrower filter.

Change-Id: I0ccbb4918e4df7a8045b9033b9f121aca3c8d8ef
Reviewed-on: https://skia-review.googlesource.com/5278
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoRoll recipe DEPS
Eric Boren [Mon, 28 Nov 2016 13:55:29 +0000 (08:55 -0500)]
Roll recipe DEPS

BUG=skia:

Change-Id: I048f54052ca66cb5d73fe9adafe33a690f9dc0d1
Reviewed-on: https://skia-review.googlesource.com/5263
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agounified ASTLayout/Layout and ASTModifiers/Modifiers
Ethan Nicholas [Mon, 28 Nov 2016 16:23:23 +0000 (11:23 -0500)]
unified ASTLayout/Layout and ASTModifiers/Modifiers

BUG=skia:

Change-Id: Ib4c2c94401e586e93e926776e13c0f7c12212f7e
Reviewed-on: https://skia-review.googlesource.com/5268
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoremoved textureProj() and legacy texture functions from sksl
Ethan Nicholas [Mon, 28 Nov 2016 17:03:26 +0000 (12:03 -0500)]
removed textureProj() and legacy texture functions from sksl

BUG=skia:

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

Change-Id: I21b111d54becaca845134376e54a5a7c0a6cd6c8
Reviewed-on: https://skia-review.googlesource.com/5120
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agosimplify SkConfig8888 logic: just fall-through if memcpy case isn't supported
Mike Reed [Mon, 28 Nov 2016 16:57:48 +0000 (11:57 -0500)]
simplify SkConfig8888 logic: just fall-through if memcpy case isn't supported

Will make future changes clearer: e.g. https://skia-review.googlesource.com/c/5152/

BUG=skia:

Change-Id: I7cc4dfd18bc3890153a5ca3f11f1b665658c48f7
Reviewed-on: https://skia-review.googlesource.com/5272
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoSplit srgb out of accum stages.
Mike Klein [Mon, 28 Nov 2016 16:55:58 +0000 (11:55 -0500)]
Split srgb out of accum stages.

By stashing the scales in the context (i.e. on the stack), we can free up enough registers to really simplify how the bitmap sample stages interact.

Nearest neighbor is straightforward now: just call the appropriate gather_ function, and you're done.  The source pixels end up in the source registers.  If they're sRGB encoded, follow up with from_srgb_s

To bilerp, we bracket those 1 or 2 gather+from_srgb_s stages with a stage setting up each corner (x += dx, y += dy, save off scale) and a stage that accumulates into the d-registers (load saved scale, dr += scale * r, etc.).  When all the samples are accumulated, copy the d-registers into the s-registers.

from_srgb_d and to_srgb are lightly sketched here and will be used in the next CL, where I apply this same factoring to non-bitmap loads and stores.  This is a little tricky, because we don't actually have a float->float to_srgb yet.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I272a1f278f0ea1b29a2f07ac225f753faa8dae81
Reviewed-on: https://skia-review.googlesource.com/5271
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFuzzer fix for overflow in some Lut8 profiles.
raftias [Mon, 28 Nov 2016 16:30:18 +0000 (11:30 -0500)]
Fuzzer fix for overflow in some Lut8 profiles.

Bug(?) in the tetrahedral interpolation causes output values to go out
of range a bit (1.035/1.0) in the upper range. We will just clamp for
now as a temporary fix.

BUG=668784

Change-Id: I78dd90da7174133e647b1c6c6e914dbde5de123c
Reviewed-on: https://skia-review.googlesource.com/5228
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>

7 years agoFix unpremul stage.
Mike Klein [Mon, 28 Nov 2016 14:48:31 +0000 (09:48 -0500)]
Fix unpremul stage.

The existing invert() logic explodes when a == 0.

Less terribly, invert() also does not turn 1.0f into 1.0f, so we now use a float divide.  This will cause a small diff in the matrix color filter GM due to increased unpremul precision.

There's an alternative to try if this stage turns out to be speed critical:
   auto scale = (a == 0.0f).thenElse(0.0f,
                                     a.invert() * (1.0f / SkNf(1.0f).invert()));

The (1.0f / SkNf(1.0f).invert()) bit there is a constant, scaling a bit to make 1.0f produce 1.0f.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I9db72eda108d3d28583a4357f90a0dcd7e4d8a6f
Reviewed-on: https://skia-review.googlesource.com/5227
Reviewed-by: Mike Reed <reed@google.com>