platform/upstream/libSkiaSharp.git
7 years agoadd tests/bench for dynamicwstream
Mike Reed [Wed, 14 Dec 2016 17:34:06 +0000 (12:34 -0500)]
add tests/bench for dynamicwstream

BUG=skia:

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

7 years agoSkPngCodec: Add support for 16-bit pngs (step 1)
Matt Sarett [Wed, 14 Dec 2016 16:48:31 +0000 (11:48 -0500)]
SkPngCodec: Add support for 16-bit pngs (step 1)

Android plans to use 16-bit png to encode higher precision assets.

This CL should not change any behavior or cause diffs on Gold.
It simply moves the 16-bit -> 8-bit strip from libpng to SkSwizzler.

As a follow-up, I plan to add support for 16-bit input to
SkColorSpaceXform.  This will require a new swizzler function that
just samples or subsets 16-bit values (but does not strip to 8-bit).

An alternative implementation could avoid the additional swizzler
functions by deciding whether or not to call png_set_strip() at
decode time (we would still need the swizzler fn to sample/subset
16-bit values).  I find this strategy to be cleaner than that.
I would rather handle 16-bit rgb(a) all the time than *some* of
the time.  And this is implementation is also more efficient
than libpng.  Though it is also more skia code.

Gray and gray alpha are left alone until I know whether anyone
wants high precision gray support.

b/32984164

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

7 years agomore simplify bugs
Cary Clark [Wed, 14 Dec 2016 16:56:16 +0000 (11:56 -0500)]
more simplify bugs

SkOpAngle::alignmentSameSide()
Shifting an edge to align it for angle sorting may move a compared edge to the opposite side.
For lines that are shifted, check to see if this is so.

class SkOpContourBuilder
If the path contains a pair of lines that cancel, skip them as early as possible.
While not strictly necessary, this optimization is cheap and makes debugging much easier.

SkOpEdgeBuilder::walk()
  case SkPath::kCubic_Verb:
If max curvature or inflections break a cubic into pieces, make sure that the pieces are
large enough to process. If not, add the broken piece back to a neighbor.

Correct debugging that had gone stale.
Add active span debugging cache so only changes are shown.

TBR=reed@google.com
BUG=skia:6401

Change-Id: I766f77e4fb9b76537cf5464961addb103114f5db
Reviewed-on: https://skia-review.googlesource.com/5764
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoMove, rename, and document Visual Studio GN helper script
Brian Osman [Wed, 14 Dec 2016 16:06:04 +0000 (11:06 -0500)]
Move, rename, and document Visual Studio GN helper script

BUG=skia:

DOCS_PREVIEW= https://skia.org/?cl=5983

Change-Id: I32ac2c5275eb86adaa2be9ceee061b2956db70ad
Reviewed-on: https://skia-review.googlesource.com/5983
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
7 years agoPrefer F16 in SkAndroidCodec for high precision images
Matt Sarett [Wed, 14 Dec 2016 15:23:41 +0000 (10:23 -0500)]
Prefer F16 in SkAndroidCodec for high precision images

Adapted from:
https://googleplex-android-review.git.corp.google.com/#/c/1707531/

TBR=djsollen@google.com
BUG=skia:

Change-Id: I21b99e8452e728aed70e8913677c253c1ae9f751
Reviewed-on: https://skia-review.googlesource.com/6023
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoMark the leaf classes of GrOp final.
Herb Derby [Tue, 13 Dec 2016 20:18:55 +0000 (15:18 -0500)]
Mark the leaf classes of GrOp final.

Change-Id: Ie8acbca972ce8628fc0a2a216a62c34c2a91059a
Reviewed-on: https://skia-review.googlesource.com/5927
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoChange ConstructorInitializerWidth in .clang-format from 4 to 8
Brian Salomon [Wed, 14 Dec 2016 14:17:55 +0000 (09:17 -0500)]
Change ConstructorInitializerWidth in .clang-format from 4 to 8

We aren't consistent about this but having it at 4 seems to be causing style churn in code I've been editting recently. Also I prefer something other than 4 so that initalizers don't align with the constructor body.

BUG=skia:

Change-Id: I6ae850c34324e792dfd717f449634abcc7be010b
Reviewed-on: https://skia-review.googlesource.com/6030
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoReplace TextureType with SkBackingFit
Robert Phillips [Wed, 14 Dec 2016 14:12:13 +0000 (09:12 -0500)]
Replace TextureType with SkBackingFit

I believe TextureType is vestigial

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

7 years agoMake filterMaskGPU use GrTextureProxy
Robert Phillips [Wed, 14 Dec 2016 14:00:07 +0000 (09:00 -0500)]
Make filterMaskGPU use GrTextureProxy

This is a staging CL to position the writePixels in sw_draw_with_mask_filter to be moved to GrSurfaceContext

Change-Id: I808372d30ad4aca4a56125ea75d071f7a3747146
Reviewed-on: https://skia-review.googlesource.com/5926
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoAdd asDeferredTexture & asDeferredRenderTarget helpers to GrSurfaceContext
Robert Phillips [Wed, 14 Dec 2016 13:46:47 +0000 (08:46 -0500)]
Add asDeferredTexture & asDeferredRenderTarget helpers to GrSurfaceContext

These are proving useful in the read/write-Pixels migration

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

7 years agoRevert "Revert "SkNx basically always is fast now.""
Mike Klein [Wed, 14 Dec 2016 13:39:34 +0000 (13:39 +0000)]
Revert "Revert "SkNx basically always is fast now.""

This reverts commit 8ba64d1996ba6c9ecfb12132cdab7d5d99af7456.

Reason for revert: does not appear to have been blocking the roll.

Original change's description:
> Revert "SkNx basically always is fast now."
>
> This reverts commit 21f783829619186442041de6008f7f58f4f6250d.
>
> Reason for revert: roll?
>
> Original change's description:
> > SkNx basically always is fast now.
> >
> > We had this SKNX_IS_FAST hanging around from before Chrome always built with NEON.
> >
> > CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> >
> > Change-Id: Ia5cc0323b3ef052192e2903f961aee11eb3f82d8
> > Reviewed-on: https://skia-review.googlesource.com/5946
> > Commit-Queue: Mike Klein <mtklein@chromium.org>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> >
>
> TBR=mtklein@chromium.org,fmalita@chromium.org,reed@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I0e57285c68eae0a64213fe29ea4cca5519777954
> Reviewed-on: https://skia-review.googlesource.com/6040
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

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

Change-Id: I230dd4c2abb2d14ffc302be5376b9eaacbbeafcc
Reviewed-on: https://skia-review.googlesource.com/6026
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRevert "Revert "clamp to premul when reading premul sRGB""
Mike Klein [Wed, 14 Dec 2016 13:38:24 +0000 (13:38 +0000)]
Revert "Revert "clamp to premul when reading premul sRGB""

This reverts commit 2e018f548d76b0688f9873c683cffc681fec40ec.

Reason for revert: doesn't appear to have been the roll problem.

Original change's description:
> Revert "clamp to premul when reading premul sRGB"
>
> This reverts commit 04e10da8362a0dcabd795a4ad53f617719ca0d20.
>
> Reason for revert: roll?
>
> Change-Id: Id0a8dcd62763bd6eddde120c513ca97e098a4268
> Reviewed-on: https://skia-review.googlesource.com/6022
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

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

Change-Id: I399ca5e728ce6766c6707682c4c6b685681ffdeb
Reviewed-on: https://skia-review.googlesource.com/6025
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemove mutex guards from GrContext::readSurfacePixels
Robert Phillips [Tue, 13 Dec 2016 17:42:19 +0000 (12:42 -0500)]
Remove mutex guards from GrContext::readSurfacePixels

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

7 years agoRevert "Add a deferred copy surface (take 2)"
Robert Phillips [Wed, 14 Dec 2016 12:04:46 +0000 (12:04 +0000)]
Revert "Add a deferred copy surface (take 2)"

This reverts commit 398487a850431cf495330d4023607df5305a311f.

Reason for revert: See if this is causing the roll failure

Original change's description:
> Add a deferred copy surface (take 2)
>
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
>
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
>
> This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
>
> Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
> Reviewed-on: https://skia-review.googlesource.com/5939
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1ef40f0d5fb0bca62031f94f10eb18acd753e913
Reviewed-on: https://skia-review.googlesource.com/6024
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoRevert "clamp to premul when reading premul sRGB"
Mike Klein [Wed, 14 Dec 2016 03:35:13 +0000 (03:35 +0000)]
Revert "clamp to premul when reading premul sRGB"

This reverts commit 04e10da8362a0dcabd795a4ad53f617719ca0d20.

Reason for revert: roll?

Change-Id: Id0a8dcd62763bd6eddde120c513ca97e098a4268
Reviewed-on: https://skia-review.googlesource.com/6022
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRevert "SkNx basically always is fast now."
Mike Klein [Wed, 14 Dec 2016 01:48:17 +0000 (01:48 +0000)]
Revert "SkNx basically always is fast now."

This reverts commit 21f783829619186442041de6008f7f58f4f6250d.

Reason for revert: roll?

Original change's description:
> SkNx basically always is fast now.
>
> We had this SKNX_IS_FAST hanging around from before Chrome always built with NEON.
>
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
>
> Change-Id: Ia5cc0323b3ef052192e2903f961aee11eb3f82d8
> Reviewed-on: https://skia-review.googlesource.com/5946
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
>

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

Change-Id: I0e57285c68eae0a64213fe29ea4cca5519777954
Reviewed-on: https://skia-review.googlesource.com/6040
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRevert "Do not build the ktx encoder for android framework"
Mike Klein [Wed, 14 Dec 2016 01:31:40 +0000 (01:31 +0000)]
Revert "Do not build the ktx encoder for android framework"

This reverts commit eeb7137a0b421522de4c21c90fc3208e33e3a5a5.

Reason for revert: well, duh, I guess we'd better update the GYP and Google3 builds...

Original change's description:
> Do not build the ktx encoder for android framework
>
> Move SkKTXImageEncoder.cpp into an optional block, and disable that
> block for the android framework. Use a new define to determine whether
> to define the entry point, rather than using
> SK_BUILD_FOR_ANDROID_FRAMEWORK.
>
> Change-Id: I41103459135af744cf5715f27783c63dc37a7ad1
> Reviewed-on: https://skia-review.googlesource.com/5982
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

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

Change-Id: I8da75db31884b5148f7f85a6a0c3e6913b71cfa8
Reviewed-on: https://skia-review.googlesource.com/6021
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix SDF generation for pixel-aligned paths (take two)
Jim Van Verth [Tue, 13 Dec 2016 23:17:47 +0000 (18:17 -0500)]
Fix SDF generation for pixel-aligned paths (take two)

BUG=668550

Change-Id: Ic771818bd5a4a46b83fdb82b69b98cb6b93a23a2
Reviewed-on: https://skia-review.googlesource.com/5697
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoDo not build the ktx encoder for android framework
Leon Scroggins III [Tue, 13 Dec 2016 21:32:32 +0000 (16:32 -0500)]
Do not build the ktx encoder for android framework

Move SkKTXImageEncoder.cpp into an optional block, and disable that
block for the android framework. Use a new define to determine whether
to define the entry point, rather than using
SK_BUILD_FOR_ANDROID_FRAMEWORK.

Change-Id: I41103459135af744cf5715f27783c63dc37a7ad1
Reviewed-on: https://skia-review.googlesource.com/5982
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoclamp to premul when reading premul sRGB
Mike Klein [Tue, 13 Dec 2016 20:44:23 +0000 (15:44 -0500)]
clamp to premul when reading premul sRGB

It's pretty easy to start with sound premultiplied linear floats, pack those to sRGB encoded bytes, then read them back to linear floats and find them not quite premultiplied, with a color channel just a smidge greater than the alpha channel.  This can happen basically any time we have different transfer functions for alpha and colors... sRGB being the only one we draw into.

This is an annoying problem with no known good solution.  So apply the clamp hammer.

These new calls on SkRasterPipeline should make it impossible to get wrong.

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

Change-Id: I4c974f4a7b151f3f684946f1e83d06b1b288fd01
Reviewed-on: https://skia-review.googlesource.com/5945
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoSkNx basically always is fast now.
Mike Klein [Tue, 13 Dec 2016 21:28:09 +0000 (16:28 -0500)]
SkNx basically always is fast now.

We had this SKNX_IS_FAST hanging around from before Chrome always built with NEON.

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

Change-Id: Ia5cc0323b3ef052192e2903f961aee11eb3f82d8
Reviewed-on: https://skia-review.googlesource.com/5946
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoAdd a deferred copy surface (take 2)
Robert Phillips [Tue, 13 Dec 2016 20:29:42 +0000 (15:29 -0500)]
Add a deferred copy surface (take 2)

This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

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

7 years agoMake GrRenderTargetContext::addDrawOp use sk_sp
Brian Salomon [Tue, 13 Dec 2016 20:10:11 +0000 (15:10 -0500)]
Make GrRenderTargetContext::addDrawOp use sk_sp

Change-Id: Iff7f63635cdbc5cc51e5968a565f2fde2be3acb0
Reviewed-on: https://skia-review.googlesource.com/5932
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRemove spurious include of SkRasterPipeline_opts.h
Brian Osman [Tue, 13 Dec 2016 18:32:15 +0000 (13:32 -0500)]
Remove spurious include of SkRasterPipeline_opts.h

BUG=skia:

Change-Id: Iaf016ef914d1e292fd175f71d91129b85e3caca7
Reviewed-on: https://skia-review.googlesource.com/5934
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoRemove Nexus9 bots
Eric Boren [Tue, 13 Dec 2016 17:32:28 +0000 (12:32 -0500)]
Remove Nexus9 bots

BUG=skia:

Change-Id: I65705a6142a96a476c2d9eae79aeaaa29ade2dde
Reviewed-on: https://skia-review.googlesource.com/5928
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agoFix double CMYK->RGBA conversion on swizzled jpeg decodes
Matt Sarett [Tue, 13 Dec 2016 18:29:54 +0000 (13:29 -0500)]
Fix double CMYK->RGBA conversion on swizzled jpeg decodes

BUG=skia:

Change-Id: I4e8c4128f974cc491fcef0bbc1137b5d62b6f967
Reviewed-on: https://skia-review.googlesource.com/5933
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoRevert "Add a deferred copy surface"
Robert Phillips [Tue, 13 Dec 2016 18:48:08 +0000 (18:48 +0000)]
Revert "Add a deferred copy surface"

This reverts commit 4431de6af930a8638c194b072558ea3a4b79d908.

Reason for revert: ANGLE errors (at the very least)

Original change's description:
> Add a deferred copy surface
>
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
>
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
>
> Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
> Reviewed-on: https://skia-review.googlesource.com/5773
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I61408d9e306b9b1ab32f93ab086e95184e12857f
Reviewed-on: https://skia-review.googlesource.com/5938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoUpdating NVIDIA Shields to "Shield Experience Upgrade 3.3"
Kevin Lubick [Tue, 13 Dec 2016 18:38:10 +0000 (13:38 -0500)]
Updating NVIDIA Shields to "Shield Experience Upgrade 3.3"

https://shield.nvidia.com/support/nvidia-android-tv/release-notes/1
Unfortunately, this does not update the build id, so we have to
link any gold or perf diffs to this whitespace change.

BUG=skia:

Change-Id: I4bb23e44d2cd3621b7c2161d19f214bb48c1e679
Reviewed-on: https://skia-review.googlesource.com/5935
Reviewed-by: Kevin Lubick <kjlubick@google.com>
7 years agoadd move semantics to SkTHash*
Mike Klein [Tue, 13 Dec 2016 17:46:05 +0000 (12:46 -0500)]
add move semantics to SkTHash*

The more I look at std::unordered_map and co., the less I like them.
I think we might want to bet on SkTHash*.

As a simple first improvement, add move support.
Next comes shrinking, and then I'll start moving over SkTDynamicHash users.

BUG=skia:6053

Change-Id: Ifdb5d713aab66434ca271c7f18a0cbbb0720099c
Reviewed-on: https://skia-review.googlesource.com/5943
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
7 years agoAdd helper for idenitfying hw GrAATypes.
Brian Salomon [Tue, 13 Dec 2016 15:22:54 +0000 (10:22 -0500)]
Add helper for idenitfying hw GrAATypes.

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

7 years agoAdd a deferred copy surface
Robert Phillips [Tue, 13 Dec 2016 14:01:40 +0000 (09:01 -0500)]
Add a deferred copy surface

This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
Reviewed-on: https://skia-review.googlesource.com/5773
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoFix bug of passing DrawType::kColor instead of kStencilAndColor
Brian Salomon [Sat, 10 Dec 2016 18:24:02 +0000 (13:24 -0500)]
Fix bug of passing DrawType::kColor instead of kStencilAndColor

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

7 years agoFix out of bounds memory write in SkGifCodec
Leon Scroggins III [Tue, 13 Dec 2016 15:57:43 +0000 (10:57 -0500)]
Fix out of bounds memory write in SkGifCodec

Follow on to 5860. When computing left and top, divide by the sample
size directly rather than using get_scaled_dimension, which promotes
0 to 1, potentially moving the area to clear outside the bounds of
the image.

BUG=skia:6046

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

7 years agoDelete SK_SUPPORT_LEGACY_GRADIENT_PREMUL-guarded code
Florin Malita [Wed, 7 Dec 2016 19:57:04 +0000 (14:57 -0500)]
Delete SK_SUPPORT_LEGACY_GRADIENT_PREMUL-guarded code

The flag has been removed from Chromium.

R=reed@google.com,
TBR=

Change-Id: Ibccada2068d29b019660be46f5f5797331719a57
Reviewed-on: https://skia-review.googlesource.com/5648
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agoFix doc typo
Jim Van Verth [Tue, 13 Dec 2016 15:40:29 +0000 (10:40 -0500)]
Fix doc typo

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

Change-Id: I3861a4f56cd325b1bff322613d93c7b697492e75
Reviewed-on: https://skia-review.googlesource.com/5942
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
7 years agoRemove antialias axis from GrPathRendererChain::DrawType
Brian Salomon [Sat, 10 Dec 2016 14:35:48 +0000 (09:35 -0500)]
Remove antialias axis from GrPathRendererChain::DrawType

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

7 years agoAvoid int64 overflow in SkClampRange
Florin Malita [Tue, 13 Dec 2016 14:42:20 +0000 (09:42 -0500)]
Avoid int64 overflow in SkClampRange

Update sk_64_smul_check to detect the numeric_limits<int64_t>::min()
case (which cannot be safely passed to SkTAbs), and fail.

BUG=skia:6019
R=reed@google.com,mtklein@google.com

Change-Id: I5f252be7e9377d3261f992b53f2b893899cbe960
Reviewed-on: https://skia-review.googlesource.com/5863
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agore-land of added sk_FragCoord support to skslc
Ethan Nicholas [Mon, 12 Dec 2016 20:33:30 +0000 (15:33 -0500)]
re-land of added sk_FragCoord support to skslc

BUG=skia:

Change-Id: Ifac1aa39839058787ad1794200c3dbb93c147a69
Reviewed-on: https://skia-review.googlesource.com/5850
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoAdd PDFium_SkiaPaths bot
Eric Boren [Tue, 13 Dec 2016 13:48:46 +0000 (08:48 -0500)]
Add PDFium_SkiaPaths bot

BUG=skia:6049

Change-Id: I90d06f9bb3d6180a0921130b9fe523733211e481
Reviewed-on: https://skia-review.googlesource.com/5849
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
7 years agodon't use deprecated api
Mike Reed [Tue, 13 Dec 2016 14:13:31 +0000 (09:13 -0500)]
don't use deprecated api

BUG=skia:

Change-Id: I25886b9cc8df9235b925582f15bea14fffe855db
NOTRY=True
Reviewed-on: https://skia-review.googlesource.com/5940
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoSkGifCodec: intersect frameRect with image size
Leon Scroggins III [Mon, 12 Dec 2016 22:10:46 +0000 (17:10 -0500)]
SkGifCodec: intersect frameRect with image size

When clearing due to SkCodecAnimation::RestoreBGColor_DisposalMethod,
intersect the frameRect with the image size to prevent clearing outside
the bounds of the allocated memory.

Add a test image, created by the fuzzer.

BUG=skia:6046

Change-Id: I43676d28f82abf093ef801752f3a9e881580924c
Reviewed-on: https://skia-review.googlesource.com/5860
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoFix Android overdraw detection
Matt Sarett [Mon, 12 Dec 2016 23:35:43 +0000 (18:35 -0500)]
Fix Android overdraw detection

Now that SkNWayCanvas inherits from SkNoDrawCanvas, we need to
override onDrawDrawable().

BUG=skia:

Change-Id: Id8cf62f5675199202580d3ee94c71a0ae231c81e
Reviewed-on: https://skia-review.googlesource.com/5865
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
7 years agoRoll recipe DEPS
Eric Boren [Mon, 12 Dec 2016 13:42:11 +0000 (08:42 -0500)]
Roll recipe DEPS

BUG=skia:

Change-Id: Ib3e5b53fc0f01ad00cab94e1130324d7b901ed77
Reviewed-on: https://skia-review.googlesource.com/5791
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoremove old clipping flags
Mike Reed [Tue, 13 Dec 2016 12:55:32 +0000 (07:55 -0500)]
remove old clipping flags

BUG=skia:

Change-Id: Ic80d918439af27d22bdd101124b72d3182baddc6
NOTRY=True
Reviewed-on: https://skia-review.googlesource.com/5920
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoDelete swarm_trigger recipe
Eric Boren [Mon, 12 Dec 2016 13:41:34 +0000 (08:41 -0500)]
Delete swarm_trigger recipe

Delete no-longer-used parts of swarming module and add "pragma: no
cover" where applicable.

BUG=skia:

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

7 years agoAdd Gray test color images to bots
Matt Sarett [Mon, 12 Dec 2016 22:53:26 +0000 (17:53 -0500)]
Add Gray test color images to bots

BUG=skia:

Change-Id: I70a92a9f6355f0fbdfd64b528d10bd0c25a9c0a0
Reviewed-on: https://skia-review.googlesource.com/5864
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Robert Aftias <raftias@google.com>
7 years agoAdd a method in SkCanvas to set "hard" clip bounds.
Stan Iliev [Mon, 12 Dec 2016 22:39:55 +0000 (17:39 -0500)]
Add a method in SkCanvas to set "hard" clip bounds.

Add SkCanvas::setBoundRect, which sets the max clip rectangle,
which can be replaced by clipRect, clipRRect and clipPath.

BUG=skia:

Change-Id: Ie39eb1715214971576e7a1dda760c6997a7e0208
Reviewed-on: https://skia-review.googlesource.com/5359
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
7 years agoDecode to sRGB on Android
Matt Sarett [Mon, 12 Dec 2016 21:30:13 +0000 (16:30 -0500)]
Decode to sRGB on Android

I want to land this so we can start testing color space aware
decoding on Android.  In particular, it will be interesting to
see how linear premultiplication will affect existing content.

This will only modify BitmapRegionDecoder behavior.  I'll
follow up with a similar change to BitmapFactory.cpp in Android.

This will cause image diffs on Gold.

BUG=skia:

Change-Id: Iffda5f035447f2608ce26945570b503f8971b735
Reviewed-on: https://skia-review.googlesource.com/5698
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoAdd GMs and benchs for concave Analytic AA
Yuqian Li [Mon, 12 Dec 2016 21:24:47 +0000 (16:24 -0500)]
Add GMs and benchs for concave Analytic AA

BUG=skia:

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

7 years agoUse unsigned arithmetic for SkBitmapProcStateAutoMapper bias
Florin Malita [Mon, 12 Dec 2016 20:43:51 +0000 (15:43 -0500)]
Use unsigned arithmetic for SkBitmapProcStateAutoMapper bias

To avoid undefined int underflow behavior.

BUG=skia:6017
R=mtklein@google.com,reed@google.com

Change-Id: Ib707ad5e1d87eda70525c56db14849c4164c5640
Reviewed-on: https://skia-review.googlesource.com/5861
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agoHide exotic clipops, with a private rename for internal use
Mike Reed [Mon, 12 Dec 2016 20:02:31 +0000 (15:02 -0500)]
Hide exotic clipops, with a private rename for internal use

BUG=skia:

Change-Id: I6c320a8c7fa501771d93c191c4657452cc9f2e03
Reviewed-on: https://skia-review.googlesource.com/5844
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoSkBitmap::setPixelRef(): less reference churn
Hal Canary [Mon, 12 Dec 2016 18:48:12 +0000 (13:48 -0500)]
SkBitmap::setPixelRef():  less reference churn

BUG=skia:

Change-Id: I9657e4af5fcc808f9175ff336155374ccc77999d
Reviewed-on: https://skia-review.googlesource.com/5461
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agogen_tasks.go: Assert that all compile tasks are in the JOBS list
Eric Boren [Mon, 12 Dec 2016 19:30:12 +0000 (14:30 -0500)]
gen_tasks.go: Assert that all compile tasks are in the JOBS list

Rather than auto-adding the Job, assert that it's listed. This enforces
that the JOBS list is accurate. Add all missing compile Jobs to the list.

BUG=skia:

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

7 years agofix fuzz
Cary Clark [Mon, 12 Dec 2016 18:57:56 +0000 (13:57 -0500)]
fix fuzz

Don't walk off the end if the loop doesn't
contain the expected value.

R=kjlubick@google.com
BUG=skia:6047

Change-Id: I96815180dc7c92b45691037ae6c4b40beedc009a
Reviewed-on: https://skia-review.googlesource.com/5845
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoJust make Android.bp bpfmt compliant to begin with.
Mike Klein [Mon, 12 Dec 2016 19:09:38 +0000 (14:09 -0500)]
Just make Android.bp bpfmt compliant to begin with.

Change-Id: I0fe833b4af4b68f97fe3feefc76503cb6473eb7b
Reviewed-on: https://skia-review.googlesource.com/5847
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoFix SkGifCodec bugs around truncated data
Leon Scroggins III [Fri, 9 Dec 2016 21:39:33 +0000 (16:39 -0500)]
Fix SkGifCodec bugs around truncated data

Prior to this CL, if a GIF file was truncated before reading the local
color map of a frame, incremental decode would do the wrong thing. In
onStartIncrementalDecode, we would either create a color table based on
the global color map, or we would create a dummy one with only one
color (transparent). The dummy color table is correct if there is
neither a global nor a local color map, and allows us to fill the frame
with transparent. But if more data is provided, and it includes an
actual color map and image data, one of the following can happen:
- If the created color table is smaller than the actual one, the
  decoded data may include indices outside of the range of the created
  color table, resulting in a crash.
- If we get lucky, and the created color table is large enough, it may
  still be the wrong colors (and most likely is).

To solve this, make onStartIncrementalDecode fail if there is a local
color map that has not been read yet. A future call may read more data
and read the correct color map.

This is done by returning kIncompleteInput in
SkGifCodec::prepareToDecode if there is a local color map that has not
yet been read. (It is possible that there is no color map at all, in
which case we still need to support decoding that frame. Skip
attempting to decode in that case.)

In onGetPixels, if prepareToDecode returned kIncompleteInput, return
kInvalidInput. Although the input is technically incomplete, no future
call will provide more data (unlike in incremental decoding), and there
is nothing interesting for the client to draw. This also prevents
SkCodec from attempting to fill the data with an SkSwizzler, which has
not been created. (An alternative solution would be create the dummy
color table and an SkSwizzler, which would keep the current behavior.
But I think the new behavior of returning kInvalidInput makes more
sense.)

Add tests to verify the intended behavior:
- getPixels fails.
- startIncrementalDecode fails, but after providing more data it will
  succeed and incremental decoding matches the image decoded from the
  full stream.
- Both succeed if there is no color table at all.

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

7 years agoRevert "added sk_FragCoord support to skslc"
Greg Daniel [Mon, 12 Dec 2016 17:20:42 +0000 (17:20 +0000)]
Revert "added sk_FragCoord support to skslc"

This reverts commit ce33f10677630e34187b661a02161378d8304d68.

Reason for revert: Breaking many gpu bots

Change-Id: I94c813ed6a9311458c872f74bb1b0792f46ff414
Reviewed-on: https://skia-review.googlesource.com/5737
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoUpdated the get_images_from_skps tool to check for ICC profile support
raftias [Thu, 8 Dec 2016 15:53:24 +0000 (10:53 -0500)]
Updated the get_images_from_skps tool to check for ICC profile support

Tool will now check for and output all unsuccessfully parsed ICC
profiles in input sksp images if --testColorCorrectionSupported is set
as a flag. All ICC-aware codecs had to be slightly modified in order to
expose this information, as the logic for accessing the ICC profiles is
all within the codecs. If --writeFailedImages is set, it will also
output all images whoses ICC profiles were not supported.

TBR=reed@google.com

BUG=skia:

Change-Id: Ic310d82bdebf92f8d3bc0ad3dcc688136b6de377
Reviewed-on: https://skia-review.googlesource.com/5355
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>

7 years agoDisable flaky GSStoreTest
Eric Boren [Mon, 12 Dec 2016 15:38:45 +0000 (10:38 -0500)]
Disable flaky GSStoreTest

BUG=skia:6048

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

7 years agoadded sk_FragCoord support to skslc
Ethan Nicholas [Fri, 9 Dec 2016 22:22:59 +0000 (17:22 -0500)]
added sk_FragCoord support to skslc

BUG=skia:

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

7 years agoRemove dependency on NDK cpufeatures.
Mike Klein [Mon, 12 Dec 2016 15:29:38 +0000 (10:29 -0500)]
Remove dependency on NDK cpufeatures.

Instead of relying on cpu-features.c, just do what it does.

Good reading: http://man7.org/linux/man-pages/man3/getauxval.3.html

While it's nice to use the headers when possible, should either of these headers not be available, we can fall back to doing it all manually:

  extern "C" uint32_t getauxval(uint32_t)
  static const int AT_HWCAP = 16;
  static const int HWCAP_CRC32 = (1<<7);

To keep things simple I've slimmed cpu feature detection down to just the features we actually make use of.  This removes all runtime feature detection for ARMv7... we expect NEON to be globally available, and so far we haven't used the other FMA/FP16 bits on ARMv7.  ARMv8 feature dection remains the same, CRC32 before, CRC32 after.  x86 (cpuid-based detection) and MIPS (nothing) are untouched.

We need to keep //third_party/cpu-features for //third_party/libwebp.

Change-Id: I6c96df9a09ae68c8c0e54c1152aa177ba9bafc83
Reviewed-on: https://skia-review.googlesource.com/5800
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agofunnel f16 through standard load/store/gather
Mike Klein [Sun, 11 Dec 2016 16:42:07 +0000 (11:42 -0500)]
funnel f16 through standard load/store/gather

This is a precursor to using mask load, mask store, and gather instructions for f16.  This is a slight performance win too, through slightly simpler code generation.  Having done this, it now makes sense to give a name to f16->f32 conversion, from_f16().

Finally, while we're at this, also send store_f32 through store(), so that now all formats use load, gather, and store uniformly.

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

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

7 years agochange SkClipOp to a class enum
Mike Reed [Mon, 12 Dec 2016 15:02:12 +0000 (10:02 -0500)]
change SkClipOp to a class enum

BUG=skia:

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

7 years agoproposed gn_to_bp fixes
Mike Klein [Mon, 12 Dec 2016 14:03:56 +0000 (09:03 -0500)]
proposed gn_to_bp fixes

in response to 5784

Change-Id: I3ad34a30743e7ffbd04767668c288a4f884eb19c
Reviewed-on: https://skia-review.googlesource.com/5732
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoMake subset param to texture generation API non-optional
Brian Osman [Fri, 9 Dec 2016 21:51:55 +0000 (16:51 -0500)]
Make subset param to texture generation API non-optional

We were always already supplying this, makes it simpler

BUG=skia:

Change-Id: I36ac35205df5ab2a0fb7ec26e83ddb1547154816
Reviewed-on: https://skia-review.googlesource.com/5778
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoConvert image width and height (used by tiling) to float once.
Mike Klein [Fri, 9 Dec 2016 22:00:32 +0000 (17:00 -0500)]
Convert image width and height (used by tiling) to float once.

The storage cost is the same, so might as well do this when building the pipeline instead of when running it.  This also avoids the awkward cvtsi2ss instruction that screws with register renaming.

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

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

7 years agoUpdate SKP version
UpdateSKPs [Sun, 11 Dec 2016 07:04:41 +0000 (07:04 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: Ia66acb6f21804c51661a3d51812c6cd91b1abb61
Reviewed-on: https://skia-review.googlesource.com/5788
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agoAdd documentation for being a Android RoboCop.
Derek Sollenberger [Mon, 12 Dec 2016 13:32:43 +0000 (08:32 -0500)]
Add documentation for being a Android RoboCop.

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

Change-Id: I6172c9edfcac63855b3f7c2b120bac44760a24a5
Reviewed-on: https://skia-review.googlesource.com/5759
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoAdd documentation for Viewer
Jim Van Verth [Thu, 8 Dec 2016 17:13:28 +0000 (12:13 -0500)]
Add documentation for Viewer

BUG=skia:5488

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

Change-Id: I635468f6a17576e990e159f7f02ba2f1946317ab
Reviewed-on: https://skia-review.googlesource.com/5682
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

7 years agoMake *OpList::recordOp functions take sk_sp<GrOp> not GrOp*
Brian Salomon [Fri, 9 Dec 2016 21:32:23 +0000 (16:32 -0500)]
Make *OpList::recordOp functions take sk_sp<GrOp> not GrOp*

Change-Id: Ie3c41aa0910599c9413b4943fbe63000226e526f
Reviewed-on: https://skia-review.googlesource.com/5776
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRename testingOnly_drawBatch to testingOnly_addDrawOp and sk_sp
Brian Salomon [Fri, 9 Dec 2016 21:07:12 +0000 (16:07 -0500)]
Rename testingOnly_drawBatch to testingOnly_addDrawOp and sk_sp

Change-Id: I35efd4ad2b7132145c1e477f0b1f283276e9fad5
Reviewed-on: https://skia-review.googlesource.com/5704
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agobicubic, attempt gazillion
Mike Klein [Fri, 9 Dec 2016 21:25:44 +0000 (16:25 -0500)]
bicubic, attempt gazillion

    - explicitly separate bilinear_ stages in x and y too

BUG=skia:

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

Change-Id: Ib7b4f9d26ea6abe9171068e92424479d811ee606
Reviewed-on: https://skia-review.googlesource.com/5636
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoMake GrRenderTargetOpList::addDrawOp use sk_sp
Brian Salomon [Fri, 9 Dec 2016 21:01:53 +0000 (16:01 -0500)]
Make GrRenderTargetOpList::addDrawOp use sk_sp

Change-Id: I1b3aee2c16075bc481d96052a82f3b3da82061fe
Reviewed-on: https://skia-review.googlesource.com/5699
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoFix comment formatting for GrRenderTargetContext::drawArc
Brian Salomon [Fri, 9 Dec 2016 20:51:31 +0000 (15:51 -0500)]
Fix comment formatting for GrRenderTargetContext::drawArc

Change-Id: I23c946ff42964613a925b98c4ce5cf674b3b61a8
Reviewed-on: https://skia-review.googlesource.com/5705
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agotools and docs: clean up gyp-specific things
Hal Canary [Fri, 9 Dec 2016 20:38:13 +0000 (15:38 -0500)]
tools and docs: clean up gyp-specific things

BUG=skia:

DOCS_PREVIEW= https://skia.org/?cl=5770

Change-Id: Iadc436a68cbf7ec0d1dd3c019072eb28bf589bb6
Reviewed-on: https://skia-review.googlesource.com/5770
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRelandx2 "Remove antialiasing control from GrPaint."
Brian Salomon [Fri, 9 Dec 2016 20:10:07 +0000 (15:10 -0500)]
Relandx2 "Remove antialiasing control from GrPaint."

Fixes a bad merge.

This reverts commit 073285c0595d46205d1482cc19af2d7d891bfeae.

Change-Id: I5e92339d9b33d3a6dc58b9fcd2a1b3a5684e8f8a
Reviewed-on: https://skia-review.googlesource.com/5774
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoremove Building with Skia Tutorial
Mike Klein [Fri, 9 Dec 2016 17:43:41 +0000 (12:43 -0500)]
remove Building with Skia Tutorial

It's mostly "How to Effectively Fight with GYP", which is no longer interesting.

BUG=skia:6043

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

Change-Id: I760e8d9c6577846b34d8f1f0d2e37b5a3c553ccf
Reviewed-on: https://skia-review.googlesource.com/5761
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoPlumb dst color space in many places, rather than "mode"
Brian Osman [Fri, 9 Dec 2016 19:51:59 +0000 (14:51 -0500)]
Plumb dst color space in many places, rather than "mode"

This is less to type in most cases, and gives us more information
(for things like picture-backed images, where we need to know all
about the destination surface).

Additionally, strip out the plumbing entirely for bitmap sources,
where we don't need to know anything.

BUG=skia:

Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da
Reviewed-on: https://skia-review.googlesource.com/5748
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoRevert "Reland "Remove antialiasing control from GrPaint.""
Brian Salomon [Fri, 9 Dec 2016 20:02:08 +0000 (20:02 +0000)]
Revert "Reland "Remove antialiasing control from GrPaint.""

This reverts commit 3944484020d98ff8f386378296106c321279482b.

Reason for revert: Merges badly with a recent change. Will rebase and reland.

Original change's description:
> Reland "Remove antialiasing control from GrPaint."
>
> This contains fixes for GLPrograms test and mixed samples rendering.
>
> This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4.
>
> BUG=skia:
>
> Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
> Reviewed-on: https://skia-review.googlesource.com/5763
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd
Reviewed-on: https://skia-review.googlesource.com/5772
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoReland "Remove antialiasing control from GrPaint."
Brian Salomon [Fri, 9 Dec 2016 19:06:38 +0000 (14:06 -0500)]
Reland "Remove antialiasing control from GrPaint."

This contains fixes for GLPrograms test and mixed samples rendering.

This reverts commit 419d81eed4a010e6080db199795117cbedf9e6e4.

BUG=skia:

Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
Reviewed-on: https://skia-review.googlesource.com/5763
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoRemove SkImage::makeTextureImage
Brian Osman [Mon, 5 Dec 2016 21:12:48 +0000 (16:12 -0500)]
Remove SkImage::makeTextureImage

No one (other than test code) was using this API, and it lacks the context
to do the right thing. Specifically, if this forces a decode of an encoded
image, we don't know the intended use (re: color spaces) to determine how
we should decode.

BUG=skia:

Change-Id: I6ff700b3a5adce8257f35c5e3dd5ba557b2a3219
Reviewed-on: https://skia-review.googlesource.com/5614
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoDifferent approach to fixing gpu blurs on platforms that "useDrawInsteadOfClear"
Robert Phillips [Fri, 9 Dec 2016 18:35:02 +0000 (13:35 -0500)]
Different approach to fixing gpu blurs on platforms that "useDrawInsteadOfClear"

This CL reverts https://skia-review.googlesource.com/c/5148/ (Fix gpu blurring on platforms that "useDrawInsteadOfClear") (all the worstCaseWidth/Height stuff) and adds a new GrRenderTargetContext entry point (absClear) to specify clears that can't be discarded or altered.

BUG=skia:

Change-Id: I18b1373ecf4a153ca8c0f290ab8b1d00770426da
Reviewed-on: https://skia-review.googlesource.com/5484
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoMove 6p arm64 CPU tests to Pixel C
Kevin Lubick [Fri, 9 Dec 2016 16:11:33 +0000 (11:11 -0500)]
Move 6p arm64 CPU tests to Pixel C

We have much more capacity on the Pixel Cs.

BUG=skia:

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

7 years agoMake command buffer sRGB mip-mapping more predictable
Brian Osman [Fri, 9 Dec 2016 15:55:23 +0000 (10:55 -0500)]
Make command buffer sRGB mip-mapping more predictable

BUG=chrome:655247

Change-Id: I1c987939ac224075cdd385c879dd091fb0efd82a
Reviewed-on: https://skia-review.googlesource.com/5753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoRevert "SkImageEncoder::* going away"
Herb Derby [Fri, 9 Dec 2016 17:07:10 +0000 (17:07 +0000)]
Revert "SkImageEncoder::* going away"

Breaks 5 compiles on google3.

This reverts commit 3489b2b727bfb725d45208049e82309280b79ad8.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> SkImageEncoder::* going away
>
> Approval from https://review.skia.org/5006
> TBR=reed@google.com
>
> Change-Id: Ib5fb1b624594598e2316f9247069ecd207d7a974
> Reviewed-on: https://skia-review.googlesource.com/5751
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
>

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

Change-Id: I0c0b863056c90435374769e85fb08c1b2f5113a2
Reviewed-on: https://skia-review.googlesource.com/5760
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoRun bin/fetch-gn as a gclient hook.
Mike Klein [Fri, 9 Dec 2016 16:31:28 +0000 (11:31 -0500)]
Run bin/fetch-gn as a gclient hook.

Seems like the bots don't run hooks.  That's okay, even ideal.
They'll keep getting GN via recipes.

DOCS_PREVIEW= https://skia.org/?cl=5725

Change-Id: I000bad3390dddaeb4548972f29c96b8b3288ea6c
Reviewed-on: https://skia-review.googlesource.com/5725
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoclean up old Makefiles
Hal Canary [Fri, 9 Dec 2016 15:57:39 +0000 (10:57 -0500)]
clean up old Makefiles

BUG=skia:

Change-Id: I523357617135678d0be43a1b41150be58e89f780
Reviewed-on: https://skia-review.googlesource.com/5754
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agodocs: Use the new floating ment on skpaint.md
Joe Gregorio [Fri, 9 Dec 2016 16:27:30 +0000 (11:27 -0500)]
docs: Use the new floating ment on skpaint.md

Screenshot:
  https://screenshot.googleplex.com/C3E0hpuNwdu.png
  https://screenshot.googleplex.com/vdfQMRc24Nv.png

BUG=skia:

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

Change-Id: I00b1bb01cab05592d19f020f3190576bf7907aa2
Reviewed-on: https://skia-review.googlesource.com/5757
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>

7 years agoSkImageEncoder::* going away
Hal Canary [Fri, 9 Dec 2016 15:10:27 +0000 (10:10 -0500)]
SkImageEncoder::* going away

Approval from https://review.skia.org/5006
TBR=reed@google.com

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

7 years ago[SVGDom] Clipped clipPath support
Florin Malita [Thu, 8 Dec 2016 21:04:24 +0000 (16:04 -0500)]
[SVGDom] Clipped clipPath support

ClipPaths can be clipped too, e.g.:

  <clipPath id="clip1" clip-path="url(#clip2)">...</clipPath>

Since we're not really drawing clips but resolving their geometry,
asPath() needs to take composed clipping into account (and intersect as
needed).

R=reed@google.com,robertphillips@google.com,stephana@google.com

Change-Id: I25959e22fe50f72042147cfe6b416b6b9ac20cd4
Reviewed-on: https://skia-review.googlesource.com/5720
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years agoupdate Win/Android toolchain setup after rolling GN
Mike Klein [Fri, 9 Dec 2016 15:32:28 +0000 (10:32 -0500)]
update Win/Android toolchain setup after rolling GN

The new GN doesn't like "ar = ar + ...", etc.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Win-Clang-arm64-Release-Android

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

7 years agoDon't compile the Skia tools for PDK builds.
Derek Sollenberger [Fri, 9 Dec 2016 14:35:50 +0000 (09:35 -0500)]
Don't compile the Skia tools for PDK builds.

Change-Id: I9d64a065bf05d76e131b2d0ab73d136ebbae263f
Reviewed-on: https://skia-review.googlesource.com/5746
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoCommit Queue: Add NoGPU build bot.
Hal Canary [Fri, 9 Dec 2016 15:03:54 +0000 (10:03 -0500)]
Commit Queue: Add NoGPU build bot.

BUG=skia:6040

Change-Id: Iaf0684b844234c6331f6ca8d97769abf566c18d7
Reviewed-on: https://skia-review.googlesource.com/5749
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoDo not create SkGifCodec if true size is not known
Leon Scroggins III [Thu, 8 Dec 2016 16:54:04 +0000 (11:54 -0500)]
Do not create SkGifCodec if true size is not known

If there is enough data in the stream to read the reported canvas size,
but not enough to read the first image's header, we do not know the
true canvas size, since we may expand it to fit the first frame. In
that case, return nullptr from NewFromStream.

Add a test.

SkGifCodec.cpp:
Correct a comment - parse returns false if there is a fatal error.
parse() returning true does not guarantee that the size was found.
Instead of checking the width and height, check to see whether the
first frame exists and has its header defined. If not, we do not yet
know the true canvas size. Assert that the canvas size is non-zero,
which is a fatal error from parse.

SkGifImageReader.cpp:
Move the code to set the header defined before the SkGIFSizeQuery exit
condition. This allows SkGifCodec to check the first frame's header to
determine whether the size is known.

GifTest.cpp:
Add a test which truncates the file just before the image header (and
after the global header). Prior to the other changes, this would create
an SkCodec. For an image that needs its canvas size expanded, the
SkCodec would have an incorrect size.

CodecPartialTest.cpp:
randPixels.gif now needs more than half of its data to create an
SkCodec, so set a minimum for test_partial.

Change-Id: I40482f524128b2f1fe59b8f27dd64c7cbe793079
Reviewed-on: https://skia-review.googlesource.com/5701
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoRevert "Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw""
Robert Phillips [Fri, 9 Dec 2016 14:39:35 +0000 (14:39 +0000)]
Revert "Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw""

This reverts commit 45aac57ac6195880930441656a0988453f16c3db.

Reason for revert:

Pixel test suppression has landed in Chrome:
https://codereview.chromium.org/2559213002 (Add suppression for GPU Pixel test in preparation for Skia CL)

Original change's description:
> Revert "Add antialiasing to SkDropShadowImageFilter's shadow draw"
>
> This reverts commit 78e8165ec3a408a88c394095bfbc43df2051449d.
>
> Reason for revert: Chrome pixel test
>
> Original change's description:
> > Add antialiasing to SkDropShadowImageFilter's shadow draw
> >
> > A BW draw in the SkDropShadowImageFilter can lead to unexpected popping of the shadow when the dest rect lies on half pixel boundaries.
> >
> > Change-Id: Ibc59dacc79bca8955981ec2889e79facd7d2de83
> > Reviewed-on: https://skia-review.googlesource.com/5669
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=bsalomon@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I0b0073cd8d9f1502daaa452c2153af029c11e52a
> Reviewed-on: https://skia-review.googlesource.com/5652
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I7d844c486fd6db57d3df60a32c12699f2d85ad16
Reviewed-on: https://skia-review.googlesource.com/5747
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoRevert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
Mike Reed [Fri, 9 Dec 2016 14:00:50 +0000 (09:00 -0500)]
Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"

This reverts commit a129dfef2aaab0b5995cdf1ab7b2cdd41c29cf72.

BUG=skia:

Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91
Reviewed-on: https://skia-review.googlesource.com/5722
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
7 years agoRoll GN
Mike Klein [Fri, 9 Dec 2016 14:01:53 +0000 (09:01 -0500)]
Roll GN

Mostly to get
    5d7f4ce [GN] Fix generate Xcode project for macOS to work with Xcode 8.

After this lands, gclient sync && python bin/fetch-gn to get the new GN.

Change-Id: I3e1a186996b1db69ef767922a5b9efff173b950c
Reviewed-on: https://skia-review.googlesource.com/5723
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRevert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
Mike Reed [Fri, 9 Dec 2016 13:14:25 +0000 (13:14 +0000)]
Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"

This reverts commit 8e7432b7f98dd592e529a0c8bb038d73ebfb0478.

Reason for revert: <INSERT REASONING HERE>

external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations
    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;

Original change's description:
> remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
>
>
> switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone
>
> BUG=skia:
>
> Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
> Reviewed-on: https://skia-review.googlesource.com/5714
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
>

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

Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c
Reviewed-on: https://skia-review.googlesource.com/5721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoAdd the ability to use different mallocs.
Herb Derby [Fri, 9 Dec 2016 00:00:40 +0000 (19:00 -0500)]
Add the ability to use different mallocs.

gn gen --args='malloc="tcmalloc"'
gn gen --args='malloc="jemalloc"'

or if the library is in a non-standard directory
gn gen --args='malloc="tcmalloc" extra_ldflags="-L<path-to-library>"'

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

7 years agofix fuzzers
Cary Clark [Thu, 8 Dec 2016 21:17:56 +0000 (16:17 -0500)]
fix fuzzers

Two crashes and a hang. Abort and return false
in these cases.

TBR=kjlubick@google.com
BUG=skia:5983

Change-Id: I41ac3e56d47ee423b634b2f4886085b9caada76b
Reviewed-on: https://skia-review.googlesource.com/5716
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>