Commit Graph

9491 Commits

Author SHA1 Message Date
Mike Reed
e3f17b911f remove SkMixer, since we have explicit lerps/blends in SkShader
Change-Id: I937861df9d8ae89c0587ea59dd740989bebd35a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207305
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-10 20:59:30 +00:00
Mike Klein
1c62426f96 make to_vec template parameters explicit
For some reason, Clang can infer <N,T> but GCC can't.
No big deal... we know exactly the ones we want anyway.

Change-Id: I15ba4d4edbd3bc0f37ebe3c2b6e411726cd9fb69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207341
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-04-10 19:45:55 +00:00
Mike Klein
da7b053527 tweak SkVx to play nicely with others
Was starting to use this and ran into a few problems with clashing
symbols, namely SI and cast().  Seemed simple enough to not use SI,
and to move all the free-standing types into skvx: skvx::cast,
skvx::shuffle, etc.

Change-Id: Ia5d8ef6d0ae5375bf80d76be88d16f0c9cde56e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207340
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-04-10 19:40:05 +00:00
Brian Osman
e8a986387b Define all ImageSetEntry members out of line
This fixes compile errors in Windows DLL builds, where (due to
exceptions?) any of these members might need to call sk_sp's
destructor.

Change-Id: I82986afa4497216cda76b681782ccea3c530ba7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-10 15:06:20 +00:00
Robert Phillips
9313aa77e1 Skip flush in GrDrawingManager if the specifed proxy doesn't have any work (take 2)
This is rather ham-fisted but I would like to have a short-term fix for the "always-flush" perf regressions.

Change-Id: I508e2d725ac18f50318baf31bc3243fe932c724b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206697
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-10 13:55:01 +00:00
Mike Reed
b5c685991f remove shader factory guard define
Change-Id: Id2d700556e5c0bc55a97b88180103e34344503ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207040
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-10 01:11:35 +00:00
Mike Reed
442973874c remove def of colorfilter flag
Bug: skia:8937
Change-Id: I5d735fafa0339f93f5a3b3cb4adadb059e64b389
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206913
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-09 19:28:58 +00:00
Mike Reed
c8bea7deb6 New factories for SkShaders
Bug: skia:8937
Change-Id: Ic253b70fbf89059321185912aa771b1c1de7d231
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206693
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-09 19:15:01 +00:00
Martin Vejdarski
8842799432 add missing shared lib visibility macros
fixes linker errors when using is_component_build

Change-Id: Ie28b0e8881cb81715a959df3a87bae4fa854afda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206140
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Martin Vejdarski <martin@mainframe.co.uk>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-09 14:34:55 +00:00
Robert Phillips
9a7c7be159 Revert "Skip flush in GrDrawingManager if the specifed proxy doesn't have any work"
This reverts commit 4187ac5e47.

Reason for revert: test if this is causing the angle GM image diffs

Original change's description:
> Skip flush in GrDrawingManager if the specifed proxy doesn't have any work
> 
> This is rather ham-fisted but I would like to have a short-term fix for the "always-flush" perf regressions.
> 
> Change-Id: Id359ad5a01a290e7e6c06f7ccc1c385ad47d2c06
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206277
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I19ea23a6b8e3985353fc1ebaf974513bb922e9f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206694
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-09 12:46:27 +00:00
Mike Reed
187a91e363 undef guard for bitmap shader
Bug: skia:8937
Change-Id: I25a70f4700f2809477d31e2bf3632fa948d0bc54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206689
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-08 22:00:39 +00:00
Mike Reed
b286bc2da8 Introduce new factory for SkColorFilters
Idea: transition callers to this, so we can later typedef SkColorFilter
and SkShader to the same thing.

Bug: skia:8937
Change-Id: I000c882e11622091aa44c141aa6ddd1216414f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 21:03:59 +00:00
Mike Reed
c67e0067b0 extend guard to makeAsALocalMatrixShader for google3
Change-Id: I245dbeecbd12f0f79f824d6fff7f0253e7748252
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206682
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-08 18:08:54 +00:00
Mike Reed
50acf8f04b add makeShader() to SkBitmap, and deprecate SkShader version
Bug: skia:8937
Change-Id: I42f011e04937a751222bd8ecc6c69b45cf9626a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 17:56:34 +00:00
Robert Phillips
4187ac5e47 Skip flush in GrDrawingManager if the specifed proxy doesn't have any work
This is rather ham-fisted but I would like to have a short-term fix for the "always-flush" perf regressions.

Change-Id: Id359ad5a01a290e7e6c06f7ccc1c385ad47d2c06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206277
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-08 17:32:02 +00:00
Michael Ludwig
beb7cd291a Reland "Support clip masks for SaveLayerRec and drawSpecial in Ganesh"
This reverts commit 3c3b194f3b.

Reason for revert: Seems to be a problem with Inteliris 655, which already
 has an extensive blacklist, so adding this test to it

Original change's description:
> Revert "Support clip masks for SaveLayerRec and drawSpecial in Ganesh"
>
> This reverts commit 053b293993.
>
> Reason for revert: breaks on Intel Vulkan
>
> Original change's description:
> > Support clip masks for SaveLayerRec and drawSpecial in Ganesh
> >
> > Change-Id: I2e37e28fcbd3631bccc65253604015871503a089
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205929
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> >
> Change-Id: Ic230fa9bcb16c97f218b94922a280f5b86a90491
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206203
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 8961
Change-Id: Ie32071bc2be7501066f7b6cf6d40cfb48dbd9986
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206393
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-04-08 17:01:12 +00:00
Mike Reed
7656b2c18c Revert "Revert "Move localmatrix routines to shaderbase, no need to be public.""
Re-add old API behind guard.

This reverts commit f88a0e1c91.

Bug: skia:8941
Change-Id: Id8f211568ce381adc9cae8be01202a83f42da6a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206384
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-08 16:26:12 +00:00
Mike Reed
7c18eb9dc5 Reland "Revert "Move localmatrix routines to shaderbase, no need to be public.""
This reverts commit 12b4902e50.

Reason for revert: hmmm, where is my guard?

Original change's description:
> Revert "Revert "Move localmatrix routines to shaderbase, no need to be public.""
> 
> Need to guard this for google3
> 
> This reverts commit f88a0e1c91.
> 
> Change-Id: Ia169610898c6276ae5af8a869ecc9672f6f4f285
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206264
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ibfb21fa248efbafe4ce3909ec3a1af5cffb221de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206398
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 15:46:14 +00:00
Mike Reed
12b4902e50 Revert "Revert "Move localmatrix routines to shaderbase, no need to be public.""
Need to guard this for google3

This reverts commit f88a0e1c91.

Change-Id: Ia169610898c6276ae5af8a869ecc9672f6f4f285
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206264
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-08 13:45:30 +00:00
Mason Freed
8cef07e707 Added the ability to set the entire matrix at once
Prior to this CL, the only/typical way to set the matrix was by
16 set() operations, which is slower now that typeMask is not
lazily computed.

Bug: 950253
Change-Id: I72176891068c90f247475deb8e946a8bb4ced7d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206346
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-08 13:18:10 +00:00
Mason Freed
559d9eea48 Made the fTypeMask field non-lazily computed.
With this change, the SkMatrix44 is now trivially copyable. It will
do more work than before if multiple mutations are performed on a
matrix before the getType() method is called.

Bug: 938563
Change-Id: I3faf88e2b72de264457ebff61a26608baf3afd2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206176
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-05 21:16:10 +00:00
Michael Ludwig
3c3b194f3b Revert "Support clip masks for SaveLayerRec and drawSpecial in Ganesh"
This reverts commit 053b293993.

Reason for revert: breaks on Intel Vulkan

Original change's description:
> Support clip masks for SaveLayerRec and drawSpecial in Ganesh
> 
> Change-Id: I2e37e28fcbd3631bccc65253604015871503a089
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205929
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,reed@google.com,michaelludwig@google.com

Change-Id: Ic230fa9bcb16c97f218b94922a280f5b86a90491
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206203
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-04-05 20:33:02 +00:00
Hal Canary
7340124746 SkString: simplify impl
Change-Id: Ie35a5c2b7dae0376eb1eb677648d80cf1688faf4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/126641
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-04-05 20:18:10 +00:00
Michael Ludwig
053b293993 Support clip masks for SaveLayerRec and drawSpecial in Ganesh
Change-Id: I2e37e28fcbd3631bccc65253604015871503a089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205929
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-05 19:43:10 +00:00
Mike Klein
6aaad1a27a update SkMallocPixelRef docs
- no more color tables
 - explicitly mention that MakeAllocate does not initialize the pixels

Change-Id: I98b9ef1fecc36ea5d9acbae66ccd8979810c2760
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206265
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-05 17:46:33 +00:00
Mike Reed
f88a0e1c91 Revert "Move localmatrix routines to shaderbase, no need to be public."
This reverts commit f4a8d6fc94.

Reason for revert: need to guard this for google3

Original change's description:
> Move localmatrix routines to shaderbase, no need to be public.
> 
> Requires https://chromium-review.googlesource.com/c/chromium/src/+/1554040
> 
> Bug: skia:8941
> Change-Id: I68593bf794d559845b638e1ecbcc658cc5cfe1b4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206165
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=halcanary@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I2dc2f2ff2291c0b4579f32f1a6a8f283a156f6c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8941
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206263
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-05 15:15:24 +00:00
Mike Reed
f4a8d6fc94 Move localmatrix routines to shaderbase, no need to be public.
Requires https://chromium-review.googlesource.com/c/chromium/src/+/1554040

Bug: skia:8941
Change-Id: I68593bf794d559845b638e1ecbcc658cc5cfe1b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206165
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-05 14:29:02 +00:00
Malay Keshav
e4628b1072 Make SkRRect work with axis aligned rotation transforms
This patch allows SkRRect::trasform() work with any axis aligned matrix
transform meaning it now works with a rotation of 90 or 270 degrees.

Adds relevant unit tests.

Bug: skia:8944
Change-Id: I63678ec0e3556c181517526de55d84666afeb681
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205860
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-04 18:43:30 +00:00
Mike Reed
e2aa08bf19 Reland "rely on clients to opt in to legacy enums"
This reverts commit 68cbc925ec.

Reason for revert: guard added to google3

Original change's description:
> Revert "rely on clients to opt in to legacy enums"
> 
> This reverts commit 98f4e81d49.
> 
> Reason for revert: prolly broke google3
> 
> Original change's description:
> > rely on clients to opt in to legacy enums
> > 
> > Bug: skia:8937
> > Change-Id: I4cd9d44e87ce3309884d563c8e11336f0c39faf0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205934
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> > Auto-Submit: Mike Reed <reed@google.com>
> 
> TBR=reed@google.com
> 
> Change-Id: I1a14e531b3718e27e161544dbc44d55582e1f83a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8937
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206064
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I929fa97e05f76d50c6c3266f434c1d06803bdc30
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206073
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-04 15:23:21 +00:00
Mike Reed
68cbc925ec Revert "rely on clients to opt in to legacy enums"
This reverts commit 98f4e81d49.

Reason for revert: prolly broke google3

Original change's description:
> rely on clients to opt in to legacy enums
> 
> Bug: skia:8937
> Change-Id: I4cd9d44e87ce3309884d563c8e11336f0c39faf0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205934
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I1a14e531b3718e27e161544dbc44d55582e1f83a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206064
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-04 14:16:01 +00:00
Mike Reed
98f4e81d49 rely on clients to opt in to legacy enums
Bug: skia:8937
Change-Id: I4cd9d44e87ce3309884d563c8e11336f0c39faf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205934
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-04 12:56:29 +00:00
Chris Dalton
a8fbeba6cb Add a cap to allow coverage counting or not
We don't want to just disable the "ccpr" path renderer anymore (or
whatever it should be called), because we are adding an MSAA
implementation. This new cap will eventually tell ccpr whether it can
use coverage counting, or if it should just use the MSAA impl.

Bug: skia:
Change-Id: Ie6e5ca1a637ca4408bc6bb844153afa9da26f58e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204883
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-04-03 19:39:24 +00:00
Brian Salomon
2c791fcdf2 Track the number of resources that would become purgeable after flush
in GrResourceCache.

Bug: skia:8927
Change-Id: Ia00ba0ea541a22e29e9a8208044e1fabd5296782
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205484
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-04-03 18:06:08 +00:00
Brian Osman
fbe2406693 Reland "Remove the NullGL interface (and associated test context)"
This reverts commit 215da624d1.

Reason for revert: Blink issues ironed out.

Original change's description:
> Revert "Remove the NullGL interface (and associated test context)"
> 
> This reverts commit de206c75c2.
> 
> Reason for revert: Chrome is having issues with the switch to Mock in blink tests.
> 
> Original change's description:
> > Remove the NullGL interface (and associated test context)
> > 
> > Bug: skia:
> > Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
> 
> Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I1f4fbbcb00f302c5d830cb1392badd6ec7a33c69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205832
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-03 16:38:10 +00:00
Mike Reed
fae8fceb4a Use SkTileMode instead of nested enum
Add guard to transition clients

Change-Id: Ia7a3e8f95722f91e84af262168dadf89a78707da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205720
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 15:24:18 +00:00
Brian Salomon
01ceae9352 Control access to adding ref to a GrGpuResource when it's ref count is zero.
We want GrResourceCache to be able to track which resources are held by
refs (as opposed to pending IOs) so that it can track the affect of
flushing on resource purgeability. Therefore, all cases that can add the
first ref to a GrGpuResource must funnel through GrResourceCache. This
lays the groundwork by restricting initial refs.

No-Presubmit: true
No-Tree-Checks: true
No-Try: true

Bug: skia:8927
Change-Id: I1213c3db258d2412df6666e3222419211ceaa192
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205482
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-03 13:16:23 +00:00
Mike Reed
e25b4472cd Move SkTileModes to top level
- move shader factories to their host (e.g. picture->makeShader)

More to do to formally deprecated SkShader::TileMode

Bug: skia:8937
Change-Id: I101e42fb9fba4ab91d028a34888f1fde16fdece4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205589
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 00:18:35 +00:00
Ben Wagner
c9eeab3d85 Remove Skia version number.
The value hasn't changed in a long time, and is unlikely to be useful
anytime soon.

Change-Id: Iec5ca31558bd427087f4b7f90cdde5c3c09f12ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205586
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-02 20:10:54 +00:00
Brian Osman
29c8808ef6 Initialize renderability in GrMockOptions
Change-Id: I30a042a41991a47ff1a4e008b88431b4767453dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205496
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 19:00:28 +00:00
Brian Osman
4428f2c39f Remove SkScalarSinCos
This differed from the separate versions in that it snapped to zero.
It was also strictly worse than calling the two separate versions.
Most clients don't need the snapping, so just call the two existing
functions. For clients that need the snapping, call new variants of
each that do snap.

Change-Id: Ia4e09fd9651932fe15caeab1399df7f6281bdc17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-02 15:46:57 +00:00
Mike Klein
556ef6ec76 remove SkColorFilter::onMakeComposed()
No implementations remain.

Change-Id: I569d2ca9c69df27228a33dd433790c6c06aebe08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205340
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-02 15:01:31 +00:00
Mike Reed
9b2c4e94e2 remove double compose: lerp and mode
Bug: skia:8937
Change-Id: I5b890c03b0451afe4cbeb6a264798ebbb09b9888
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205346
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-02 14:56:27 +00:00
Brian Osman
215da624d1 Revert "Remove the NullGL interface (and associated test context)"
This reverts commit de206c75c2.

Reason for revert: Chrome is having issues with the switch to Mock in blink tests.

Original change's description:
> Remove the NullGL interface (and associated test context)
> 
> Bug: skia:
> Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: Iff0cbf29dcea26957efc800a8c33d0ad8285de0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 12:48:37 +00:00
Mike Reed
8e6aa55daa remove asComponentTable introspection method
Bug: skia:8941
Change-Id: I29d5a786987a517eff7ad50d92286e9a7edf3d2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205268
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-02 12:41:36 +00:00
Mike Reed
3f6a2ac636 remove unneeded asACompose
Bug: skia:8941
Change-Id: I020d5c00f18527ef3564a72a55d3326d647006ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205302
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-01 20:50:03 +00:00
Mike Reed
e852427f1a mark introspection methods as deprecated
Bug: skia:8941
Change-Id: Ibf2269787540df699e56f5241c2f5d2852616ff0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205267
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-01 19:39:43 +00:00
Brian Salomon
b6a3a3b245 Make lazy proxies have 2 modes for proxy/surface key management.
kSynced: Proxy and GrSurface key kept in sync.

kUnsynced: Proxy and GrSurface keys are unrelated.

This will allow cross-context image generators' lazy instantiation
callbacks to use unique keys to find any pre-existing backing GrTexture
rather than keeping an unref'ed bare pointer to the GrTexture.

Bug: skia:8927

Change-Id: Id15e2a64e8d2e56c4ce70b9399eb1d8bcea6ac9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204723
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-04-01 17:16:43 +00:00
Brian Osman
de206c75c2 Remove the NullGL interface (and associated test context)
Bug: skia:
Change-Id: Ie3c9ee39fc1e0a4406de085c60d8433ffb4419df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203708
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-01 14:56:23 +00:00
Robert Phillips
73cc4e8d5f Temporarily restore old behavior of read/writeSurfacePixels
In the interest of only changing one thing at a time, this should fix the putImageData perf regression in Chrome. It will be followed up by a CL to change prepareSurfaceForExternalIO to always flush (which could have a different perf impact).

On Chrome's putImageData benchmark we get:

w/o this CL: avg 293.1247823176651 runs/s
w/  this CL: avg 374.8427288397461 runs/s

Bug: 942538
Change-Id: I9b9bc752532890f4313a45e5a6aa34b915d5e43d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205003
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-01 13:35:57 +00:00
Mike Reed
2fdbeae327 Start to unify signatures: return bool
Change-Id: If4a8e06f3a176697e3f5136dfc7ab1fbb347da70
Bug: skia:8937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205120
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-30 19:02:24 +00:00
Florin Malita
8dd5ea1a75 [skottie] Allow extra-normal Bezier interpolation
AE/Lottie allow Bezier control Ys to be outside the [0..1] range.

Update SkCubicMap to do the same.

Bug: skia:8931
Change-Id: I54ee8dbb4e6e0a33a917500523c82fe56c854d4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205002
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-29 18:23:03 +00:00
Ben Wagner
d04d3ae3b7 Update SkTLazy includes.
SkTLazy now uses std::aligned_storage instead of SkAlignedSStorage, so
update the includes to reflect this.

Change-Id: I2f26e418a3e2836555fcb877a7041e354e569374
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204781
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-29 16:03:31 +00:00
Stan Iliev
b0a8684e61 Add API to get canvas wrapped by SkPaintFilterCanvas
Implement SkAndroidFrameworkUtil::getBaseWrappedCanvas, which gets
the real canvas behind SkPaintFilterCanvas. This is useful, because
SkCanvas::drawDrawable works differently on a GPU backed canvas.

Test: Built and ran with Android
Bug: b/128792554
Change-Id: I5b75d42256d7a4efca987d55be2ce064c10fb4e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204442
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-28 21:16:10 +00:00
Kevin Lubick
3902628e35 Support WebGL 1.0 with caps
There is some logic in here for 2.0 as well, just as a
"as long as I was looking at the specs", but only 1.0
is really supported.

This seems to resolve the bug where some GPUs weren't
advertising correctly that they had vertex array object
support, by checking for both extension names (with and
without "GL_" prefix)

Of note, this saves about 18 Kb (5.5 Kb gzipped) of code size
by compiling out the unneeded GLES checks/functionality.

Bug: skia:8378
Change-Id: I773bf4dbf231b991051d2a9f640b8047a9010e7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203461
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-28 17:21:23 +00:00
Ben Wagner
2f4e7b6840 SkTLazy constructors to require constructable.
The current SkTLazy copy and move constructors require copy or move
assignable instead of copy or move constructable. This prevents use with
classes with const members (since they cannot be assigned to after
construction). This change also brings SkTLazy more in line with
std::optional which will eventually take over most of what SkTLazy is used
for.

Change-Id: I7bad4edac6a8b3e8adeebc48400d7298a970ed31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204447
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-28 16:57:53 +00:00
Mike Reed
05be23dbd3 use mixer to combine two filters
Change-Id: Idb221248606dc683d17f0934b4e3152ff0d6c2d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204360
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-03-28 15:55:53 +00:00
Adrienne Walker
0f82797f37 Add a function to compute texture sizes
This lets memory traces agree on how big textures are.

Bug: chromium:944846
Change-Id: I5ea8cb5e1331b4ad8d6f59f656c6e61d44290489
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203727
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
2019-03-27 14:05:28 +00:00
Michael Ludwig
926fb89d7b Remove old experimental SkiaRenderer APIs
Change-Id: I21bd0155bf28420c10caf43af29748def510643c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203171
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-26 19:59:03 +00:00
Brian Osman
d2ca31218b Convert GrPorterDuff test from NullGL to Mock context
Bug: skia:
Change-Id: Id403aabcae1dbf38e55381bb3b4353e85a12a745
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203705
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-26 16:04:49 +00:00
Nigel Tao
b8ec7f194a Remove unused setAlphaAndRequiredFrame condition
Also add some commentary.

Bug: skia:
Change-Id: I164c4004802387981b76b28adc106ac0e65fc3ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196820
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-03-26 13:47:22 +00:00
Brian Osman
15dc59e65c Stop supporting VC8 (Visual Studio 2005) in GrConfig
Bug: skia:
Change-Id: I5d447ea40ef541682f1e855d14e07bf8e45ee89a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203392
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-25 19:24:19 +00:00
Brian Osman
9fec5d390a Fix doc comment error for allocN32Pixels
Bug: skia:
Change-Id: I93fb561ed0b367c0a207b26aa297b997f06acfa7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203395
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-25 19:14:49 +00:00
Brian Osman
4cd0734f4c Remove bookmaker sources and data files
We're moving in a different direction for Skia documentation. We no
longer run bookmaker on the bots, and things have already degraded such
that it can't be run. This leaves the generated markdown in place for
the last set of docs that were generated (which are still useful until
the Doxygen docs catch up).

See also: https://skia-review.googlesource.com/c/skia/+/198162

Docs-Preview: https://skia.org/?cl=203464
Bug: skia:
Change-Id: I2f967a9c17dbc1cc899947d365071ef69cfb8ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203464
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-25 18:56:29 +00:00
Brian Osman
4d92b89454 Revert "Remove GrDrawAtlasOp"
This reverts commit 97d957d1db.

Reason for revert: Looking at perf, desktop GPUs get better, many mobile GPUs get worse.

Original change's description:
> Remove GrDrawAtlasOp
> 
> The base device turns drawAtlas into drawVertices, which ends
> up being *faster* (in my tests) than our specialized code.
> 
> It's certainly possible to write a custom version that's better,
> but for now, it seems better to just do this.
> 
> Bug: skia:
> Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,reed@google.com

Change-Id: Idfb3dd7d33a3905644aafdefc99e7814b08d7c7b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203053
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-24 00:53:33 +00:00
Brian Osman
97d957d1db Remove GrDrawAtlasOp
The base device turns drawAtlas into drawVertices, which ends
up being *faster* (in my tests) than our specialized code.

It's certainly possible to write a custom version that's better,
but for now, it seems better to just do this.

Bug: skia:
Change-Id: I247f0c0a24fb21c8206f4e3ea9fecac85679ba73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203163
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-23 23:11:00 +00:00
Hal Canary
25dd2c9fe9 SkPDF: runtime switch between subsetters
Bug: chromium:931719
Change-Id: I3199983d24a47b2b3921242a98ce83099ee869dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202956
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@skia.org>
2019-03-23 16:31:10 +00:00
Mike Klein
e5acd7547b delete DAA
Change-Id: I1fd8cba067c0063c6621641e8196e69fd5e31cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203080
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-22 15:44:03 +00:00
Brian Salomon
5ad6fd3160 Put SkImageInfo on SkImage to avoid cost of reconstructing for queries.
Previously calling SkImage::alphaType(), for example, woult call
the virtual SkImage_Base::onImageInfo() which would construct
and return a temporary SkImageInfo. This often meant ref-ing a
SkColorSpace.


Change-Id: I54975a6b20dea5bc84739068df0c81c022a12067
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202711
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 20:07:34 +00:00
Brian Osman
f9666f5467 Remove SkColorSpaceXformCanvas, and supporting code:
- SkColorSpaceXformer
- makeColorSpace on SkShader, SkColorFilter,
  SkImageFilter, SkDrawLooper, and SkLights
- DM support and some bot configs

Bug: skia:8773
Change-Id: I16ef8f487de6c35329b3b0474c1d66d7fa0a6220
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202430
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-21 17:12:33 +00:00
Mike Klein
8f4e224541 de-Sk tools/debugger
Change-Id: I489a54860139d1820471aa0330b29a8ae9eca31e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202316
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:27:01 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Kevin Lubick
8aa203c1d8 Add macro to decide GrGLStandard
This allows us to remove certain interfaces at compile time.

This replaces most (all?) of the cases where it was
if (gl) else [implicit gles] to be explicitly
if (gl) else if (gles)
in preparation for adding a WebGL standard.

For consistency, I tried to check first for GL, then for
GLES, which involved re-arranging a few if blocks.

PS 3 removes about 1.2KB (0.4 KB gzipped) from CanvasKit by
removing the GrGLInterface related checks from
GrGlInterface::validate()

PS 8 removes a total of 6.0 KB (2.6 KB gzipped) from
GrGlInterface::validate() and GrGlCaps::*

Bug: skia:8378
Change-Id: Ia91b732d888907f5d94b0eac8ca023084999fa7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201604
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-19 18:19:12 +00:00
Michael Ludwig
3fad21283d Add SK_API to ImageSetEntry
Bug: skia:
Change-Id: I5df6735da3d574439f2ca2bcdcf01057adc95384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201612
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-19 18:04:12 +00:00
Michael Ludwig
390f0cc1f8 Reland "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit 138a06d1b1.

Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments,
matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization
code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief
lifespan.

Original change's description:
> Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
>
> This reverts commit bd9d88a6e4.
>
> Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.
>
> Original change's description:
> > Reland "Update SkCanvas' experimental SkiaRenderer API"
> >
> > This reverts commit 90791c202d.
> >
> > Reason for revert: Jumped the gun, just need to update blacklist
> >
> > Original change's description:
> > > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > >
> > > This reverts commit 4bf964602a.
> > >
> > > Reason for revert: vulkan dm crashes
> > >
> > > Original change's description:
> > > > Update SkCanvas' experimental SkiaRenderer API
> > > >
> > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > > deprecates the older experimental_DrawImageSetV1 and
> > > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > > transform batching. Internally, SkCanvas routes the old functions to the
> > > > new entry points and all device-level code is updated to handle the new
> > > > API features.
> > > >
> > > > While touching all of the canvas/device/recording areas, the
> > > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > > separated into the image category and the rectangle category.
> > > >
> > > > Bug: skia:8739
> > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > >
> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > >
> > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:8739
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> >
> > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Auto-Submit: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:8739, oss-fuzz:13794
Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 14:18:52 +00:00
Brian Salomon
0cc575488f Revert "Revert "Change promise image contract to for when Release and Done are called.""
This reverts commit d716d4402a.

Bug: skia:8800
Change-Id: Ic16cd4e960be2c3d2462bdf2b54b2e32abbd9f78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199081
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-18 19:20:44 +00:00
Kevin Lubick
bbb9281ab8 Break out GrGLAssembleInterface into a few files
one for GL, one for GLES, and one (soon) for WebGL

Bug: skia:8378
Change-Id: Ib13699b7432ed56cce99ac568840e5575bb4d2e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201654
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-18 18:57:18 +00:00
Chris Dalton
f774818f57 Reland "Disable coverage counting by default"
This reverts commit 9ff956e6de.

Reason for revert: Will fix the issues with the change landed.

Original change's description:
> Revert "Disable coverage counting by default"
> 
> This reverts commit 576b2a5596.
> 
> Reason for revert: DDL and MSRTC unhappy
> 
> Original change's description:
> > Disable coverage counting by default
> > 
> > Bug: skia:
> > Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Chris Dalton <csmartdalton@google.com>
> 
> TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com
> 
> Change-Id: Iabdb3116d97c7470044b962ff78cffd47ccee744
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201933
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I1d81f7a52e81079bd232e97588fd34729a8f50cd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201938
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-18 16:22:47 +00:00
Chris Dalton
9ff956e6de Revert "Disable coverage counting by default"
This reverts commit 576b2a5596.

Reason for revert: DDL and MSRTC unhappy

Original change's description:
> Disable coverage counting by default
> 
> Bug: skia:
> Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: Iabdb3116d97c7470044b962ff78cffd47ccee744
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201933
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-18 15:59:47 +00:00
Robert Phillips
3e7eb0f32f Unblock Flutter
There is a lot more cleanup associated w/ removing this but this is the minimum that will un-block Flutter.

Change-Id: I7b8595007f912d9ddbb2c9d7a9989e10101f9c92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201647
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-18 15:49:30 +00:00
Chris Dalton
576b2a5596 Disable coverage counting by default
Bug: skia:
Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-17 23:54:24 +00:00
Kevin Lubick
a4a76f3f4f Clean up some types in SkFont
Bug: skia:
Change-Id: Ie0a3cc61f16e07619e69ff2d5dac566457572e80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201681
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-16 13:58:37 +00:00
Mike Reed
79a7542081 allow mixer to defer to a shader
- reverse sense of Blend mixer to be (dst, src, mode)
- change pipeline register convention to be (dst, src)

Bug: skia:
Change-Id: I1f1d990001ad941cb8d44e1488c5f14077e181f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201386
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-15 20:24:21 +00:00
Brian Salomon
e80b809e8a Revert "Revert "Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.""
This reverts commit 88b8d1124b.

Bug: skia:8800
Change-Id: I27f5da73b651b91af0c5440557f5986e493a1559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199080
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-15 16:24:28 +00:00
Brian Osman
5ced0bfd00 Add shader based blending of kPlus for configs that need clamping
This effectively reverts https://skia-review.googlesource.com/c/skia/+/140500
and relands https://skia-review.googlesource.com/c/skia/+/48183.

Bug: skia:8871
Change-Id: I6b1d5daa3d319e0c078e553926ed9166cca9a24a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199930
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-15 14:54:17 +00:00
Brian Salomon
138a06d1b1 Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit bd9d88a6e4.

Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.

Original change's description:
> Reland "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 90791c202d.
> 
> Reason for revert: Jumped the gun, just need to update blacklist
> 
> Original change's description:
> > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > 
> > This reverts commit 4bf964602a.
> > 
> > Reason for revert: vulkan dm crashes
> > 
> > Original change's description:
> > > Update SkCanvas' experimental SkiaRenderer API
> > > 
> > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > deprecates the older experimental_DrawImageSetV1 and
> > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > transform batching. Internally, SkCanvas routes the old functions to the
> > > new entry points and all device-level code is updated to handle the new
> > > API features.
> > > 
> > > While touching all of the canvas/device/recording areas, the
> > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > separated into the image category and the rectangle category.
> > > 
> > > Bug: skia:8739
> > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > 
> > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-15 14:33:39 +00:00
Brian Osman
65cdd61304 Ganesh: Clamp blend inputs when using F16_Clamped pixel config
This ensures that we stay in [0,1], except for plus mode, which
requires a larger and more invasive change.

Bug: skia:
Change-Id: I97f6bcea8b10e70e55ba24bcff759ddbb1761794
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-14 23:37:17 +00:00
Mike Klein
f4438d56e9 skvx: allow more implicit conversions
Guarding the implict constructors and scalar/vector
operations with std::is_convertible ought to make SkVx
types feel more like normal C types, allowing implicit
conversions exactly when the scalar equivalents would.

This shouldn't change the behavior of any code, or make
anything new possible... just nicer to read and write.

Change-Id: Iff4b89012c5b8c7f7933e6841c925b81186bc614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201402
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-14 19:11:21 +00:00
Mike Klein
525ff2098e update docs for SkLumaColorFilter
Well, at least we have this to show for an otherwise wasted morning...

Change-Id: I8b0c55c0ff3c4b726a7992fd493dac008c7d3cb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201191
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-14 18:41:41 +00:00
Michael Ludwig
bd9d88a6e4 Reland "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 90791c202d.

Reason for revert: Jumped the gun, just need to update blacklist

Original change's description:
> Revert "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 4bf964602a.
> 
> Reason for revert: vulkan dm crashes
> 
> Original change's description:
> > Update SkCanvas' experimental SkiaRenderer API
> > 
> > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > deprecates the older experimental_DrawImageSetV1 and
> > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > transform batching. Internally, SkCanvas routes the old functions to the
> > new entry points and all device-level code is updated to handle the new
> > API features.
> > 
> > While touching all of the canvas/device/recording areas, the
> > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > separated into the image category and the rectangle category.
> > 
> > Bug: skia:8739
> > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-03-14 17:01:55 +00:00
Brian Salomon
876a017e53 Reland "Reintroduce deinstantiate lazy proxy types and use for promise images."
This is a reland of 8b40ac35b2

Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
> 
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
> 
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
> 
> 
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:8800
Change-Id: Ib939fc5c19edf0c6b965c9f6adf0afedd4267703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-14 15:07:10 +00:00
Michael Ludwig
90791c202d Revert "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 4bf964602a.

Reason for revert: vulkan dm crashes

Original change's description:
> Update SkCanvas' experimental SkiaRenderer API
> 
> This lifts the temporary functions in SkGpuDevice into SkCanvas and
> deprecates the older experimental_DrawImageSetV1 and
> experimental_DrawEdgeAARect.  The new functions can handle paints and
> transform batching. Internally, SkCanvas routes the old functions to the
> new entry points and all device-level code is updated to handle the new
> API features.
> 
> While touching all of the canvas/device/recording areas, the
> experimental functions are grouped in an "EdgeAA" cluster instead of being
> separated into the image category and the rectangle category.
> 
> Bug: skia:8739
> Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-14 14:57:12 +00:00
Michael Ludwig
4bf964602a Update SkCanvas' experimental SkiaRenderer API
This lifts the temporary functions in SkGpuDevice into SkCanvas and
deprecates the older experimental_DrawImageSetV1 and
experimental_DrawEdgeAARect.  The new functions can handle paints and
transform batching. Internally, SkCanvas routes the old functions to the
new entry points and all device-level code is updated to handle the new
API features.

While touching all of the canvas/device/recording areas, the
experimental functions are grouped in an "EdgeAA" cluster instead of being
separated into the image category and the rectangle category.

Bug: skia:8739
Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-14 14:24:11 +00:00
Mike Reed
1386b2d557 pass common SkStageRec to all effects using rasterpipeline
- shaders
- colorfilters
- mixers

Bug: skia:
Change-Id: Ife2fabd1171228ea9fb154efab3537fd0ddb4a6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200933
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-14 01:45:13 +00:00
Chris Dalton
7d6748ed13 Remove GrAAType::kMixedSamples
Our only use case for mixed samples is stencil-then-cover. This mode
is now handled by AATypeFlags::kMixedSampledStencilThenCover.

Bug: skia:
Change-Id: Id7431cf83ccb20752d1bc85c6ad41efe408e0359
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200841
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-13 18:20:21 +00:00
Mike Reed
c723b70d91 Initial add SkMixers
Just using with composeshader for now, plan to try that sort of generalization
for colorfilters and imagefilters in follow-on cls.

Bug: skia:
Change-Id: Ic9650b8ea6f6278e6bfd657e90befbf9e71f383c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198823
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 20:27:12 +00:00
Robert Phillips
570f4e51fd Always explicitly allocate except in Android Framework (take 3)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This needs the following Chrome suppression CL to land first:
https://chromium-review.googlesource.com/c/chromium/src/+/15182 (Add flag to skia/config/SkUserConfig.h to unblock Skia roll)

TBR=bsalomon@google.com
Change-Id: I3f51005ebc975ec754c2e0d2c646c0c324b02158
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200507
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 19:37:21 +00:00
Robert Phillips
2a2d732c39 Revert "Always explicitly allocate except in Android Framework (take 2)"
This reverts commit 88b93da63d.

Reason for revert: Chrome

Original change's description:
> Always explicitly allocate except in Android Framework (take 2)
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> We want:
>   Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
>   Android to never explicitly allocate and, thus, automatically never sort opLists
> 
> This cannot land until after the following Chrome CL lands:
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)
> 
> 
> Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ida481ee9833d6db366b3d315fb4e9850d7c005ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200506
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:29:43 +00:00
Robert Phillips
60dd62ba20 Revert "Always try to reduce opList splitting in DDL contexts/drawingManagers"
This reverts commit 2cce805f1f.

Reason for revert: Chrome

Original change's description:
> Always try to reduce opList splitting in DDL contexts/drawingManagers
> 
> This may get us in trouble w/ local DDL testing (since we run all our GMs through DDLs). For Chrome this shouldn't yet be a problem (since they are only using DDLs for compositing).
> 
> This does mean we're on a tight timeline to land predictive intermediate flushes before Chrome starts using DDLs for rasterization.
> 
> Change-Id: I0bb95c075cff3ee49498ff267d76c3a61d16373e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199722
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Idb2dbda1a41844b2541526d504b117fd4cd628cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200505
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:29:14 +00:00
Robert Phillips
692147fccd Revert "Temporarily re-add GrContextOptions::fExplicitlyAllocateGPUResources for Fuchsia"
This reverts commit 13c0f77455.

Reason for revert: See if blocking Chrome roll
Original change's description:
> Temporarily re-add GrContextOptions::fExplicitlyAllocateGPUResources for Fuchsia
> 
> Change-Id: I534f47cedf71cc1bdff4c9ad3cc98670228da118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200461
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Idac9b7f824e23c11617a3281a27e6ae1531866c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200501
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 16:11:12 +00:00
Robert Phillips
2cce805f1f Always try to reduce opList splitting in DDL contexts/drawingManagers
This may get us in trouble w/ local DDL testing (since we run all our GMs through DDLs). For Chrome this shouldn't yet be a problem (since they are only using DDLs for compositing).

This does mean we're on a tight timeline to land predictive intermediate flushes before Chrome starts using DDLs for rasterization.

Change-Id: I0bb95c075cff3ee49498ff267d76c3a61d16373e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199722
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 15:37:20 +00:00
Robert Phillips
13c0f77455 Temporarily re-add GrContextOptions::fExplicitlyAllocateGPUResources for Fuchsia
Change-Id: I534f47cedf71cc1bdff4c9ad3cc98670228da118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200461
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 15:18:50 +00:00
Brian Salomon
d0e1ceffcc Revert "Reintroduce deinstantiate lazy proxy types and use for promise images."
This reverts commit 8b40ac35b2.

Reason for revert: breaks viz_unittests

Original change's description:
> Reintroduce deinstantiate lazy proxy types and use for promise images.
> 
> This reverts a fraction of b2c5dae65d to
> restore the deinstantiate lazy proxy type, supporting implementation,
> and tests.
> 
> Use them for promise images to avoid thread safety issues for promise
> image resources. Makes promise image instantiation callbacks do a thread
> safe unref of their fulfilled GrTexture in GrResourceCache. The
> GrResourceCache mechanism for receiving unref messages is extended to
> allow multiple pending unrefs. All this is new.
> 
> 
> Bug: skia:8800
> Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Iba960efba4290a284294c62d0470ad7e932c174a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-12 13:37:21 +00:00
Robert Phillips
88b93da63d Always explicitly allocate except in Android Framework (take 2)
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.

We want:
  Flutter and Chrome to always explicitly allocate but not sort opLists outside of DDLs
  Android to never explicitly allocate and, thus, automatically never sort opLists

This cannot land until after the following Chrome CL lands:

https://chromium-review.googlesource.com/c/chromium/src/+/1516096 (Disable opList sorting within Skia)


Change-Id: Ic7d6a1a77a08f2fe42324773f62cccf8175ab3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199931
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-12 13:25:28 +00:00
Brian Osman
e938c92fe7 Remove SkToSRGBColorFilter (now unused)
This was another stop-gap color management "solution".

Bug: skia:
Change-Id: I7c0c362840dd35aad51ad8780f2dab591c42a7e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199720
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-12 13:19:28 +00:00
Brian Salomon
8b40ac35b2 Reintroduce deinstantiate lazy proxy types and use for promise images.
This reverts a fraction of b2c5dae65d to
restore the deinstantiate lazy proxy type, supporting implementation,
and tests.

Use them for promise images to avoid thread safety issues for promise
image resources. Makes promise image instantiation callbacks do a thread
safe unref of their fulfilled GrTexture in GrResourceCache. The
GrResourceCache mechanism for receiving unref messages is extended to
allow multiple pending unrefs. All this is new.


Bug: skia:8800
Change-Id: I7b1d4fea13c053b6fbbd39c0c6eaf567b8bf81f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199002
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-11 20:48:22 +00:00
Brian Osman
d0626aa0c4 Add clamped half-float pixel config to Ganesh
Currently doesn't do any clamping, but connects the new config to the
recently added SkColorType. Behavioral changes coming in future CLs.

Bug: skia:
Change-Id: I907396030c435d0aa5931063b3dc6f1b60c661af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199980
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-11 20:09:07 +00:00
Mike Reed
ca9b2082d1 rename mixer to lerp (in prep for SkMixer)
Bug: skia:
Change-Id: I55d879dd76e10c8ef9a01f2dd7cff725e8a82433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199932
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-11 19:32:31 +00:00
Robert Phillips
d40dc3f81b Revert "Always explicitly allocate except in Android Framework"
This reverts commit e157745dfc.

Reason for revert: Too exciting

Original change's description:
> Always explicitly allocate except in Android Framework
> 
> This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.
> 
> 
> Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Icb097844de6db92e8151c81616a758837ecd9dfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199929
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 18:41:22 +00:00
Robert Phillips
e157745dfc Always explicitly allocate except in Android Framework
This will turn on explicit allocation (w/o opList sorting) in Chrome. It leaves the old allocation system in place in Android Framework and some of Skia's older bots.


Change-Id: Idc02985e52f074894a251c7335ef00b009c72ccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199725
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 17:22:31 +00:00
Greg Daniel
387ec9ae82 Make vulkan GrBackendFormats with ycbcr external texture types.
Bug: skia:
Change-Id: I58b5cc2a3e03404f05de9644eb4e459a7a9a9ebb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199001
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-11 14:01:20 +00:00
Robert Phillips
0a22ba84e0 Add kIdentity_SkYUVColorSpace
This utility color space just maps Y to R, U to G and V to B when flattening or accessing the YUV planes. Clients can then add a colorFilter to directly manipulate the YUV values.

This cannot land in Skia until the following CL lands in Chrome:

https://chromium-review.googlesource.com/c/chromium/src/+/1506004 (Update usage of Skia's SkYUVColorSpace enum to allow the addition of a new value)

Change-Id: Id9403ebbd009b45281d4d53fca52f68692d6c69f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198160
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-11 13:47:40 +00:00
Robert Phillips
56181ba452 Make DDL contexts/drawing managers always sort opLists
We want:
  DDLs to always be sorted
  Live rendering to still be sorted w/in Skia
  Live rendering to still not be sorted in Chrome and Android

Additionally, we want reduced-opList-splitting to only be enabled on some of Skia's bots.

Change-Id: I15e7d69c7e109749665a86a0169ad918c993dc77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199244
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-08 18:40:17 +00:00
Brian Osman
dbfcd92d5f Fix two SkPathRef bugs
- Transforming a path in place wasn't updating the gen ID of the path
- Transforming a path into another (uniquely held) path wasn't calling
  gen ID change listeners.

Bug: skia:
Change-Id: I9e244725d9bd5776d203ce6b12698cee09d0b714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199003
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-07 22:59:28 +00:00
Chris Dalton
d7291ba7a1 Restore support for multisample locations
Bug: skia:
Change-Id: I971455867e54d431cc1094fca041f773f78748ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196218
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-07 22:00:48 +00:00
Ethan Nicholas
858feccb58 Got RelaxedPrecision decorations working again in SPIR-V, and removed
no-longer-needed old-style precision handling code.

Bug: skia:8829
Change-Id: I72fc2ee2a305c9c72a3efa92dd44d18239eabaf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198169
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-03-07 19:56:59 +00:00
Brian Osman
1132f74e11 Add F16Norm support to a few more pixmap helpers
Bug: skia:
Change-Id: I86fd67a792ddfc456e8dd553d9012ed9bc9101f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198822
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-07 19:33:19 +00:00
Heather Miller
3b45e68970 Update Skia milestone to 75
Bug: skia:
Change-Id: I5f682b3685eb68f36e36bf3581d068069af67ba4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198604
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-03-07 16:36:39 +00:00
Brian Salomon
88b8d1124b Revert "Distinguish between "flushed" and "finished" idle state callbacks on GrTexture."
This reverts commit 9ac0407006.

Reason for revert: Breaking DDL Win10 skpbench bot

Original change's description:
> Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
> 
> This is necessary to convert the promise image API to call Release when all
> work is flushed and Done when all work is complete (future work).
> 
> Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
> Bug: skia:8800
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:8800
Change-Id: I5e6c4ea072beb4fb67a53d2ea2b007a7d201799d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198603
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-07 15:47:59 +00:00
Brian Salomon
d716d4402a Revert "Change promise image contract to for when Release and Done are called."
This reverts commit c5e8e150c8.

Reason for revert: Reverting to revert 9ac0407006 https://skia-review.googlesource.com/c/skia/+/197163


Original change's description:
> Change promise image contract to for when Release and Done are called.
> 
> Now Release is called when all work related to the SkImage is flushed
> and Done is called when it is finished on the GPU in Vulkan. In GL they
> are still both called back-to-back after flushing.
> 
> Bug: skia:8800
> Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I13e8211d89ed1b7694c2d7734eeaaf4ba9ad410a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-07 15:23:41 +00:00
Brian Salomon
c5e8e150c8 Change promise image contract to for when Release and Done are called.
Now Release is called when all work related to the SkImage is flushed
and Done is called when it is finished on the GPU in Vulkan. In GL they
are still both called back-to-back after flushing.

Bug: skia:8800
Change-Id: I990be7b9ebef8411590afd860ef40511fb5fee32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198165
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-07 13:43:59 +00:00
Florin Malita
34336e3633 Make SkCubicMap immutable
Drop setter, only keep the parameterized constructor.

Change-Id: I31517df23688b8bd7485bf70c9c055cd1c87edcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198245
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-03-06 22:55:08 +00:00
Florin Malita
93092ff457 Make SkCubicMap public
Bug: skia:8803
Change-Id: I3aa0814d538d95dc3a5a1034993b823d2151ab85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193961
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-06 19:58:28 +00:00
Greg Daniel
b085fa9c8c Add ddl support to drawing to wrapped vulkan secondary command buffers.
Bug: skia:
Change-Id: I3ddb6b1e923b8c1733b6a0e219efffa36e665fa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/189282
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-06 14:47:26 +00:00
Herb Derby
a00da61c5d Pointer to GrStrikeCache on GrTextBlob
This will allow all the glyph drawing closures to live on the
GrTextBlob.

Other cleanup
* Rename glyphCache things to grStrikeCache.

Change-Id: I03e0353a1434230086a08184221272f1e5751ae6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197244
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-05 21:13:56 +00:00
Brian Salomon
9ac0407006 Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
This is necessary to convert the promise image API to call Release when all
work is flushed and Done when all work is complete (future work).

Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:00 +00:00
Brian Salomon
eb716bde99 Remove legacy promise image APIs
Change-Id: Ied33a6b57b776aaa91ec4ce0ccf668b22c317a70
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197656
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 14:23:03 +00:00
Brian Salomon
1c1c666382 Default implementation of onSetRelease() on GrSurface
Change-Id: I96ca2a8372d0748b56d5048ea294d7e2be80d22a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197040
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-05 13:24:52 +00:00
Brian Salomon
b2c5dae65d Simplify promise image lazy instantiation callbacks.
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.

This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.

The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.

Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 13:18:22 +00:00
Chris Dalton
4c56b03cfd Drop support for GL_EXT_raster_multisample
We had only used this extension in conjunction with
GL_NV_framebuffer_mixed_samples to draw directly to the framebuffer.
However, it's faster and higher quality to just use our own analytic
AA if we can draw directly to the framebuffer.

It might have been interesting to fake mixed samples using
GL_EXT_raster_multisample and PLS together, but those two extensions
don't appear to ever exist together.

Bug: skia:
Change-Id: Iea489cb0e03fc55aa64d3ea7fccc61b539cc461e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197082
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 11:35:21 +00:00
Greg Daniel
b6c15babd5 Add API for creating SkImage from AHB while uploading data to it.
Bug: skia:
Change-Id: I893b511450df7f15bdde202fe01ce223ea2294a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195366
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-04 21:59:12 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same.  Next steps are to see if we can keep it clamped to [0,1].

Switched a few switches away from default to exhaustive.

Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().

Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.

Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-04 21:49:07 +00:00
Greg Daniel
bae712104d Add flush call to take access type, flags, and semaphore.
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-02 03:45:36 +00:00
Mike Reed
011d166d37 Move responsibility to onMakeContext for device colorspace decision
Prior to this CL, we always used raster-pipeline if the device had a
colorspace. In this CL, we defer to individual shaders to decide if they can still
use the legacy path (onMakeContext).

The motivation is purely performance (and perhaps short-term backwards
compat): the legacy blits are usually faster, so staying in them
(as long as we still draw correctly) is preferable.

Causes some (mostly unimportant) rebaselines, esp. around bilerp, as the
rasterpipeline does a much better (but slower) job of it, and now we will
use the legacy bilerp more often.

Bug: skia:8793
Change-Id: I1e7e482a863a1a09ffef86a87e2aa9a4a8d1b9b5
Reviewed-on: https://skia-review.googlesource.com/c/195888
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-28 22:50:02 +00:00
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Nico Weber
0af08136f6 skia: Fix -Wextra-semi warnings in non-dcheck builds.
Use SkDEBUGCODE(...;) instead of SkDEBUGCODE(...);

clang-format has trouble formatting the new spelling, but
it's already commonly used in skia, and if you have something
SkDEBUGCODE instead of just checking `#if SK_DEBUG` then
there isn't all that much you can do.

(You could make SkDEBUGCODE() insert a static_assert(true, "")
at the end to eat semicolons after it, but that's also
a bit gross. And many SkDEBUGCODE()s already put the ; inside
the parens.)

Bug: chromium:926235
Change-Id: I57bc800309283b7206082d8a7acc4b462a3b4cfa
Reviewed-on: https://skia-review.googlesource.com/c/196421
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
2019-02-28 18:54:50 +00:00
Michael Ludwig
1433cfd7c4 Reland "Add general quad API to SkGpuDevice"
This reverts commit 24adb3a356.

Reason for revert: fixes SkGpuDevice extraction when running gbr configs in dm.

Original change's description:
> Revert "Add general quad API to SkGpuDevice"
>
> This reverts commit 339e1cc8d4.
>
> Reason for revert: compositor GM breaks dm on windows
>
> Original change's description:
> > Add general quad API to SkGpuDevice
> >
> > Heavily refactors SkGpuDevice's internal texturing code in an attempt
> > to consolidate entry points for drawing an image. Helps lay the ground
> > work for eventually implementing bitmap tiling with per-edge AA.
> >
> > Bug: skia:
> > Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> > Reviewed-on: https://skia-review.googlesource.com/c/191571
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/195889
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I667eb5b4d1253b050670a64de9f0aa70f4df3a5e
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/196160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-02-28 18:44:20 +00:00
Mike Reed
31cc6d7917 utility to check if floats are [0...1]
Bug: skia:
Change-Id: I9bab3ff73d3934786d7457c4b1bcf67d01c653f3
Reviewed-on: https://skia-review.googlesource.com/c/196060
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-27 21:43:31 +00:00
Mike Klein
e9fc58663e mark more methods inline
Since these are all already static, it doesn't have any real functional
impact in terms of linking or codegen.  But it does supress unused
function warnings in compilation units that don't use everything.

Add a new SI boilerplate macro to go along with SINT and SIT.

Change-Id: If2c09951b7453338dd20a3a88e3abbee5eefcd27
Reviewed-on: https://skia-review.googlesource.com/c/195921
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-02-27 20:27:10 +00:00
Mike Klein
41b995c4fb specialize if_then_else(int4,float4,float4)
Add SSE, SSE4.1, and NEON specializations.

The if_then_else() unit tests in SkVxTest.cpp should cover this.

I had to give up on my dream of not using Skia headers for now.  There's
really no good way of knowing whether we've got SSE4.1 support in MSVC
except when we explicitly define SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41.

This refactor to use SK_CPU_SSE_LEVEL let MSVC point out a slight
ordering problem that would cause an infinite loop calling any of
the specializions like sqrt(float2).  I believe moving them after
the float4 specializations will fix that.

Change-Id: I83639f378a182716d1b37e92b6d725472698f874
Reviewed-on: https://skia-review.googlesource.com/c/195920
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-27 20:12:20 +00:00
Michael Ludwig
24adb3a356 Revert "Add general quad API to SkGpuDevice"
This reverts commit 339e1cc8d4.

Reason for revert: compositor GM breaks dm on windows

Original change's description:
> Add general quad API to SkGpuDevice
> 
> Heavily refactors SkGpuDevice's internal texturing code in an attempt
> to consolidate entry points for drawing an image. Helps lay the ground
> work for eventually implementing bitmap tiling with per-edge AA.
> 
> Bug: skia:
> Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> Reviewed-on: https://skia-review.googlesource.com/c/191571
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/195889
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-27 19:42:31 +00:00
Michael Ludwig
339e1cc8d4 Add general quad API to SkGpuDevice
Heavily refactors SkGpuDevice's internal texturing code in an attempt
to consolidate entry points for drawing an image. Helps lay the ground
work for eventually implementing bitmap tiling with per-edge AA.

Bug: skia:
Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
Reviewed-on: https://skia-review.googlesource.com/c/191571
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-27 19:07:20 +00:00
Ben Wagner
ff84d8a900 SkTypeface::openStream to return smart pointer.
Change-Id: I2c936510e13561fcc9fd8343d5ab9f18c28c8340
Reviewed-on: https://skia-review.googlesource.com/c/195371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-27 14:08:09 +00:00
Brian Salomon
65cb3749fe Remove legacy types/methods from SkDeferredDisplayList recorder.
Change-Id: I7a9810e14734262ee608444bd9308bebfb788a8d
Reviewed-on: https://skia-review.googlesource.com/c/195364
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2019-02-26 18:40:55 +00:00
Stan Iliev
cb58060404 Pass render target VkImage in GrVkDrawableInfo
Test: Ran CTS
Bug: b/115613038
Change-Id: I9493de41e0bfaa53436676c8eed2a4f178b6e51e
Reviewed-on: https://skia-review.googlesource.com/c/186400
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-02-26 17:07:30 +00:00
Ben Wagner
4212a7d948 SkTypeface::onOpenStream to return unique_ptr.
This moves the smart pointer use up one more level in preparation for
changing SkTypeface::openStream to return unique_ptr as well.

Change-Id: Ib8173d59e03de38b06f6e1b4e6776f1961055ae7
Reviewed-on: https://skia-review.googlesource.com/c/195121
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 22:30:04 +00:00
Leon Scroggins III
194580dc60 Reland "Treat kWEBP encode with quality=100 as lossless"
This reverts commit 22170b3178.

It was reverted due to the test breaking Google3. This includes a
workaround.

    Original change's description:
    > Treat kWEBP encode with quality=100 as lossless
    >
    > In SkEncodeImage and friends, treat quality of 100 as a lossless encode
    > when using kWEBP. This seems a good fit for the intent - which is
    > presumably to save the highest quality image. This also matches
    > Chromium's blink::ImageEncoder::ComputeWebpOptions, which treats a
    > quality of 1 (on a float scale from 0 to 1) as a lossless encode.
    >
    > FWIW, Chromium has had this behavior since
    > https://codereview.chromium.org/1937433002, in response to
    > crbug.com/523098. The goal is to "maintain sharpness to
    > match the JPEG encoder behavior (use WEBP lossless encoding)".
    >
    > Add a test to verify the new behavior. This requires making tests
    > depend on libwebp to use WebPGetFeatures, since the Skia API does not
    > provide a way to determine whether an encoded webp file was encoded
    > lossless-ly or lossily.
    >
    > Bug: skia:8586
    > Change-Id: Ie9e09c2f7414ab701d696c4ad9edf405868a716f
    > Reviewed-on: https://skia-review.googlesource.com/c/175823
    > Commit-Queue: Leon Scroggins <scroggo@google.com>
    > Reviewed-by: Derek Sollenberger <djsollen@google.com>
    > Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com, based on prior approval

Bug: skia:8586
Change-Id: I09c73f71996422f797fd9456fef5dfad9af36839
Reviewed-on: https://skia-review.googlesource.com/c/194194
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2019-02-25 18:42:22 +00:00
Leon Scroggins III
8546335d2d Allow setting an SkColorSpace on SkAnimatedImage
Add a new constructor which merges the SkISize scaledSize with the
SkImageInfo. This allows passing an SkColorSpace to the decode.

Update the test to call the new API.

Bug: b/123301872
Change-Id: I9fd89198e97ac9b8e6dc9fcfe89ed38913a0fe69
Reviewed-on: https://skia-review.googlesource.com/c/189303
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-22 18:58:05 +00:00
Robert Phillips
6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00
Brian Salomon
8cabb327e7 Make it safe to enter the cache from a GrTexture idle proc.
This fixes an issue in Chrome where Skia is calling a promise SkImage
texture release proc from ~SkImage that in turn flushes a SkSurface.
Prior to this change this caused an assert because we had already
decremented the GrTexture's ref count priot to calling the release
proc. This made the GrTexture purgeable, but the cache had not yet
been notified that the texture was purgeable and still had it in its
array of non-purgeable resources. This triggered an assert in the
cache's self-validation checks during the flush.

Now we call the release proc just prior to decrementing the ref count.
This also makes it legal to re-ref the resources from the release proc.

Bug: chromium:933526
Change-Id: I8cd921b77ca3dfe112089f9a553c1a625160d16d
Reviewed-on: https://skia-review.googlesource.com/c/194000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-22 16:12:35 +00:00
Mike Reed
aa76bc1388 update docs for backdrop
Bug: skia:
Change-Id: Ic3f7ad4b730d6aa616ec75dd6179d96327716b59
Reviewed-on: https://skia-review.googlesource.com/c/194003
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-22 16:07:25 +00:00