platform/upstream/libSkiaSharp.git
7 years agook: introduce the idea of Dsts
Mike Klein [Fri, 24 Mar 2017 18:06:47 +0000 (14:06 -0400)]
ok: introduce the idea of Dsts

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

7 years agosimplify api to bitmapcache
Mike Reed [Fri, 24 Mar 2017 21:00:17 +0000 (17:00 -0400)]
simplify api to bitmapcache

Force all Find callers to make a bitmpacachedesc, which now
has more rigid validation.

Goal is to ensure we never make two desc (which turn into keys)
that look different but represent the same image/transformation.

BUG=skia:

Change-Id: I8571837ee4754a69acc99e949bee9a465fa25f2b
Reviewed-on: https://skia-review.googlesource.com/10114
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoOmit tests causing IntelIris540 Vulkan to crash/fail.
Ben Wagner [Fri, 24 Mar 2017 16:11:51 +0000 (12:11 -0400)]
Omit tests causing IntelIris540 Vulkan to crash/fail.

BUG=skia:6398
NOTRY=true

Change-Id: I630727a2d69116bfb49fe1dece7b6417e10c251c
Reviewed-on: https://skia-review.googlesource.com/9872
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoTry a different calculation for computing convexity.
Jim Van Verth [Fri, 24 Mar 2017 18:28:57 +0000 (14:28 -0400)]
Try a different calculation for computing convexity.

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

7 years agoRevert "Remove texture sampling from GrConfigConversionEffect"
Brian Osman [Fri, 24 Mar 2017 18:27:56 +0000 (18:27 +0000)]
Revert "Remove texture sampling from GrConfigConversionEffect"

This reverts commit 3e7cddaf32e280fe9f32eec5bfdd8168ca4941b6.

Reason for revert: Precision issue on some mobile GPUs.

Original change's description:
> Remove texture sampling from GrConfigConversionEffect
>
> Re-land fixed version of https://skia-review.googlesource.com/c/10026/
>
> BUG=skia:
>
> Change-Id: I0754ffb72da2966eb57e5cd7ec818b1cdce84a74
> Reviewed-on: https://skia-review.googlesource.com/10056
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
>

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

Change-Id: I66f52efe191b170612775e26d84a2af3d3f856af
Reviewed-on: https://skia-review.googlesource.com/10118
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoquick-fix to surface dox
Mike Reed [Fri, 24 Mar 2017 16:54:41 +0000 (12:54 -0400)]
quick-fix to surface dox

BUG=skia:

Change-Id: I63cab1d5467fa908358a46199dc44cfe53c20f4f
Reviewed-on: https://skia-review.googlesource.com/10115
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix SkImage_Gpu::getROPixels
Brian Osman [Fri, 24 Mar 2017 15:22:31 +0000 (11:22 -0400)]
Fix SkImage_Gpu::getROPixels

The dstColorSpace is a badly named parameter. It's a hint about where/how
the returned pixels are going to be used. Raster and GPU are meant to
ignore that information - codecs use it to drive our decoding heuristic.

I've adopted that name in several places, although it's quite bad. Maybe
usageColorSpace would be better?

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

7 years agoDelete SkColorSpace::ColorSpaceFlags
Matt Sarett [Fri, 24 Mar 2017 14:06:03 +0000 (10:06 -0400)]
Delete SkColorSpace::ColorSpaceFlags

BUG=skia:

Change-Id: Ia0688876915cd773614ca0c4ccd467cf6e7c603e
Reviewed-on: https://skia-review.googlesource.com/10105
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoAdd function to perform color fragment processor elimination while performing FP...
Brian Salomon [Fri, 24 Mar 2017 16:27:17 +0000 (12:27 -0400)]
Add function to perform color fragment processor elimination while performing FP analysis.

Use this in path and instanced ops.

Change-Id: I6c2d3fc9b3aaa0220c560c70aa1b85515bd35a6d
Reviewed-on: https://skia-review.googlesource.com/10059
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoUpdate Linux Intel Release driver with patch to fix Vulkan
Greg Daniel [Fri, 24 Mar 2017 15:40:29 +0000 (11:40 -0400)]
Update Linux Intel Release driver with patch to fix Vulkan

BUG=skia:

Change-Id: I973460374f2d4cbe141753ecd84cbefa68c9d8d0
Reviewed-on: https://skia-review.googlesource.com/10054
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoRun angle in 8 sample msaa on desktop
Brian Salomon [Fri, 24 Mar 2017 15:15:09 +0000 (11:15 -0400)]
Run angle in 8 sample msaa on desktop

Change-Id: If752152daabcdb7420fd13863fea4ce49f725aab
Reviewed-on: https://skia-review.googlesource.com/10108
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoDisable convex check for now.
Jim Van Verth [Fri, 24 Mar 2017 16:10:48 +0000 (12:10 -0400)]
Disable convex check for now.

Change-Id: Icd0e14cd8183f19c96eeb9a1c46aed3d7809c29f
Reviewed-on: https://skia-review.googlesource.com/10110
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
7 years agoRevert "Revert "Create new inset algorithm for spot shadows""
Brian Salomon [Fri, 24 Mar 2017 16:07:20 +0000 (16:07 +0000)]
Revert "Revert "Create new inset algorithm for spot shadows""

This reverts commit e7c85c45c4c0a97adc6711bb12ecacc36af4ba11.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Create new inset algorithm for spot shadows"
>
> This reverts commit e5f5bf5175e426ebb6aa234f4387831c898f20ad.
>
> Reason for revert: Breaking a bunch of bots. e.g:
>
> https://luci-milo.appspot.com/swarming/task/3519cae0a03c7b10/steps/dm/0/stdout
>
> Original change's description:
> > Create new inset algorithm for spot shadows
> >
> > BUG=skia:
> >
> > Change-Id: If7c67c2a5b9beea28f86d13362a5156b46394d0e
> > Reviewed-on: https://skia-review.googlesource.com/9875
> > Commit-Queue: Ravi Mistry <rmistry@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=jvanverth@google.com,bsalomon@google.com,rmistry@google.com,robertphillips@google.com,msarett@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Change-Id: I3d119ff631dbb1a41f873b9c8753d542ec91254e
> Reviewed-on: https://skia-review.googlesource.com/10112
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
>

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

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

7 years agoRevert "Create new inset algorithm for spot shadows"
Brian Salomon [Fri, 24 Mar 2017 16:00:35 +0000 (16:00 +0000)]
Revert "Create new inset algorithm for spot shadows"

This reverts commit e5f5bf5175e426ebb6aa234f4387831c898f20ad.

Reason for revert: Breaking a bunch of bots. e.g:

https://luci-milo.appspot.com/swarming/task/3519cae0a03c7b10/steps/dm/0/stdout

Original change's description:
> Create new inset algorithm for spot shadows
>
> BUG=skia:
>
> Change-Id: If7c67c2a5b9beea28f86d13362a5156b46394d0e
> Reviewed-on: https://skia-review.googlesource.com/9875
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
>

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

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

7 years agook: fix an assert from unbalanced save/restores
Mike Klein [Thu, 23 Mar 2017 22:57:59 +0000 (18:57 -0400)]
ok: fix an assert from unbalanced save/restores

The 'dont_clip_to_layer' GM does not balance its layers.  It calls
saveLayer() 3x but restore() only 2x.  This may be a bug in the GM
itself, but I'm not sure so I haven't changed it here.

If ok is writing .pngs, the surface passes ownership of its buffer to an
image snapshot, simply marking it as immutable.  Then, when the surface
is destroyed later, it destroys its inner canvas, which restores its
save stack to zero, actually doing some drawing in the case of
unbalanced saveLayer()s.  We then call notifyPixelsChanged() and hit an
assert saying "you just wrote some pixels but this buffer was marked
immutable."

DM doesn't show this problem because it's doesn't really use surfaces
and images, just bitmaps.  There's no ownership handoff and nothing is
ever immutable, so the condition triggering the assert never comes up.

I'm not really sure where we want to say is the bug:
  - SkCanvas can draw in its destructor?
  - SkSurface doesn't restore to zero before snapping an image?
  - that dont_clip_to_layer should call restore three times?

In any case, this guards against it in ok.

I was using this as a convenient crash to help figure out how to best
save and print stack traces, but now that I've got that worked out we
might as well fix this.

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

7 years agook: basic crash handling and stack trace dumps
Mike Klein [Thu, 23 Mar 2017 22:36:39 +0000 (18:36 -0400)]
ok: basic crash handling and stack trace dumps

This seems to work pretty nicely for each engine in the expected case of
few crashes.  The serial and thread engines just dump the first crash
stack to stderr before dying, while the fork engine saves all crashes to
a temporary file, then prints that to stderr once everything's finished.

I'm not sold on this TLS solution as being the best way to know what
was running when we crashed, but it's better than printing nothing.

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

7 years agoCreate new inset algorithm for spot shadows
Jim Van Verth [Fri, 24 Mar 2017 13:40:51 +0000 (09:40 -0400)]
Create new inset algorithm for spot shadows

BUG=skia:

Change-Id: If7c67c2a5b9beea28f86d13362a5156b46394d0e
Reviewed-on: https://skia-review.googlesource.com/9875
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoAdd SkTransferFunctionBehavior flag: Use in codec and encoder
Matt Sarett [Thu, 23 Mar 2017 19:32:25 +0000 (15:32 -0400)]
Add SkTransferFunctionBehavior flag: Use in codec and encoder

This is a step towards removing the non-linear blending flag from
SkColorSpace.  The flag on SkColorSpace used to control the premul
behavior - now it is controlled by this option.

BUG=skia:

Change-Id: Ia29bd8c2b0596a93c6aa14332dcd9bd39e388a90
Reviewed-on: https://skia-review.googlesource.com/10008
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRevert "Revert "Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag""
Robert Phillips [Fri, 24 Mar 2017 11:59:47 +0000 (11:59 +0000)]
Revert "Revert "Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag""

This reverts commit fde9bff19c2a2d84041983e20e443cca2f95ebb6.

Reason for revert: RenderNodeDrawableTests.cpp fix has landed in Android

Original change's description:
> Revert "Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag"
>
> This reverts commit c3efe6785666cdd13848e63f36fdadca26c48649.
>
> Reason for revert: RenderNodeDrawableTests.cpp
>
> Original change's description:
> > Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag
> >
> > Android has been updated to use the new signature so this should no longer be needed
> >
> > Change-Id: Id745191e815381d032aba6a49bf4baf9c53b2385
> > Reviewed-on: https://skia-review.googlesource.com/9985
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=djsollen@google.com,robertphillips@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I0211342b237373fe40d205bb18bbef5efce56bf3
> Reviewed-on: https://skia-review.googlesource.com/9946
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

TBR=djsollen@google.com,robertphillips@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ia517aafc7c9c589d18c0e94699cad3f5acc0e941
Reviewed-on: https://skia-review.googlesource.com/10103
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoRemove texture sampling from GrConfigConversionEffect
Brian Osman [Thu, 23 Mar 2017 20:24:50 +0000 (16:24 -0400)]
Remove texture sampling from GrConfigConversionEffect

Re-land fixed version of https://skia-review.googlesource.com/c/10026/

BUG=skia:

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

7 years agoExtract 4f gradient interval functionality
Florin Malita [Thu, 23 Mar 2017 21:04:54 +0000 (17:04 -0400)]
Extract 4f gradient interval functionality

... into structures usable outside Sk4fGradient classes.

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

7 years agoremove dead code in bitmapcache
Mike Reed [Thu, 23 Mar 2017 19:51:43 +0000 (15:51 -0400)]
remove dead code in bitmapcache

BUG=skia:

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

7 years agoadd experimental flag for downscaling
Mike Reed [Thu, 23 Mar 2017 20:24:20 +0000 (16:24 -0400)]
add experimental flag for downscaling

enabling SK_USE_MIP_FOR_DOWNSCALE_HQ makes raster more closely match ganesh

BUG=skia:

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

7 years agoFind cubic KLM functionals directly
csmartdalton [Thu, 23 Mar 2017 19:38:45 +0000 (13:38 -0600)]
Find cubic KLM functionals directly

- Updates GrPathUtils to computes the KLM functionals directly instead
  of deriving them from their explicit values at the control points.
- Updates the utility to return these functionals as a matrix
  rather than an array of scalar values.
- Adds a benchmark for chopCubicAtLoopIntersection.

BUG=skia:

Change-Id: I97a9b5cf610d33e15c9af96b9d9a8eb4a94b1ca7
Reviewed-on: https://skia-review.googlesource.com/9951
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoSkBlurDrawLooper: Start by deleting flags
Matt Sarett [Thu, 23 Mar 2017 20:23:38 +0000 (16:23 -0400)]
SkBlurDrawLooper: Start by deleting flags

Android is the only user of this looper.  They never pass any flags.

BUG=skia:

Change-Id: I87b02ef7bc0ed94bca82637d60adddf34575a3e6
Reviewed-on: https://skia-review.googlesource.com/10057
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoImprove TaskEngine::wait_one().
Mike Klein [Thu, 23 Mar 2017 19:29:26 +0000 (15:29 -0400)]
Improve TaskEngine::wait_one().

This runs much faster.  Very good idea.

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

7 years agoRemove tests from blacklist for Vk AMD
Greg Daniel [Thu, 23 Mar 2017 17:45:48 +0000 (13:45 -0400)]
Remove tests from blacklist for Vk AMD

From recent changes these should now all pass.

BUG=skia:6396

Change-Id: I4423de1a192017794a732e5bb6eeef7ccc87407c
Reviewed-on: https://skia-review.googlesource.com/10048
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoReplace Thinkness with Thickness.
Ben Wagner [Thu, 23 Mar 2017 18:01:22 +0000 (14:01 -0400)]
Replace Thinkness with Thickness.

The FontMetricsFlags::kUnderlineThinknessIsValid_Flag has a typo in it.
Fortunately no user currently uses this enumeration value by name but
instead uses the getter so the name can be updated.

BUG=skia:6174

Change-Id: I810260d826482de1da8876cd9739d24b3bfb0f95
Reviewed-on: https://skia-review.googlesource.com/10050
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agoRevert "Remove texture sampling from GrConfigConversionEffect"
Brian Osman [Thu, 23 Mar 2017 18:51:59 +0000 (18:51 +0000)]
Revert "Remove texture sampling from GrConfigConversionEffect"

This reverts commit 3bc9bfea5e31b697033e4f0e4c4e4710c34e0387.

Reason for revert: I broke something subtle.

Original change's description:
> Remove texture sampling from GrConfigConversionEffect
>
> BUG=skia:
>
> Change-Id: If5df087d3fe11098f468deab5f2fc8beb782cc83
> Reviewed-on: https://skia-review.googlesource.com/10026
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
>

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

Change-Id: Icca2f435b30512305f3e483689320a5930dc1467
Reviewed-on: https://skia-review.googlesource.com/10052
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agook
Mike Klein [Tue, 21 Mar 2017 17:14:33 +0000 (13:14 -0400)]
ok

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

7 years agoadd test and fix for canvas::isClipEmpty
Mike Reed [Thu, 23 Mar 2017 16:34:15 +0000 (12:34 -0400)]
add test and fix for canvas::isClipEmpty

BUG=skia:

Change-Id: I4e57e0da7111e861fbae1b88574bc1803442243c
Reviewed-on: https://skia-review.googlesource.com/10046
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoMake SkGr.h GrTexture-free
Robert Phillips [Thu, 23 Mar 2017 15:11:59 +0000 (11:11 -0400)]
Make SkGr.h GrTexture-free

Minor cleanup.

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

7 years agoFix MSAN issue found by fuzzer in GrStencilSettings::operator==
Brian Salomon [Wed, 22 Mar 2017 21:50:08 +0000 (17:50 -0400)]
Fix MSAN issue found by fuzzer in GrStencilSettings::operator==

Change-Id: Iebe46b1ec79f7746631cf1836b896d1a39b30d08
Reviewed-on: https://skia-review.googlesource.com/10029
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoIn vulkan align data in buffer when copying to image
Greg Daniel [Wed, 22 Mar 2017 21:03:45 +0000 (17:03 -0400)]
In vulkan align data in buffer when copying to image

BUG=skia:

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

7 years agoOverride onImageInfo() in SkColorSpaceXformCanvas
Matt Sarett [Thu, 23 Mar 2017 14:45:04 +0000 (10:45 -0400)]
Override onImageInfo() in SkColorSpaceXformCanvas

Fixes the gamut gm in gbr modes and maybe others.

BUG=skia:

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

7 years agoRemove texture sampling from GrConfigConversionEffect
Brian Osman [Thu, 23 Mar 2017 13:06:13 +0000 (09:06 -0400)]
Remove texture sampling from GrConfigConversionEffect

BUG=skia:

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

7 years agoOnly perform SkSafeRef race detection if on android framework
Derek Sollenberger [Thu, 23 Mar 2017 12:54:08 +0000 (08:54 -0400)]
Only perform SkSafeRef race detection if on android framework

Change-Id: If524a02e916d711057d6f2102efb0404b1c0b988
Reviewed-on: https://skia-review.googlesource.com/10036
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoMake reference counted assignment check for races.
Derek Sollenberger [Wed, 22 Mar 2017 13:56:37 +0000 (09:56 -0400)]
Make reference counted assignment check for races.

If SkRefCnt_SafeAssign is erroneously invoked simultaneously by two
threads on the same destination, a likely outcome is that the
reference count of an object other than the replaced dst will
be decremented. This results in an extra reference count decrement,
which usually means that the final reference count decrement will
be applied to a random location in an object that has already been
reallocated.  This is exceedingly hard to debug.

We add a hack to detect such data races with sufficiently high
probability, so that such a data race bug should sometimes actually
generate bug reports that lend themselves to diagnosis.

We detect changes within a relatively larger range that normally
includes several (typically slow) memory fences.  Not all such changes
would provoke a crash. Even if we decrement the wrong reference count,
there's a chance we would decrement a dead location. Thus, to
avoid potentially adding instability, we currently only log.

This change tries to minimize additional runtime overhead.
The macro is only expanded a few dozen times, so we do not worry too
much about code size.

Bug: b/31227650
Change-Id: Ia40c9ed2c4d0fa578ea682fbec4b71a2ef22a5d1
Reviewed-on: https://skia-review.googlesource.com/9994
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoTurn on x86-specific code when building zlib.
Mike Klein [Thu, 23 Mar 2017 02:50:02 +0000 (22:50 -0400)]
Turn on x86-specific code when building zlib.

The zlib source we DEPS in for testing has been patched with x86
optimizations, some requring SSE2, some SSE4.2, and some PCLMULQDQ
(between SSE4.2 and AVX).

Might as well turn them on?

zlib actually boils everything down into one do-we-have-everything bit.
That's a little weird... I don't see any real reason not to use
fill_window_sse() on a machine with SSE2 but not SSE4.2.  Whatever.

While tweaking libpng settings is really where it's at to make PNG
encoding faster, this is kind of a nice little cherry on top.  Won't
help people who are using their own zlib, of course.

BUG=skia:6409

Change-Id: I459689069f7559365a66d0d29b33664907704d8e
Reviewed-on: https://skia-review.googlesource.com/10033
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoMake SkImageCacherator be deferred (take 2)
Robert Phillips [Thu, 23 Mar 2017 12:21:00 +0000 (08:21 -0400)]
Make SkImageCacherator be deferred (take 2)

Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

This is a second pass at: https://skia-review.googlesource.com/c/9945/ (Make SkImageCacherator be deferred)

Change-Id: I3451383eed497d1235686e8961087859c7c7bd30
Reviewed-on: https://skia-review.googlesource.com/10034
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoRevert "Revert "Add support for writing icc profiles to the jpeg encoder""
Matt Sarett [Wed, 22 Mar 2017 21:52:47 +0000 (21:52 +0000)]
Revert "Revert "Add support for writing icc profiles to the jpeg encoder""

This reverts commit dda14b9b7ac13dba9214f484fc6270b3ccf4b68b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Add support for writing icc profiles to the jpeg encoder"
>
> This reverts commit 4ef01482025e2e629e35458aa214436d3b4138e8.
>
> Reason for revert: This breaks the android autoroller.
>
> Original change's description:
> > Add support for writing icc profiles to the jpeg encoder
> >
> > Also, share the impl for skjpeg_error_mgr between the
> > jpeg decoder and encoder.  They are already identical
> > anyway.
> >
> > BUG=skia:
> >
> > Change-Id: I4d67f28126388fef3057d62b6e0b203e21ed4afb
> > Reviewed-on: https://skia-review.googlesource.com/10011
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > Commit-Queue: Matt Sarett <msarett@google.com>
> >
>
> TBR=msarett@google.com,scroggo@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Change-Id: Idbb9918370e8384e39d6b7d1c3bcd9545ce4cfd1
> Reviewed-on: https://skia-review.googlesource.com/10017
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>
>

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

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

7 years agoConsolidate Linux GCE dimensions
Kevin Lubick [Wed, 22 Mar 2017 19:54:54 +0000 (15:54 -0400)]
Consolidate Linux GCE dimensions

It appears we were not setting the CPU for our Build
Tasks, which confused our capacity metrics.

BUG=skia:

Change-Id: I60cbe3b99b9de6865141f124df5618975bf65a05
Reviewed-on: https://skia-review.googlesource.com/10020
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoDisable msaa configs on Intel
Brian Salomon [Wed, 22 Mar 2017 20:51:30 +0000 (16:51 -0400)]
Disable msaa configs on Intel

Change-Id: Ia66fa9c27ca2e5b7193b727c30bc0cf836a51c6d
Reviewed-on: https://skia-review.googlesource.com/10023
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoDisable dual source blending on AMD vulkan.
Greg Daniel [Wed, 22 Mar 2017 20:25:53 +0000 (16:25 -0400)]
Disable dual source blending on AMD vulkan.

BUG=skia:6405

Change-Id: I63b60135f1562a4ce1f1a37b719aa01fc62d8790
Reviewed-on: https://skia-review.googlesource.com/9984
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
7 years agoAdd AMD work around in Vulkan to create a new secondary command buffer
Greg Daniel [Wed, 22 Mar 2017 19:45:43 +0000 (15:45 -0400)]
Add AMD work around in Vulkan to create a new secondary command buffer
whenever we change the VkPipeline. All these secondary CBs are still
submitted within one render pass.

This works around the amd bug linked in the bug below. It will probably
cause a slight performance hit, so I will track it on perf and revert if
the hit is significant.

BUG=skia:6406

Change-Id: I48ff39ab36cfa96a67397f745ff65fe8b199f02b
Reviewed-on: https://skia-review.googlesource.com/9987
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoRevert "Revert "Add a new GrResourceCache purging mechanism for purging unused resour...
Brian Salomon [Wed, 22 Mar 2017 18:53:13 +0000 (14:53 -0400)]
Revert "Revert "Add a new GrResourceCache purging mechanism for purging unused resources.""

This reverts commit 20c322ef0cd04cf8e2592879d05d9f4e6cb19596.

Change-Id: I6df9a8594484837672308dc2c21c7c29b76ffa2c
Reviewed-on: https://skia-review.googlesource.com/10013
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agofix round_asymmetric_to_int to also bias bottom and right
Lee Salzman [Tue, 14 Mar 2017 18:52:51 +0000 (14:52 -0400)]
fix round_asymmetric_to_int to also bias bottom and right

BUG=skia:6294

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

7 years agoAdd Swizzle FP, and remove swizzle logic from GrConfigConversionEffect
Brian Osman [Wed, 22 Mar 2017 18:37:50 +0000 (14:37 -0400)]
Add Swizzle FP, and remove swizzle logic from GrConfigConversionEffect

Trying to decompose read/writePixels into some reusable chunks.

BUG=skia:5853

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

7 years agoRevert "Add support for writing icc profiles to the jpeg encoder"
Derek Sollenberger [Wed, 22 Mar 2017 18:54:25 +0000 (18:54 +0000)]
Revert "Add support for writing icc profiles to the jpeg encoder"

This reverts commit 4ef01482025e2e629e35458aa214436d3b4138e8.

Reason for revert: This breaks the android autoroller.

Original change's description:
> Add support for writing icc profiles to the jpeg encoder
>
> Also, share the impl for skjpeg_error_mgr between the
> jpeg decoder and encoder.  They are already identical
> anyway.
>
> BUG=skia:
>
> Change-Id: I4d67f28126388fef3057d62b6e0b203e21ed4afb
> Reviewed-on: https://skia-review.googlesource.com/10011
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
>

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

Change-Id: Idbb9918370e8384e39d6b7d1c3bcd9545ce4cfd1
Reviewed-on: https://skia-review.googlesource.com/10017
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoFix SkTArray operator= to work with self assignment
Greg Daniel [Wed, 22 Mar 2017 17:33:21 +0000 (13:33 -0400)]
Fix SkTArray operator= to work with self assignment

BUG=skia:

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

7 years agoInit Command buffer on inlineUploads in Vulkan
Greg Daniel [Tue, 21 Mar 2017 20:56:31 +0000 (16:56 -0400)]
Init Command buffer on inlineUploads in Vulkan

When the first thing we do in a GrGpuCommandBuffer is do an inlineUpload,
we need to make sure we've initialized the command buffer in Vulkan.

BUG=skia:

Change-Id: Iabee770864a61697c55fb1df18b31862d8df3cdc
Reviewed-on: https://skia-review.googlesource.com/9970
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoRevert "Make SkImageCacherator be deferred"
Robert Phillips [Wed, 22 Mar 2017 18:13:37 +0000 (18:13 +0000)]
Revert "Make SkImageCacherator be deferred"

This reverts commit 801f8b824fee6397422e47537f0f13034ac54ce6.

Reason for revert: Failures on Tegra3-based Android devices (so, npot issues)

Original change's description:
> Make SkImageCacherator be deferred
>
> Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)
>
> Change-Id: I16cf0aea9d887e5ebe053e9b5c94a970dc254beb
> Reviewed-on: https://skia-review.googlesource.com/9945
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

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

Change-Id: Ib143ef86cfad4a221e25145679ba7e48f6f7f3ba
Reviewed-on: https://skia-review.googlesource.com/9949
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoGM: some header cleanup
Mike Klein [Wed, 22 Mar 2017 17:47:51 +0000 (13:47 -0400)]
GM: some header cleanup

gm.h includes sk_tool_utils.h but does not use it.

The bulk of this CL makes each gm that uses sk_tool_utils include it.

sk_tool_utils.h also provided SkRandom and SkTDArray,
so a couple GMs add those headers too.

Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1
Reviewed-on: https://skia-review.googlesource.com/10014
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoAdd support for writing icc profiles to the jpeg encoder
Matt Sarett [Wed, 22 Mar 2017 16:53:27 +0000 (12:53 -0400)]
Add support for writing icc profiles to the jpeg encoder

Also, share the impl for skjpeg_error_mgr between the
jpeg decoder and encoder.  They are already identical
anyway.

BUG=skia:

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

7 years agoMake SkImageCacherator be deferred
Robert Phillips [Wed, 22 Mar 2017 16:21:03 +0000 (12:21 -0400)]
Make SkImageCacherator be deferred

Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

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

7 years agopath hang
Cary Clark [Tue, 21 Mar 2017 20:11:54 +0000 (16:11 -0400)]
path hang

In release, path hangs because buffers overflow.
Debug shows that the clipped cubic generates 34 points although
a maximum of 32 are expected.

The path has very small numbers that fool MaxCurvature into
thinking that there are more places to break the cubic than
are necessary.

To make this bullet-proof, increase the verbs and points.

Allow (1 line + 1 cubic) * (3 x-pieces) * (3 y-pieces) == 18 verbs.
Allow (6 points for line + cubic + line) * 9 pieces    == 54 points.

R=reed@google.com,liyuqian@google.com
BUG=698714

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

7 years agoSupport premul/unpremul of F16 during read/writePixels
Brian Osman [Wed, 22 Mar 2017 14:57:00 +0000 (10:57 -0400)]
Support premul/unpremul of F16 during read/writePixels

Added PremulOutput and UnpremulOutput FP helpers. These are used
(rather than GrConfigConversionEffect) when working with FP16
textures (and will also be used for other configs that can't be
round-tripped via rounding).

BUG=skia:5853

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

7 years agoFurther widen nondeterministic processor testing
Brian Osman [Wed, 22 Mar 2017 15:37:23 +0000 (11:37 -0400)]
Further widen nondeterministic processor testing

Add in all Windows and Mac bots

BUG=skia:6395

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

7 years agoRevert "Add support for writing icc profiles to the jpeg encoder"
Derek Sollenberger [Wed, 22 Mar 2017 16:19:49 +0000 (16:19 +0000)]
Revert "Add support for writing icc profiles to the jpeg encoder"

This reverts commit e3b95ce468c73af8247ba9582a7b84548b19f06a.

Reason for revert: This is breaking the Android auto roller.

Original change's description:
> Add support for writing icc profiles to the jpeg encoder
>
> Also, share the impl for skjpeg_error_mgr between the
> jpeg decoder and encoder.  They are already identical
> anyway.
>
> BUG=skia:
>
> Change-Id: I029312406dee8734744cc3058acd1f153aefcd83
> Reviewed-on: https://skia-review.googlesource.com/9971
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
>

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

Change-Id: I05fb02610dbf4d9475f158d876d6495b0f7e9db4
Reviewed-on: https://skia-review.googlesource.com/10009
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoMark overridden destructors with 'override' and remove 'virtual'
Brian Salomon [Wed, 22 Mar 2017 16:05:03 +0000 (12:05 -0400)]
Mark overridden destructors with 'override' and remove 'virtual'

This silences a new warning in clang 5.0

Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8
Reviewed-on: https://skia-review.googlesource.com/10006
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemove SkImage_Base::asTextureRef (in favor of asTextureProxyRef)
Robert Phillips [Wed, 22 Mar 2017 14:31:11 +0000 (10:31 -0400)]
Remove SkImage_Base::asTextureRef (in favor of asTextureProxyRef)

Minor consolidation/clean-up

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

7 years agoImprove color type handling in SkImage_Base::makeColorSpace()
Matt Sarett [Wed, 22 Mar 2017 14:07:50 +0000 (10:07 -0400)]
Improve color type handling in SkImage_Base::makeColorSpace()

Color space xforms  with Alpha8 images are no-ops.
Other xforms should use 8888 as dst color type.

BUG=skia:

Change-Id: Iede3d94d23c8f4c3dabdaa5450af7b5bfff8d24f
Reviewed-on: https://skia-review.googlesource.com/9996
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agotest (and fix) clip_restriction in canvas
Mike Reed [Wed, 22 Mar 2017 14:01:53 +0000 (10:01 -0400)]
test (and fix) clip_restriction in canvas

BUG=skia:

Change-Id: I86d25d0fd82be35d01471fba59f77b360be5373c
Reviewed-on: https://skia-review.googlesource.com/9995
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>

7 years agoRevert "Add a new GrResourceCache purging mechanism for purging unused resources."
Brian Salomon [Wed, 22 Mar 2017 14:59:02 +0000 (14:59 +0000)]
Revert "Add a new GrResourceCache purging mechanism for purging unused resources."

This reverts commit fbb56ce83fc717b7c6722324bbccd1ae73c350a4.

Reason for revert: Chrome's ancient libstdc++ doesn't like use of steady_clock

Original change's description:
> Add a new GrResourceCache purging mechanism for purging unused resources.
>
> The client may call GrContext::purgeResourceNotUsedSince() with a stead_clock::time_point and all resources that have been purgeable since before that time point are purged.
>
> This is intended to replace the "max unused flushes" purging mechanism once Chrome adopts it.
>
> Change-Id: I28881dd2959cc01c0acca81b2d6001ee5626439d
> Reviewed-on: https://skia-review.googlesource.com/8920
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Karl <ericrk@google.com>
>

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

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

7 years agoAdd a new GrResourceCache purging mechanism for purging unused resources.
Brian Salomon [Wed, 22 Mar 2017 14:04:27 +0000 (10:04 -0400)]
Add a new GrResourceCache purging mechanism for purging unused resources.

The client may call GrContext::purgeResourceNotUsedSince() with a stead_clock::time_point and all resources that have been purgeable since before that time point are purged.

This is intended to replace the "max unused flushes" purging mechanism once Chrome adopts it.

Change-Id: I28881dd2959cc01c0acca81b2d6001ee5626439d
Reviewed-on: https://skia-review.googlesource.com/8920
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Eric Karl <ericrk@google.com>
7 years agoSmall downsample_3_3 optimization
Matt Sarett [Wed, 22 Mar 2017 13:20:02 +0000 (09:20 -0400)]
Small downsample_3_3 optimization

Just a little less math...

mipmap_build_2047x2047_0_gamma
Before: 15.8ms
After:  13.4ms

Hard to see much difference on the gamma correct
mips, which are more dominated by load time.

BUG=skia:

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

7 years agoSkia Gerrit 10k!
Ravi Mistry [Wed, 22 Mar 2017 14:22:04 +0000 (10:22 -0400)]
Skia Gerrit 10k!

BUG=skia:
NOTRY=true

Change-Id: I37876c6f62c85d0532b22dcf8bea8b4e7f4147c0
Reviewed-on: https://skia-review.googlesource.com/10000
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
7 years agoRevert "Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag"
Robert Phillips [Wed, 22 Mar 2017 14:18:02 +0000 (14:18 +0000)]
Revert "Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag"

This reverts commit c3efe6785666cdd13848e63f36fdadca26c48649.

Reason for revert: RenderNodeDrawableTests.cpp

Original change's description:
> Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag
>
> Android has been updated to use the new signature so this should no longer be needed
>
> Change-Id: Id745191e815381d032aba6a49bf4baf9c53b2385
> Reviewed-on: https://skia-review.googlesource.com/9985
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

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

Change-Id: I0211342b237373fe40d205bb18bbef5efce56bf3
Reviewed-on: https://skia-review.googlesource.com/9946
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoAdd support for writing icc profiles to the jpeg encoder
Matt Sarett [Tue, 21 Mar 2017 20:14:42 +0000 (16:14 -0400)]
Add support for writing icc profiles to the jpeg encoder

Also, share the impl for skjpeg_error_mgr between the
jpeg decoder and encoder.  They are already identical
anyway.

BUG=skia:

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

7 years agoRemove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag
Robert Phillips [Tue, 21 Mar 2017 20:50:16 +0000 (16:50 -0400)]
Remove Android-specific SK_SUPPORT_LEGACY_IMG_SNAPSHOT flag

Android has been updated to use the new signature so this should no longer be needed

Change-Id: Id745191e815381d032aba6a49bf4baf9c53b2385
Reviewed-on: https://skia-review.googlesource.com/9985
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoMake SkImage_Gpu be deferred (take 2)
Robert Phillips [Tue, 21 Mar 2017 20:22:00 +0000 (16:22 -0400)]
Make SkImage_Gpu be deferred (take 2)

This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus.

relanding of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred)

split out into:
https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider)

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

7 years agoRevert "Revert "Remove GrPipeline from GrDrawOp.""
Brian Salomon [Tue, 21 Mar 2017 18:22:38 +0000 (14:22 -0400)]
Revert "Revert "Remove GrPipeline from GrDrawOp.""

This reverts commit c48af934608bbb65650641f66adb51f2102d4274.

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

7 years agoIn GrRenderTargetOpList::forwardCombine check adjacent ops
Brian Salomon [Tue, 21 Mar 2017 21:36:10 +0000 (17:36 -0400)]
In GrRenderTargetOpList::forwardCombine check adjacent ops

Clears can combine in ways that make it possible to get a combination with an adjacent op in the forward pass.

Change-Id: I39342bbf16fec9b08347652c6e65840ea28f660b
Reviewed-on: https://skia-review.googlesource.com/9972
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoSkImageSource::Make() returns nullptr when srcrect is empty.
Hal Canary [Tue, 21 Mar 2017 21:00:35 +0000 (14:00 -0700)]
SkImageSource::Make() returns nullptr when srcrect is empty.

BUG=skia:6389
Change-Id: Ia995da1f70cbbc0c80ab76385f0ea8cc0d48fa07
Reviewed-on: https://skia-review.googlesource.com/9943
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agodocument when we retired a serialized verb -- for later removal
Mike Reed [Tue, 21 Mar 2017 13:35:45 +0000 (09:35 -0400)]
document when we retired a serialized verb -- for later removal

BUG=skia:

Change-Id: I86a077080f350a900ad6605efb3b034204dd636a
Reviewed-on: https://skia-review.googlesource.com/9964
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoFuzzCanvas: NullGL & DebugGL
Hal Canary [Tue, 21 Mar 2017 18:11:44 +0000 (11:11 -0700)]
FuzzCanvas: NullGL & DebugGL

Change-Id: I369750c5614ee3b632ff33c82e04125e7c2dfefd
Reviewed-on: https://skia-review.googlesource.com/9942
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoMake experimental Perlin noise shader take texture proxies
Robert Phillips [Tue, 21 Mar 2017 12:48:40 +0000 (08:48 -0400)]
Make experimental Perlin noise shader take texture proxies

This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

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

7 years agoC API: document sk_matrix_t
Hal Canary [Fri, 23 Sep 2016 17:45:31 +0000 (13:45 -0400)]
C API: document sk_matrix_t

Change-Id: I8f35868de6ef7d541cc3c9bcaddad4871bf8d6eb
Reviewed-on: https://skia-review.googlesource.com/2590
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoRun discardable test bots as single-threaded
Matt Sarett [Tue, 21 Mar 2017 17:13:22 +0000 (13:13 -0400)]
Run discardable test bots as single-threaded

This should fix any flakiness caused by dynamically exceeding memory
limits.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE

BUG=skia:4703

Change-Id: Ifd581539bacdb25a5f2f8f994c6c119d5576e294
Reviewed-on: https://skia-review.googlesource.com/9977
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoSkImage_Raster: Keep tmp in scope while it is in use
Matt Sarett [Tue, 21 Mar 2017 17:05:41 +0000 (13:05 -0400)]
SkImage_Raster: Keep tmp in scope while it is in use

BUG=skia:

Change-Id: Ida1457ad7489f23804b8e4317e283c1dce0f6fc6
Reviewed-on: https://skia-review.googlesource.com/9918
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoMore png API compatibility
Matt Sarett [Tue, 21 Mar 2017 17:03:26 +0000 (13:03 -0400)]
More png API compatibility

BUG=skia:

Change-Id: I71aa730b08b3eebd18d9651363bbcd816b8598fd
Reviewed-on: https://skia-review.googlesource.com/9976
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoEnable dng testing on windows
Matt Sarett [Mon, 20 Mar 2017 22:09:30 +0000 (18:09 -0400)]
Enable dng testing on windows

IIRC, we had problems with OOM testing dng on windows.  Since then,
I think we have replaced our dng test images with smaller versions.
I think we can gives this another shot.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win2k8-MSVC-GCE-CPU-AVX2-x86_64-Debug

BUG=skia:

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

7 years agoAdd docs for iOS simulator build.
Mike Klein [Tue, 21 Mar 2017 15:49:26 +0000 (11:49 -0400)]
Add docs for iOS simulator build.

The new bot[1] seems to be working.

[1] https://status.skia.org/repo/skia?filter=search&search_value=Build-Mac-Clang-x64-Release-iOS

BUG=skia:6329

Change-Id: I40ea4b19cba14a160d84317d7fee11aef5b17051
Reviewed-on: https://skia-review.googlesource.com/9973
Reviewed-by: Hal Canary <halcanary@google.com>
7 years agoAdd iOS simulator support and a Build bot.
Mike Klein [Mon, 13 Mar 2017 14:54:11 +0000 (07:54 -0700)]
Add iOS simulator support and a Build bot.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Mac-Clang-x64-Release-iOS

BUG=skia:6329

Change-Id: I4a9d79469683797ff54727b6a1031f438939ce9b
Reviewed-on: https://skia-review.googlesource.com/9517
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
7 years agocheck-headers-self-sufficient: update
Hal Canary [Wed, 15 Feb 2017 16:21:32 +0000 (11:21 -0500)]
check-headers-self-sufficient: update

  * Translate to python, use multiprocessing to make it wun in reasonanble time.
  * Fix three headers.
  * Move one header.

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

7 years agofix fuzz
Cary Clark [Tue, 21 Mar 2017 14:30:50 +0000 (10:30 -0400)]
fix fuzz

corrupted intersection point lists
can loop forever. Add a safety
hatch to abort after a large number
of iterations.

TBR=kjlubick@google.com
BUG=700679

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

7 years agoExclude Vulkan from running PreFlushCallbackTest
Robert Phillips [Tue, 21 Mar 2017 14:30:41 +0000 (10:30 -0400)]
Exclude Vulkan from running PreFlushCallbackTest

This should "fix" the broken Vulkan bots

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

7 years agoCompatible use of png_set_iCCP
Matt Sarett [Tue, 21 Mar 2017 14:06:45 +0000 (10:06 -0400)]
Compatible use of png_set_iCCP

BUG=skia:

Change-Id: Ie37b92fd5e0d2bc92ec7f2bf3e6f56d061bc30a2
Reviewed-on: https://skia-review.googlesource.com/9960
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoAdd Chromecast Perf jobs
Kevin Lubick [Tue, 21 Mar 2017 13:25:34 +0000 (09:25 -0400)]
Add Chromecast Perf jobs

It starts out with some skps and resource-based perf
because all skps wouldn't fit and skimages are far too large

BUG=skia:

Change-Id: Icb07ffa84d39a85a8bc595e74ef934df921e749a
Reviewed-on: https://skia-review.googlesource.com/9901
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoCombine some duplicate code in AA using template
Yuqian Li [Fri, 17 Mar 2017 15:26:29 +0000 (11:26 -0400)]
Combine some duplicate code in AA using template

BUG=skia:

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

7 years agoMove build tasks to MacOS 10.12
Stephan Altmueller [Mon, 20 Mar 2017 17:38:45 +0000 (13:38 -0400)]
Move build tasks to MacOS 10.12

BUG=skia:

Change-Id: I5317dde5262ff6e880fa54a660f09205c616f1a4
Reviewed-on: https://skia-review.googlesource.com/9898
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Stephan Altmueller <stephana@google.com>

7 years agoIn Vulkan make sure to add barriers between write operations
Greg Daniel [Tue, 21 Mar 2017 13:48:44 +0000 (09:48 -0400)]
In Vulkan make sure to add barriers between write operations

BUG=skia:6396

Change-Id: I60faf6ad9095f18c64e33a0359e30239efbac79f
Reviewed-on: https://skia-review.googlesource.com/9963
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoHave SkColorSpaceXformCanas tell SkCanvas about clips.
Mike Klein [Tue, 21 Mar 2017 02:47:33 +0000 (22:47 -0400)]
Have SkColorSpaceXformCanas tell SkCanvas about clips.

This should make queries like SkCanvas::getLocalClipBounds() work.

BUG=chromium:703363

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

7 years agoEnable GLES on Intel Linux bots.
Ben Wagner [Tue, 21 Mar 2017 02:56:19 +0000 (22:56 -0400)]
Enable GLES on Intel Linux bots.

BUG=skia:6401
NOTRY=true

Change-Id: Ief434ca38ffd504198e8d3656a0a869d0faa9ebf
Reviewed-on: https://skia-review.googlesource.com/9822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agorename makeCopyForTextureParams to isACopyNeededForTextureParams
Robert Phillips [Tue, 21 Mar 2017 13:14:35 +0000 (09:14 -0400)]
rename makeCopyForTextureParams to isACopyNeededForTextureParams

I thought the old name was misleading

split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

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

7 years agoRevert "Make SkImage_Gpu be deferred"
Robert Phillips [Tue, 21 Mar 2017 13:26:13 +0000 (13:26 +0000)]
Revert "Make SkImage_Gpu be deferred"

This reverts commit 0db235bc0278887c344eb25b4681e9cca4cf892a.

Reason for revert: cc_unittests failing

Original change's description:
> Make SkImage_Gpu be deferred
>
> This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus.
>
> split out into:
> https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider)
>
> Change-Id: I266bbe089c242fe54d5b7adcc7895aa5a39440a0
> Reviewed-on: https://skia-review.googlesource.com/6680
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>

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

Change-Id: Ia15590a1fae04b52723713760fdbf0492ad36286
Reviewed-on: https://skia-review.googlesource.com/9962
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoAttempt to fix AMD ANGLE bots.
Brian Salomon [Mon, 20 Mar 2017 21:08:43 +0000 (17:08 -0400)]
Attempt to fix AMD ANGLE bots.

Makes the second context used for image tests be of the same type as it was before https://skia.googlesource.com/skia/+/6405e71279e99731f89db69325c6763ec62a98e1

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

7 years agoFollowup fixes for recipe roll
Eric Boren [Tue, 21 Mar 2017 12:20:33 +0000 (08:20 -0400)]
Followup fixes for recipe roll

Simplifying some environment madness. Nobody gets to modify default_env.
Always apply it in run.__call__(). Add depot_tools path to PATH in
default_env. Result is simpler but now default_env is applied in many
more places, which should be harmless.

BUG=skia:

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

7 years agoreadpixels GM uses GPU image in GPU configs
Brian Osman [Mon, 20 Mar 2017 20:54:28 +0000 (16:54 -0400)]
readpixels GM uses GPU image in GPU configs

This now demonstrates that readPixels does not do color sapce conversion
in Ganesh (and fails completely for unpremul F16). Next: fix those issues.

BUG=skia:5853

Change-Id: If3bd1882249ae85b4738ef72e16cfb87b06b9363
Reviewed-on: https://skia-review.googlesource.com/9904
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAdd support for F32 sources to SkColorSpaceXform
Matt Sarett [Mon, 20 Mar 2017 23:06:18 +0000 (19:06 -0400)]
Add support for F32 sources to SkColorSpaceXform

This also subtlely allows clients to convert between F32 and F16.

BUG=skia:

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

Change-Id: Ied5f2295fce00c69d8cf85730be899f3f8597915
Reviewed-on: https://skia-review.googlesource.com/9914
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>