platform/upstream/libSkiaSharp.git
7 years agoExclude complexclip4 GM tests from tile_rt config
Stan Iliev [Wed, 14 Dec 2016 22:07:37 +0000 (17:07 -0500)]
Exclude complexclip4 GM tests from tile_rt config

Exclude complexclip4_bw and complexclip4_aa tests from tile_rt
config, because these tests invoke Skia API that does not support
picture recording.

BUG=skia:

Change-Id: Ia9c04b78b03819e7a060badf9c0fd138b7d66b75
Reviewed-on: https://skia-review.googlesource.com/6095
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>

7 years agospeedup dynamicwstream
Mike Reed [Thu, 15 Dec 2016 19:11:37 +0000 (14:11 -0500)]
speedup dynamicwstream

- move bytesWritten calculation to query the tail, allowing write() to be faster since it doesn't have to update anything extra per-write.
- enforce that all blocks are multiple-of-4 bytes big
- update the minimum block size to 4K

Before: 30ms
After:  23ms for non-4-bytes writes
        13ms for 4-bytes writes

BUG=skia:

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

7 years agoPort SkResourceCache to SkTHashTable
Mike Klein [Tue, 13 Dec 2016 21:26:32 +0000 (16:26 -0500)]
Port SkResourceCache to SkTHashTable

We'd like to fix bugs and make performance improvements to our hash tables.  It's a lot easier if we can focus on one implementation, so I'd like to move users of SkTDynamicHash to SkTHashTable, SkTHashMap, or SkTHashSet.  This is roughly outlined in the attached Skia bug.

In this case, the conversion from SkTDynamicHash to SkTHashTable is pretty trivial.  The main change is that the values stored in the table are no longer assumed to be pointers, so we just need to sprinkle in a couple of * and ->.

SkResourceCache is particularly interesting as the locus of the attached Chromium bug.  Porting this now means SkResourceCache will get any fixes we make as soon as we make them.

BUG=skia:6053,chromium:429375

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

7 years agoremove unused dynamicwstream.snapshotAsData()
Mike Reed [Thu, 15 Dec 2016 18:02:33 +0000 (13:02 -0500)]
remove unused dynamicwstream.snapshotAsData()

Checking to invalidate this on every write() call has a measurable cost, so removing it both simplifies the class and speeds it up.

BUG=skia:

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

7 years agoUpdate Pixel Cs -> NFM26H
Kevin Lubick [Thu, 15 Dec 2016 17:36:12 +0000 (12:36 -0500)]
Update Pixel Cs -> NFM26H

BUG=skia:

Change-Id: I09c99c58be39f5ce9b772265a469ce33e87b8ad8
Reviewed-on: https://skia-review.googlesource.com/6144
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoRename GrAtlasTextBatch->GrAtlasTextOp and sk_sp
Brian Salomon [Thu, 15 Dec 2016 15:58:41 +0000 (10:58 -0500)]
Rename GrAtlasTextBatch->GrAtlasTextOp and sk_sp

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

7 years agoRename GrAtlasTextBatch files to GrAtlasTextOp
Brian Salomon [Thu, 15 Dec 2016 15:20:35 +0000 (10:20 -0500)]
Rename GrAtlasTextBatch files to GrAtlasTextOp

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

7 years agoadd fatstroke sample
Mike Reed [Thu, 15 Dec 2016 15:23:42 +0000 (10:23 -0500)]
add fatstroke sample

BUG=skia:

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

7 years agoFix stragling Ubuntu dimensions
Kevin Lubick [Thu, 15 Dec 2016 15:45:08 +0000 (10:45 -0500)]
Fix stragling Ubuntu dimensions

BUG=skia:

Change-Id: I2328190da7fc1f2db10bb87684fb3a3e95751ec5
Reviewed-on: https://skia-review.googlesource.com/6111
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoAnother step to using gn_to_bp.py
Leon Scroggins III [Thu, 15 Dec 2016 14:36:17 +0000 (09:36 -0500)]
Another step to using gn_to_bp.py

Remove the tests for gyp_to_android.py, which is going away anyway.
With a .bp file in the Android source tree, the Android build system
attempts and fails to build them.

Do not attempt to run the deleted tests.

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

7 years agoWorkaround freeze on Mac Chrome when checking read pixel config support.
Brian Salomon [Thu, 15 Dec 2016 14:35:19 +0000 (09:35 -0500)]
Workaround freeze on Mac Chrome when checking read pixel config support.

Chromium may ask us to read back from locked IOSurfaces. Calling the command buffer's
glGetIntegerv() with GL_IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE causes the command buffer
to make a call to check the framebuffer status which can hang the driver. So in Mac Chromium
we always use a temporary surface to test for glReadPixels format/type support.

BUG=chromium:662802

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

7 years agoRename NVPR batch->op and sk_sp'ify
Brian Salomon [Thu, 15 Dec 2016 14:54:06 +0000 (09:54 -0500)]
Rename NVPR batch->op and sk_sp'ify

Change-Id: I5934e189f72cbc9c1f306c719b4d6e3f5178a046
Reviewed-on: https://skia-review.googlesource.com/6101
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoAdded optimized sRGB/2.2 gamma stages into A2B color xform
raftias [Wed, 14 Dec 2016 18:15:05 +0000 (13:15 -0500)]
Added optimized sRGB/2.2 gamma stages into A2B color xform

Hooked up existing to/from srgb, and to_2dot2 stages into
SkColorSpaceXform_A2B. Added a from_2dot2 stage to the raster pipeline
to complete the other direction.

BUG=skia:

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

Change-Id: I3887af3f59f67329d7e843e7355ff54e22cc4ed0
Reviewed-on: https://skia-review.googlesource.com/5840
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAdd a deferred copy surface (take 3)
Robert Phillips [Thu, 15 Dec 2016 14:23:05 +0000 (09:23 -0500)]
Add a deferred copy surface (take 3)

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: Ib8fd96d0569274ef781366eb900ed8ee839ae9bd
Reviewed-on: https://skia-review.googlesource.com/6109
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agospeculative pointer to member fix
Cary Clark [Thu, 15 Dec 2016 14:17:31 +0000 (09:17 -0500)]
speculative pointer to member fix

Move the body of simple functions
out of line if they are used in
pointer to member function expressions.

This may fix a chromeos-reported bug.

TBR=reed@google.com
BUG=674047

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

7 years agoEven more batch->op and sk_sp'ification.
Brian Salomon [Thu, 15 Dec 2016 02:07:01 +0000 (21:07 -0500)]
Even more batch->op and sk_sp'ification.

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

7 years agoRevert "Test CL"
Ravi Mistry [Thu, 15 Dec 2016 13:49:16 +0000 (13:49 +0000)]
Revert "Test CL"

This reverts commit ebad58c7d02c31fbf731255d8098ae4b85dba6af.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Test CL
>
> BUG=skia:
> NOTRY=true
>
> Change-Id: I9fb0bf32d80430e2501eb4bd8e2d28696762b9f8
> Reviewed-on: https://skia-review.googlesource.com/6106
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
>

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

Change-Id: I905e51d09980eb498ae3ef922a26bf6f23f07701
Reviewed-on: https://skia-review.googlesource.com/6107
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoTest CL
Ravi Mistry [Thu, 15 Dec 2016 13:16:40 +0000 (08:16 -0500)]
Test CL

BUG=skia:
NOTRY=true

Change-Id: I9fb0bf32d80430e2501eb4bd8e2d28696762b9f8
Reviewed-on: https://skia-review.googlesource.com/6106
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoRemove Mac 10.6 - 10.8 work arounds for fonts.
bungeman [Wed, 14 Dec 2016 21:53:00 +0000 (16:53 -0500)]
Remove Mac 10.6 - 10.8 work arounds for fonts.

We no longer support these platforms and no longer work on 10.6 anyway.
On 10.7 and 10.8 things will probably still mostly work, but there may be
some strangeness.

Change-Id: I6816a97d8a986ad3b762673d18cc973bbe7befcd
Reviewed-on: https://skia-review.googlesource.com/6093
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agoRemove strange 'write' overload on SkDynamicMemoryWStream.
bungeman [Wed, 14 Dec 2016 21:51:08 +0000 (16:51 -0500)]
Remove strange 'write' overload on SkDynamicMemoryWStream.

This should have been names 'overwrite' and appears to be unused.

Change-Id: Ic9dd21e6789fb079fcbc209ed5d074a77f3587cc
Reviewed-on: https://skia-review.googlesource.com/6092
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoSome more batch->op renaming
Brian Salomon [Wed, 14 Dec 2016 21:21:37 +0000 (16:21 -0500)]
Some more batch->op renaming

Change-Id: I5cbdc606170186d2d908d518af0e0fd1094fcf78
Reviewed-on: https://skia-review.googlesource.com/6089
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoReenable 16-bit png brd decode tests
Matt Sarett [Wed, 14 Dec 2016 21:11:51 +0000 (16:11 -0500)]
Reenable 16-bit png brd decode tests

I accidentally turned these off in:
https://skia-review.googlesource.com/c/6023/

Even though the decode color type does not match the canvas,
we still want to run the test.

BUG=skia:

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

7 years agoBring sk_sp to oval GrDrawOps and rename batch->op
Brian Salomon [Wed, 14 Dec 2016 20:52:56 +0000 (15:52 -0500)]
Bring sk_sp to oval GrDrawOps and rename batch->op

Change-Id: Ic0e95a29f1e2479d3d79b7d175290cb20422b585
Reviewed-on: https://skia-review.googlesource.com/6082
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMake picture backed images sRGB by default
Brian Osman [Wed, 14 Dec 2016 20:42:36 +0000 (15:42 -0500)]
Make picture backed images sRGB by default

This adds support for playing back a picture image in a different
color space. This is currently limited to just the original space
(sRGB) or legacy mode. I think the best next step is to make them
fully flexible (playing back in the destination surface's space),
but that's going to involve changes to caching logic. I'd like to
keep that separate.

BUG=skia:

Change-Id: I15e6d44e977328b06a4da008ff7b2ed88d851a0b
Reviewed-on: https://skia-review.googlesource.com/5777
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoDemote savePixels to save_pixels
Robert Phillips [Wed, 14 Dec 2016 20:12:15 +0000 (15:12 -0500)]
Demote savePixels to save_pixels

This CL again only really makes sense in the bigger picture of moving readPixels off of GrTexture

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

7 years agoAdd Galaxy Tab3 Test
Kevin Lubick [Wed, 14 Dec 2016 13:48:00 +0000 (08:48 -0500)]
Add Galaxy Tab3 Test

Perf won't work because J is too old.  But, we can at least run tests.  Since we only have one
device, I decided to just do Debug instead of Debug/Release.  We don't care about CPU things since
we have much faster arm devices to handle that for us.

BUG=skia:

Change-Id: I11e6f13a128b627bc2f2b2878c39c0fda8d310a9
Reviewed-on: https://skia-review.googlesource.com/6027
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemove tombstones from SkTHash.
Herb Derby [Wed, 14 Dec 2016 19:20:08 +0000 (14:20 -0500)]
Remove tombstones from SkTHash.

* Switch to linear probing - this allows delete to rearrange elements to fill in empty slots
* NULL -> nullptr

Change-Id: I741c2f3bb2734bf638d0c0a78c6cc549f563a5d9
Reviewed-on: https://skia-review.googlesource.com/5980
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoChange FLAGS_analyticAA's default to true
Yuqian Li [Wed, 14 Dec 2016 18:46:53 +0000 (13:46 -0500)]
Change FLAGS_analyticAA's default to true

BUG=skia:

Change-Id: I1abf2284ed9dfaa69110c4fe86325c8e4ee43317
Reviewed-on: https://skia-review.googlesource.com/5767
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoremove PLAIN_ENUM flag for SkClipOp
Mike Reed [Wed, 14 Dec 2016 19:00:03 +0000 (14:00 -0500)]
remove PLAIN_ENUM flag for SkClipOp

BUG=skia:

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

7 years agoUpdate rect ops to use "op" in their name and return sk_sp.
Brian Salomon [Wed, 14 Dec 2016 16:08:17 +0000 (11:08 -0500)]
Update rect ops to use "op" in their name and return sk_sp.

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

7 years agoswitch to libstdc++ for standalone Android builds.
Mike Klein [Wed, 14 Dec 2016 18:17:53 +0000 (13:17 -0500)]
switch to libstdc++ for standalone Android builds.

This makes it possible to target NDK API 18 (K) again.

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

7 years agoPartially defer GrSWMaskHelper
Robert Phillips [Wed, 14 Dec 2016 17:19:05 +0000 (12:19 -0500)]
Partially defer GrSWMaskHelper

This is intended to position the writePixels in GrSWMaskHelper::toTexture for moving to GrSurfaceContext

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

7 years agoRemove SkKTXImageEncoder
Leon Scroggins III [Wed, 14 Dec 2016 15:33:10 +0000 (10:33 -0500)]
Remove SkKTXImageEncoder

It escaped the chopping block when we deleted the decoder, but it is
currently untested and unused as far as we know. In addition to
removing effectively unsupported code, this simplifies build file
changes (i.e. don't build it on Android framework, but build it
elsewhere) as we narrow our build systems down to one.

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

7 years agoSK_API-export SkCodec
Florin Malita [Wed, 14 Dec 2016 18:17:01 +0000 (13:17 -0500)]
SK_API-export SkCodec

R=scroggo@google.com,reed@google.com

Change-Id: Ic9fba1919aeb2c5e92c053d43a41d33201abc37c
Reviewed-on: https://skia-review.googlesource.com/6080
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoAdd SkCodec::FrameInfo::fFullyReceived
Leon Scroggins III [Thu, 8 Dec 2016 16:38:58 +0000 (11:38 -0500)]
Add SkCodec::FrameInfo::fFullyReceived

This indicates whether the frame has been fully received, i.e. the
stream contains enough data to decode to the end of the frame.

A client may want to use this to know whether they should attempt to
decode this frame, if they do not want to decode partial frames.

Change-Id: I336c7031b0c0b8c1401ce040f5372aedc87fdc14
Reviewed-on: https://skia-review.googlesource.com/5703
Reviewed-by: Chris Blume <cblume@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoremove PLAIN_ENUM flag for SkClipOp
Mike Reed [Wed, 14 Dec 2016 15:51:41 +0000 (10:51 -0500)]
remove PLAIN_ENUM flag for SkClipOp

BUG=skia:

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

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>