Commit Graph

9861 Commits

Author SHA1 Message Date
Heather Miller
6b738b588c Update Skia milestone to 81
Change-Id: If4173d0ac0028d3595f85c66182a22cabf444955
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258216
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-12-05 15:52:12 +00:00
Greg Daniel
f0e04f0c31 Always destroy resources instead of simply "abandoning" them in Vulkan backend.
This also now requires that when using a vulkan GrContext, the backing VkDevice,
Queue, and Instance must be alive when the GrContext is first destroyed or
abandoned. Additionally any GrBackendTextures created from the GrContext must
be deleted before destroying or abandoning the GrContext.

Bug: skia:9603
Change-Id: Ibf194d2ffdcddd61e34214d7d59a2d9a33c880e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257921
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-12-05 14:45:45 +00:00
Michael Ludwig
adb12e7700 Reduce GrTextureOp size
Switches ViewCountPair to store a sk_sp<GrSurfaceProxy> instead of a
GrSurfaceProxyView. It applies the origin from the view at initialization
time and then no longer needs it. All ViewCountPairs have the same swizzle
so that is stored once at the op level instead of per entry.

Additionally, re-arranges the metadata of GrTextureOp to ensure that it
packs into an 8byte aligned field. After first switching to
GrSurfaceProxyView, the op went to 144 bytes, and each entry was 32 bytes.
After Greg's GrSwizzle shrinkage, the op went to 136 bytes and each entry
went to 24 bytes. This CL further reduces the top to 120 bytes and each
entry is 16 bytes.

Change-Id: I912864db8846affc32620f60cc7d1d17cf0654fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257919
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-12-04 21:51:50 +00:00
Brian Salomon
4e1066f248 Remove SkSize& SkSize::operator=(const SkISize&)
Having it means you cannot write:

SkSize size;
float x, y;
size = {x , y};

clang allows it but GCC does not, claiming it is ambiguous between the
implicitly generated
SkSize& SkSize::operator=(const SkSize&)
  and
SkSize& SkSize::operator=(const SkISize&)

clang gives the same error if the former is explicitly declared default.

Change-Id: I3b64436ef6aa669b3d87e7f37057c5dcb4add987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257880
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-12-04 17:36:06 +00:00
Brian Salomon
8a99a41116 Fix for 420/422 chroma subsampling of odd dimension images when
converting from YUV to RGB on GPU.

Change-Id: I872e1e85f3efccce7bf93d2f3d5f2a841b8a5b0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257680
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-12-04 16:32:40 +00:00
Stephen White
a521c962b1 Update dawn.h -> webgpu.h, dawn_cpp.h -> webgpu_cpp.h.
Also fix some compile breakages from recent Skia changes.
No changes to Skia API.

Change-Id: Ifd0b1d89fb4ea3cf1f6a7170f2f74614276364ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257877
Commit-Queue: Stephen White <senorblanco@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-12-04 15:24:16 +00:00
Mike Reed
1d15439f69 remove legacy next from iter
Change-Id: I417425bf27c154a312ab8cb7aaf150faa35a0696
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257617
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-03 16:01:20 +00:00
Mike Klein
8ebac1732c remove T*/void* union in SkTArray
Another memcpy-doesn't-activate-union-fields bug for GCC, I think.

As far as I can tell this union is completely pointless, and this is so
prehistoric git blame doesn't help. (svn blame wouldn't even.)  I don't
really want to know.

Change-Id: I5a67469337752986c6a5979d91cb56417955d019
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257445
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-12-02 22:08:29 +00:00
Mike Reed
2e3be5648a Reland "fix sense of ifdef for deprecated method"
This reverts commit b97a24a009.

Reason for revert: flag added to chrome

Original change's description:
> Revert "fix sense of ifdef for deprecated method"
> 
> This reverts commit aa98dd3d27.
> 
> Reason for revert: broke chrome, easy to add a flag there
> 
> Original change's description:
> > fix sense of ifdef for deprecated method
> > 
> > Change-Id: I32164225750b23e1cc26aa36a60feda27bbd90a8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257319
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=bungeman@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I629bbd7f04a4ac8227c62f4d05cf2cb2601900c3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257328
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com

Change-Id: If4c1e2a51fc8bc34f8053d716efea55e809967f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257378
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-02 17:45:26 +00:00
Mike Reed
b97a24a009 Revert "fix sense of ifdef for deprecated method"
This reverts commit aa98dd3d27.

Reason for revert: broke chrome, easy to add a flag there

Original change's description:
> fix sense of ifdef for deprecated method
> 
> Change-Id: I32164225750b23e1cc26aa36a60feda27bbd90a8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257319
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,kjlubick@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I629bbd7f04a4ac8227c62f4d05cf2cb2601900c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257328
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-02 16:45:39 +00:00
Mike Reed
aa98dd3d27 fix sense of ifdef for deprecated method
Change-Id: I32164225750b23e1cc26aa36a60feda27bbd90a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257319
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-02 16:17:34 +00:00
Ben Wagner
c96f5108df Reland "Replace CGFontCreate with CTFontManagerCreate."
This is a reland of f1d4f00fda

Original change's description:
> Replace CGFontCreate with CTFontManagerCreate.
>
> Replaces calls to CGFontCreateWithDataProvider with calls to
> CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
> not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
> allows the user to create CTFonts from CGFonts and introduce them to Skia.
>
> Bug: skia:4043,skia:9627
>
> Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
> TBR: reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Dominik Röttsches <drott@google.com>

Bug: skia:4043, skia:9627
Change-Id: Ic265f2ce52b816831e6402c5ffd21dac065049dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257052
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-11-27 19:42:13 +00:00
Ben Wagner
64331db0a4 Revert "Replace CGFontCreate with CTFontManagerCreate."
This reverts commit f1d4f00fda.

Reason for revert: some of the mac bots appear to be crashing

Original change's description:
> Replace CGFontCreate with CTFontManagerCreate.
> 
> Replaces calls to CGFontCreateWithDataProvider with calls to
> CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
> not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
> allows the user to create CTFonts from CGFonts and introduce them to Skia.
> 
> Bug: skia:4043,skia:9627
> 
> Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
> TBR: reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Dominik Röttsches <drott@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com,drott@google.com

Change-Id: I5dc6b476d9f2b1dbaa2e8bf95755b0bc725dad10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4043, skia:9627
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257051
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-11-27 18:52:35 +00:00
Ben Wagner
f1d4f00fda Replace CGFontCreate with CTFontManagerCreate.
Replaces calls to CGFontCreateWithDataProvider with calls to
CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
allows the user to create CTFonts from CGFonts and introduce them to Skia.

Bug: skia:4043,skia:9627

Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
TBR: reed@google.com
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Dominik Röttsches <drott@google.com>
2019-11-27 18:37:33 +00:00
Mike Reed
0ee397aa82 hide deprecated next() on SkPath::Iter
Change-Id: Ic39461ce35eae3a5eed04259ca48dfc340d48d64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256816
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 21:45:09 +00:00
Greg Daniel
ada451ca67 Return a size of 0 for external format GrSurfaces.
This fixes a case where Chrome was hitting the assert in ComputeSize that
colorSize > 0. In general this shouldn't affect our memory/budget tracking
since external textures are generally given to us as wrapped borrowed textures
so they're memory was not counted against our budget to begin with.

Change-Id: I2fd4eaaab52d9c3dc1af3a8f5b59a1b1f3c5dbb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256656
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-11-26 20:35:34 +00:00
Mike Reed
7d34dc7747 Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224.

Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 17:43:14 +00:00
Mike Reed
3e7af41224 Revert "switch to new filltype for SkPath"
This reverts commit 3a50981a83.

Reason for revert: chrome win build found compile-problem in xpsdevice

Original change's description:
> switch to new filltype for SkPath
> 
> Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iacb3566da61c2512b9bd6b7e42b592febc85e031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256530
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-26 03:34:30 +00:00
Mike Reed
3a50981a83 switch to new filltype for SkPath
Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-25 22:31:46 +00:00
Jim Van Verth
5fab90999f Revert "Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal."
This reverts commit b1edfde279.

Reason for revert: senorblanco@ is adding a WriteOnly flag which will
be more appropriate for this functionality.

Original change's description:
> Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
> 
> This provides a way to indicate that a Metal RenderTarget, and in
> particular a RenderTargetProxy, is framebufferOnly, so it can be
> restricted to certain operations.
> 
> Bug: skia:9573
> TBR: bsalomon@google.com
> Change-Id: I733fae2fce402c375534889346255afe28a57944
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

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

Bug: skia:9573
Change-Id: Ide775fbbe81114c10fe81e7faa517c20784e8498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256496
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-11-25 21:49:46 +00:00
Brian Salomon
e21af50dc6 Test texture domain effect with local matrix.
Add a common way to make rect op for testing that uses a GP with a local
matrix.

Change-Id: I958d1230bd5067b2e4b60fcd374e2f7718681e43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255782
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-22 22:37:33 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Robert Phillips
34cea00bdf Add utility for creating test-only GrProgramInfos
This is complete overkill for what these GMs require but it will help centralize things.

Change-Id: If30cbd9a9cfc8fcc1fe96fc9ca1b4cb17cdeb4bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255824
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-22 19:01:14 +00:00
Jim Van Verth
b1edfde279 Rename GLRTFBOIDIs0 to WrapsSwapchainSurface and use for Metal.
This provides a way to indicate that a Metal RenderTarget, and in
particular a RenderTargetProxy, is framebufferOnly, so it can be
restricted to certain operations.

Bug: skia:9573
TBR: bsalomon@google.com
Change-Id: I733fae2fce402c375534889346255afe28a57944
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255783
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-22 15:33:33 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
Mike Reed
0dacc6b7d3 Revert "Use flat version of path-direction enum"
This reverts commit e0fbe94351.

Reason for revert: need to add guard flag to flutter

Original change's description:
> Use flat version of path-direction enum
> 
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-21 22:10:32 +00:00
Mike Reed
e0fbe94351 Use flat version of path-direction enum
Bug: skia:9663
Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-21 21:45:20 +00:00
Brian Osman
417d299d44 Fix windows DLL builds with shaper included
Change-Id: I7adc1e01f4f9cec56e53e620ba4d04eae61f0b9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254899
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-11-19 14:50:12 +00:00
Robert Phillips
d4fb7c7b14 Rename opPODAllocator to recordTimeAllocator
Hopefully this is a better name. "POD" is no longer accurate since we are storing GrPipeline's in this arena.

Bug: skia:9455
Change-Id: I610267633088b0af4f0cbb36f479bf5eb6c6d0cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254992
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-18 16:12:38 +00:00
Mike Reed
a2b3b9efb8 Expose the owning surface to a canvas?
Handy if you want to flush, or otherwise understand the underlying buffer(s).

Change-Id: I3d6610695c8603232192b26c687c6c74512165dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254803
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-11-15 21:48:32 +00:00
Mike Reed
a657b0c590 trim out unneeded references to SkString
Change-Id: I01259b685859e2d95e4b87c0f611ccc074bd5229
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254807
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-15 21:01:01 +00:00
Mike Reed
2319b803c2 remove unused (by clients) SkMultiPictureDraw
More cleaning to do if we like this idea...

Change-Id: I608143db085911565dd5f5426f7ee6436ec58cdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254680
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-15 18:18:36 +00:00
Mike Reed
c1c4634dcb add some api helpers (extracted from different CL)
See https://skia-review.googlesource.com/c/skia/+/253996/

Change-Id: I06cb3cb6dc8c088f139e6f2a78e43069c2609ff0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-14 22:40:22 +00:00
Mike Klein
8c1e0effbb sketch out structure for ops with immediates
Lots of x86 instructions can take their right hand side argument from
memory directly rather than a register.  We can use this to avoid the
need to allocate a register for many constants.

The strategy in this CL is one of several I've been stewing over, the
simplest of those strategies I think.  There are some trade offs
particularly on ARM; this naive ARM implementation means we'll load&op
every time, even though the load part of the operation can logically be
hoisted.  From here on I'm going to just briefly enumerate a few other
approaches that allow the optimization on x86 and still allow the
immediate splats to hoist on ARM.

1) don't do it on ARM
A very simple approach is to simply not perform this optimization on
ARM.  ARM has more vector registers than x86, and so register pressure
is lower there.  We're going to end up with splatted constants in
registers anyway, so maybe just let that happen the normal way instead
of some roundabout complicated hack like I'll talk about in 2).  The
only downside in my mind is that this approach would make high-level
program descriptions platform dependent, which isn't so bad, but it's
been nice to be able to compare and diff debug dumps.

2) split Op::splat up
The next less-simple approach to this problem could fix this by
splitting splats into two Ops internally, one inner Op::immediate that
guantees at least the constant is in memory and is compatible with
immediate-aware Ops like mul_f32_imm, and an outer Op::constant that
depends on that Op::immediate and further guarantees that constant has
been broadcast into a register to be compatible with non-immediate-aware
ops like div_f32.  When building a program, immediate-aware ops would
peek for Op::constants as they do today for Op::splats, but instead of
embedding the immediate themselves, they'd replace their dependency with
the inner Op::immediate.

On x86 these new Ops would work just as advertised, with Op::immediate a
runtime no-op, Op::constant the usual vbroadcastss.  On ARM
Op::immediate needs to go all the way and splat out a register to make
the constant compatible with immediate-aware ops, and the Op::constant
becomes a noop now instead.  All this comes together to let the
Op::immediate splat hoist up out of the loop while still feeding
Op::mul_f32_imm and co.  It's a rather complicated approach to solving
this issue, but I might want to explore it just to see how bad it is.

3) do it inside the x86 JIT
The conceptually best approach is to find a way to do this peepholing
only inside the JIT only on x86, avoiding the need for new
Op::mul_f32_imm and co.  ARM and the interpreter don't benefit from this
peephole, so the x86 JIT is the logical owner of this optimization.
Finding a clean way to do this without too much disruption is the least
baked idea I've got here, though I think the most desirable long-term.

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_SKVM_BLITTER,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_USE_SKVM_BLITTER
Change-Id: Ie9c6336ed08b6fbeb89acf920a48a319f74f3643
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254217
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-11-12 20:17:55 +00:00
Brian Salomon
c75bc031ef Clamp RGB outputs of GrYUVtoRGBEffect.
The matrices we're using can produce very slightly out of range color
channels. This gives surprising results when in shader blending is used
for color burn and color dodge. After this change we clamp the RGB
values to 0..1 before applying premul.

Adds a GM modeled on a blink layout test that shows the problem using
SkImageMakeFromYUVAPixmaps.


Bug: skia:9619


Change-Id: I446d39763a7f5a2f7c5f61d94d163927d851baa3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253879
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-11 20:04:15 +00:00
skia-autoroll
4a09815d8e Roll skia/third_party/skcms e51ca8b81987..0e5f77218153 (1 commits)
https://skia.googlesource.com/skcms.git/+log/e51ca8b81987..0e5f77218153

git log e51ca8b81987..0e5f77218153 --date=short --no-merges --format='%ad %ae %s'
2019-11-11 brianosman@google.com Move ICCTag struct and GetTag functions to skcms_internal.h

Created with:
  gclient setdep -r skia/third_party/skcms@0e5f77218153

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skcms-skia-autoroll
Please CC halcanary@google.com,mtklein@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel

Bug: None
Change-Id: If85f40fa8110589cc76890bb477ac53375d21b75
TBR=halcanary@google.com,mtklein@google.com
TBR=halcanary@google.com,mtklein@google.com
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253908
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-11 17:59:31 +00:00
skia-autoroll
2565a6db53 Roll skia/third_party/skcms b118cb0ef477..e51ca8b81987 (1 commits)
https://skia.googlesource.com/skcms.git/+log/b118cb0ef477..e51ca8b81987

git log b118cb0ef477..e51ca8b81987 --date=short --no-merges --format='%ad %ae %s'
2019-11-11 brianosman@google.com Add CHAD and WTPT functions to public API

Created with:
  gclient setdep -r skia/third_party/skcms@e51ca8b81987

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skcms-skia-autoroll
Please CC halcanary@google.com,mtklein@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel

Bug: None
Change-Id: I68b587e2ecb88a60c3eb68b0dd8231d262b7a263
TBR=halcanary@google.com,mtklein@google.com
TBR=halcanary@google.com,mtklein@google.com
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253902
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2019-11-11 17:23:01 +00:00
Mike Klein
b9f208817c convert SkVMBlitter over to floats
As we've learned there's not much advantage to working directly in i32
ops over f32... it's the same size, kind of a wash speed-wise, and f32
supports all operations we want where i32 supports only a subset.  If we
really want to go fast, we need to focus on i16 operations, which are
both significantly faster and operate on twice as much data at a time.

(This is the same split as SkRasterPipeline, highp f32 and lowp i16.)

For now port everything to f32, with i16 to follow, perhaps much later.

There's a little here we could spin off to land first (uniformF, better
unpremul) but I think it might be easiest to land all at once.

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_SKVM_BLITTER
Change-Id: I6fa0fd2031a0de18456abf529cc5b0d8137ecbe0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253704
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-08 19:29:06 +00:00
Mike Klein
b2ab7d15d3 add SkColorTypeIsNormalized()
This centralizes the logic for whether a color type is normalized.

The change in SkRasterPipelineBlitter is minor, only now properly
treating kR16G16_float_SkColorType as unnormalized.

The change in SkColorSpaceXformSteps is more extreme given the way
it had been written, with all the newer color types now correct.

I think I'm making the right call on kA16_float_SkColorType?

Are there equivalent sites to update in Ganesh?

Change-Id: I32a40b31b86c5fde0dea2528122a4deda91c5545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253668
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-08 17:51:45 +00:00
Kevin Lubick
47bd9f1b73 [canvaskit] Expand SkAnimatedImage
With these things exposed, I think Flutter will not need
CanvasKit to expose the very complex SkCodec API.

Change-Id: Iace1b496d1dcb8842181466e860e8f212aba7b48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253542
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-11-08 14:58:14 +00:00
Hal Canary
a1050ed2b1 SkPDF/docs: note that Sfntly subsetter is deprecated
Change-Id: I09ecee95653212268926d82739c0df3866d3a8d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253380
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-11-07 18:07:55 +00:00
Mike Klein
1cc6067757 friendly wrapper to allocate uniforms
This basically wraps up the old `uniforms` and `buf` params
into a new type that has push() and pushF() methods that return
a value you can pass directly to Builder::uniform32() and co.

I think this has uniforms about as streamlined as they can get.

Change-Id: I8f611f91b4a2d7cdb8f05ce0333669d2e3930be8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252937
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-05 21:02:34 +00:00
Mike Klein
5625412f02 unify program() and uniforms()
It's clearer and more efficient to emit uniforms
as we use them.  The pattern to look for is something like

    skvm::I32 val = p->uniform32(uniforms, buf->bytes());
    buf->push_back(fVal);

where fVal holds the actual uniform value, and val is its program
counterpart.

Switching to SkTDArray lets us use friendlier methods like bytes() and
append(N) in the effect code.

It's a lot easier to follow this way once you get used to it and much
less error-prone.  No need to split the can-we-do-it logic up from the
uniform emission, and so no chance to write logic twice that
acccidentally disagrees.

Effects now always emit uniforms when you call program(), which means we
occasionally do that twice, once when building the Key to look up cached
programs, and once again when building the program if the cache misses.
That's not that big of a deal... it reuses the same memory exactly, and
I've added some notes around the code and assertions that everything
matches up exactly.  It only happens on cache miss, so it's dwarfed by
the cost of building and JITing the program anwyay.

Change-Id: I55a9252b11b2c0cd5f7ab8ace6df5fef29342c10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252837
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-05 18:41:30 +00:00
Brian Osman
09ee112bdb Reland "Fully embrace skcms types in SkColorSpace API"
This reverts commit 6af9b1c673.

Change-Id: I7954951497e57475ab6f1c7f946b47aa17f1ac8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252817
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-11-05 18:36:26 +00:00
Brian Salomon
b3bd86405b Cleanup kGray_8 readback.
Rm unused function SkColorTypeIsGray.

Expect kGray_8 readback to work in tests.

Bug: skia:8962

Change-Id: Iad9d2be3e0a2e594e62dc681b79c59e0a833116a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245162
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-05 18:36:25 +00:00
Mike Klein
746acf1ebc add color filter support
- move some helpers to central spot
  - add a color filter interface, the same as shader without (x,y)
  - implement matrix color filter (pretty naively)
    and color filter shader (pretty reasonably)
  - extend GM to demonstrate

The new blitters with color filters are failing to JIT because they're
running out of registers.  (They still work fine on the interpreter of
course.)  I'm going to take a look to see whether there's something I
can do either in the effect program() code or in the optimizer to
rearrange to get it to fit and JIT.

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_SKVM_BLITTER
Change-Id: Ibdc1a5e7b9e7a14778efba583b7821bcd4f3062a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252788
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-05 18:15:43 +00:00
Robert Phillips
6af9b1c673 Revert "Fully embrace skcms types in SkColorSpace API"
This reverts commit 701522798a.

Reason for revert: Maybe blocking the Android roll

Original change's description:
> Fully embrace skcms types in SkColorSpace API
> 
> Remove the SkMatrix44 getter entirely.
> 
> Change-Id: I25bfe68a7a9b21d8a8696415b517cb79fc2d7a94
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252596
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: Ic277d54d4ac8c84f00405946c927a3aee4e33068
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252801
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-05 15:03:49 +00:00
Brian Osman
701522798a Fully embrace skcms types in SkColorSpace API
Remove the SkMatrix44 getter entirely.

Change-Id: I25bfe68a7a9b21d8a8696415b517cb79fc2d7a94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252596
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-04 21:22:38 +00:00
Michael Ludwig
cc836871cb Make SkBlendMode_AsCoeff() public
Change-Id: Ie704f0f83b1034ff8ee1a5d3cd194e555cae20a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252600
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-11-04 20:41:56 +00:00