We were always testing the CPU backend.
Bug: skia:9582
Change-Id: I25ff1dc151c1be8a31ab09008393430a1fa85221
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251457
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 1e0f2f389f.
Reason for revert: I suspect this is blocking the Chrome roll
Original change's description:
> Implement refPinnedTextureProxy for SkImage_Lazy.
>
> Creating a cross-context texture exposed a hole in our lazyproxy
> texture generation. Despite having a wrapped texture we were falling
> back to drawing in tiled mode, which is incorrect. Filling in these
> methods allows us to draw with the wrapped texture.
>
> Bug: skia:9562
> Change-Id: Ia26c5d75b202aefdf720e6d1f7a201af23e40676
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251214
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,robertphillips@google.com
Change-Id: I2dd6f2cbe13dd3ac1f65890da366171572fb84e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9562
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251356
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Creating a cross-context texture exposed a hole in our lazyproxy
texture generation. Despite having a wrapped texture we were falling
back to drawing in tiled mode, which is incorrect. Filling in these
methods allows us to draw with the wrapped texture.
Bug: skia:9562
Change-Id: Ia26c5d75b202aefdf720e6d1f7a201af23e40676
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251214
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: chromium:1016183
Change-Id: I2fa470db3690f79d83fd17b01e421e7457f7c725
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251246
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Chrome is now using the newer version.
Bug: skia:8962
Change-Id: I8c38bde63e1e032281d19b0cc7cb8cf301061a9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251198
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reading back pixel values from protected memory into cpu memory is
not allowed. This CL adds early returns so they are not attempted.
Bug: skia:9016, fuchsia:38648
Change-Id: Icc0b51a62e87b7aebd0e7cb2a061fea084e7f754
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a reland of 598741667a
Original change's description:
> Enable Programs (formerly GLPrograms) test for other APIs
>
> Bug: skia:9365
> Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Boren <borenet@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:9365
Change-Id: I94db6cb2b1465edbb2e6d32708b835a76e12cbc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250016
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Use `extra_cflags=["-DSK_CAPTURE_DRAW_TEXT_BLOB"]` to enable.
Change-Id: I1d6db478ee91696cdce090647b889c17a83a2718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250259
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Implementation is shared with with AsyncReadPixels.
Change-Id: If40705e96cc7fb073ab6024ab59819784c8be0ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244717
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
These names are more appropriate after:
https://skia-review.googlesource.com/c/skia/+/241356 (Always create an approx-size texture for approx-fit proxies))
Note that this CL does have one substantive change in GrCoordTransform::hasSameEffectAs where we use our knowledge of the size at which the backing stores will be allocated to remove a sly usage of GrSurfaceProxy::underlyingUniqueID.
Change-Id: Ibbb8cb23c4503f267abbdf4794610f3262a6f515
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250257
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Rewrite program instructions so that each value becomes available as
late as possible, just before it's used by another instruction. This
reorders blocks of instructions to reduce them number of temporary
registers in flight.
Take this example of the sort of program that we naturally write,
noting the registers needed as we progress down the right:
src = load32 ... (1)
sr = extract src ... (2)
sg = extract src ... (3)
sb = extract src ... (4)
sa = extract src ... (4, src dies)
dst = load32 ... (5)
dr = extract dst ... (6)
dg = extract dst ... (7)
db = extract dst ... (8)
da = extract dst ... (8, dst dies)
r = add sr dr (7, sr and dr die)
g = add sg dg (6, sg and dg die)
b = add sb db (5, sb and db die)
a = add sa da (4, sa and da die)
rg = pack r g ... (3, r and g die)
ba = pack b a ... (2, b and a die)
rgba = pack rg ba ... (1, rg and ba die)
store32 rgba ... (0, rgba dies)
That original ordering of the code needs 8 registers (perhaps with a
temporary 9th, but we'll ignore that here). This CL will rewrite the
program to something more like this by recursively issuing inputs only
once needed:
src = load32 ... (1)
sr = extract src ... (2)
dst = load32 ... (3)
dr = extract dst ... (4)
r = add sr dr (3, sr and dr die)
sg = extract src ... (4)
dg = extract dst ... (5)
g = add sg dg (4, sg and dg die)
rg = pack r g (3, r and g die)
sb = extract src ... (4)
db = extract dst ... (5)
b = add sb db (4, sb and db die)
sa = extract src ... (4, src dies)
da = extract dst ... (4, dst dies)
a = add sa da (3, sa and da die)
ba = pack b a (2, b and a die)
rgba = pack rg ba ... (1, rg and ba die)
store32 rgba ... (0)
That trims 3 registers off the example, just by reordering!
I've added the real version of this example to SkVMTest.cpp.
(Its 6th register comes from holding the 0xff byte mask used
by extract, in case you're curious).
I'll admit it's not exactly easy to work out how this reordering works
without a pen and paper or trial and error. I've tried to make the
implementation preserve the original program's order as much as makes
sense (i.e. when order is an otherwise arbitrary choice) to keep it
somewhat sane to follow.
This reordering naturally skips dead code, so pour one out for ☠️ .
We lose our cute dead code emoji marker, but on the other hand all code
downstream of Builder::done() can assume every instruction is live.
Change-Id: Iceffcd10fd7465eae51a39ef8eec7a7189766ba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This CL begins pulling some of the work forward into onPrePrepare.
Change-Id: If049e0662db51b465b8b82aafebeef2323bddfd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249802
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 598741667a.
Reason for revert: segfaults on Pixel bots
Original change's description:
> Enable Programs (formerly GLPrograms) test for other APIs
>
> Bug: skia:9365
> Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Eric Boren <borenet@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=borenet@google.com,jvanverth@google.com,robertphillips@google.com
Change-Id: I286c637490bb8a21c0020a8935ce4c850b98f6b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9365
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249978
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Uses SkISize instead of separate width/height variables in many places.
No functional change.
Change-Id: If87b2c57e43d810f0820c4e3c9ef8e6b8ebd10ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249886
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:9365
Change-Id: I2eeac4e628425411b0a8f9ffa94ad61d58254b77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249806
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Make it take GrImageInfo.
Change-Id: I9ec16e9b935fbe3e829b4669f715c17873a1793a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249813
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:9552
Change-Id: Ifa199048e6d38ccb28f055b77128971411203188
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249800
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This helps differentiate the SkCanvas' total CTM
(canvas transform matrix), from the device-specific transform matrix
that maps draws from local to device space.
Bug: 9545
Change-Id: I67f40d9b1bc92377bf0520fbc9245f1058e179e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249424
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit 63a3873957.
Reason for revert: fail
Original change's description:
> Reduce inputs to GrProgramDesc::Build method(s)
>
> This moves the computation of the GrStencilSettings into GrProgramDesc::Build for the Vulkan backend
>
> This makes it clear that the stencilSettings are determined by the GrProgramInfo.
>
> Note that this does change some behavior in that the number of stencil bits is now determined (and set up for) the number requested not the number actually available on the attached stencil buffer at flush time.
>
> Bug: skia:9455
> Change-Id: Ia5fa4e30e34952c1a492b8d571094abf2291b2a4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248696
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: Ib0b337c19acea8000b5592f3dfeda181fd6ef157
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249222
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This moves the computation of the GrStencilSettings into GrProgramDesc::Build for the Vulkan backend
This makes it clear that the stencilSettings are determined by the GrProgramInfo.
Note that this does change some behavior in that the number of stencil bits is now determined (and set up for) the number requested not the number actually available on the attached stencil buffer at flush time.
Bug: skia:9455
Change-Id: Ia5fa4e30e34952c1a492b8d571094abf2291b2a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248696
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of 77c53087c1
Original change's description:
> Introduce SkGlyphSourceBuffer
>
> SkGlyphSourceBuffer provides a system for taking rejected glyphs from
> one glyph drawing stage, and turns them into the source for the next stage.
> It is rarely used, so it tries to conserve memory.
>
> Change-Id: I5275ffa3e804fc494eb2f5803e0cf2d148a755f7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248260
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: Ib90508a21993b12c71ee86cbdeb51c4d4c2ec913
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249128
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
These implement select, eq_i32, lt_i32, and gt_i32 on ARMv8.
Change-Id: Ic36dda1cc425ca91700f9b120594e420ea0f560a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248970
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This reverts commit 77c53087c1.
Reason for revert: Breaks some windows builds
Original change's description:
> Introduce SkGlyphSourceBuffer
>
> SkGlyphSourceBuffer provides a system for taking rejected glyphs from
> one glyph drawing stage, and turns them into the source for the next stage.
> It is rarely used, so it tries to conserve memory.
>
> Change-Id: I5275ffa3e804fc494eb2f5803e0cf2d148a755f7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248260
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=bungeman@google.com,herb@google.com
Change-Id: I4270d092f8daba3dddcadd6abbed10f14bf57490
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249077
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
SkGlyphSourceBuffer provides a system for taking rejected glyphs from
one glyph drawing stage, and turns them into the source for the next stage.
It is rarely used, so it tries to conserve memory.
Change-Id: I5275ffa3e804fc494eb2f5803e0cf2d148a755f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248260
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
90% of this CL is just renaming. The only two substantive changes are:
holding a GrTexture* (rather than a GrGpuResource*) in the GrTextureFreedMessage (this avoids the downcast)
adding the abandoned() checks to the two GrContext::purgeUnlockedResources methods (this prevents accesses of the message queue)
Bug: 1011368, 1014993
Change-Id: Ifff3842f7802add6b7cd34595578369543698ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Brings over skcms' encoding scheme, etc.
Change-Id: Ib8abec911acd1c50df3b201b4a9bde01b1cb123b
Bug: chromium:960620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249000
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Most hoisted values are used in the loop body (and that's really the
whole point of hoisting) but some are just temporaries to help produce
other hoisted values. This used_in_loop bit helps us distinguish the
two, and lets us recycle registers holding temporary hoisted values not
used in the loop.
The can-we-recycle logic now becomes:
- is this a real value?
- is it time for it to die?
- is it either not hoisted or a hoisted temporary?
The set-death-to-infinity approach for hoisted values is now gone. That
worked great for hoisted values used inside the loop, but was too
conservative for hoisted temporaries. This lifetime extension was
preventing us from recycling those registers, pinning enough registers
that we run out and fail to JIT.
Small amounts of refactoring to make this clearer:
- move the Instruction hash function definition near its operator==
- rename the two "hoist" variables to "can_hoist" for Instructions
and "try_hoisting" for the JIT approach
- add ↟ to mark hoisted temporaries, _really_ hoisted values.
There's some redundancy here between tracking the can_hoist bit, the
used_in_loop bit, and lifetime tracking. I think it should be true, for
instance, that !can_hoist && !used_in_loop implies an instruction is
dead code. I plan to continue refactoring lifetime analysis (in
particular reordering instructions to decrease register pressure) so
hopefully by the time I'm done that metadata will shake out a little
crisper.
Change-Id: I6460ca96d1cbec0315bed3c9a0774cd88ab5be26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248986
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This is a reland of 52435503e9
with better checks for when we should expect JIT and not.
Original change's description:
> mark which SkVM tests should JIT or not
>
> Most of these tests converted over to test_interpreter_only()
> are failing to JIT because of unimplemented instructions. No
> bug there, just TODOs.
>
> But SkVM_hoist _should_ be JITting. A while back I landed a CL
> that messed with value lifetimes that prevents it from JITting.
> Will be using this as a regression test to fix that bug.
>
> Change-Id: Id2034f6548a45ed9aeb9ae3cbb24d389cad7dc60
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248980
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
Cq-Include-Trybots: skia.primary:Test-Android-Clang-NVIDIA_Shield-CPU-TegraX1-arm64-Release-All-Android,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE41,Test-Mac10.13-Clang-VMware7.1-CPU-AVX-x86_64-Debug-All-NativeFonts,Test-Mac10.14-Clang-VMware7.1-CPU-AVX-x86_64-Debug-All-NativeFonts
Change-Id: Id7bde7e879649e435fa424a9c9d6c51a31afd5e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248990
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 52435503e9.
Reason for revert: lots of bots can't JIT, duh...
Original change's description:
> mark which SkVM tests should JIT or not
>
> Most of these tests converted over to test_interpreter_only()
> are failing to JIT because of unimplemented instructions. No
> bug there, just TODOs.
>
> But SkVM_hoist _should_ be JITting. A while back I landed a CL
> that messed with value lifetimes that prevents it from JITting.
> Will be using this as a regression test to fix that bug.
>
> Change-Id: Id2034f6548a45ed9aeb9ae3cbb24d389cad7dc60
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248980
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com,ethannicholas@google.com
Change-Id: Ieea4b06f0d32249e3da56c6810d3c45c2abf2689
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248989
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Most of these tests converted over to test_interpreter_only()
are failing to JIT because of unimplemented instructions. No
bug there, just TODOs.
But SkVM_hoist _should_ be JITting. A while back I landed a CL
that messed with value lifetimes that prevents it from JITting.
Will be using this as a regression test to fix that bug.
Change-Id: Id2034f6548a45ed9aeb9ae3cbb24d389cad7dc60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248980
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Herb Derby <herb@google.com>
As of revision 7924d9a4ae (https://skia-review.googlesource.com/c/skia/+/222277), SkTextBlob::getIntercepts no longer considers each glyph's vertical offset. So getIntercepts will only work properly if each glyph has a vertical offset of 0. This patch restores the original behavior of offsetting the bounds from each glyph's position.
Without this fix, Firefox has no way to implement proper intercepts for underlining decorations when glyphs are offset...
Change-Id: I06fc4b63bd57c9d70e3b07a95ead69f3caa8b33a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248724
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Lee Salzman <lsalzman@mozilla.com>
This change also allows for the remove of GrPixelConfigIsOpaque function.
Bug: skia:6718
Change-Id: I7e7b70f02d911eda67640d648fb6348091e0f55d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248698
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
I'm gearing up to add a GrBackendFormat to GrPrimitiveProcessor::TextureSampler so this CL just reduces the API surface area I'll need to alter.
The GrFragmentProcess::TextureSampler changes just keep it aligned with its "twin".
Change-Id: Ia9ece03ca76b4f6c8ebdaf0e0ba0061ecde6c5f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248558
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:6718
Change-Id: I4d9c31bc0ca42a80e652de29462531587efef031
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248257
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This improves the encapsulation of the GrProgramInfo class.
Bug: skia:9455
Change-Id: Ic241ba4a2c2edea3e774522065371e5ed8cc2da3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247438
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Perspective glyphs can vary in screen size so it's unclear which SDF
level is best, and even if we choose one for an entire subrun it's
possible that a given glyph will have artifacts if it's too big.
Instead we fall back to paths unless specifically requested to
support perspective SDF.
Bug: skia:9515
Change-Id: I75ac1d60f2eaa0e63de201b5db36fe0485fff463
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247398
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This reverts commit 76826fc91c.
Reason for revert: Missing some characters
Original change's description:
> Draw perspective text as paths.
>
> Perspective glyphs can vary in screen size so it's unclear which SDF
> level is best, and even if we choose one for an entire subrun it's
> possible that a given glyph will have artifacts if it's too big.
> Instead we fall back to paths.
>
> Bug: skia:9515
> Change-Id: I88f03b25651df0222459f5dbd03eee9465b97487
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247437
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,herb@google.com
Change-Id: I5e39566c35b49323913eb72ff89ecbc91faac8ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9515
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247462
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Perspective glyphs can vary in screen size so it's unclear which SDF
level is best, and even if we choose one for an entire subrun it's
possible that a given glyph will have artifacts if it's too big.
Instead we fall back to paths.
Bug: skia:9515
Change-Id: I88f03b25651df0222459f5dbd03eee9465b97487
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247437
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This is the first step in moving the marshaling of program information earlier in renderTask processing (i.e., to onPrePrepare).
Change-Id: I91e3baed9a128e845bd32f9dbbacd9b21d852a3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244118
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
When the CTM contained a "mirroring" operation - for example
scale(-1, 1) or scale(1, -1) - the radius of the morphology filter would
end up negative, essentially disabling the filter.
When mapping the radii, use the magnitude of a vector built from each
component of the radii instead of considering the radii as a plain
vector.
Bug: chromium:595244
Change-Id: Ia249f8962648f0a4e69b6d0becf87ee1ba6be9a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246996
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Fixed some bugs for flutter tests
Change-Id: I43f4b4b185152a8d642127370da5f80fb96f1e9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239444
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Since we want to collect shader information early, this attempts to make clear that numSamples, origin and outputSwizzle can all be obtained from the target renderTargetProxy.
Change-Id: I42e0fd79e2163f17673ccdd344a31fbaadac5f53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246298
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is an alternative approach to https://skia-review.googlesource.com/c/skia/+/234896
It inverts the templates and coordinate spaces, so that each coordinate space is
defined by a struct that accepts the SkIRect/etc. type as an argument. For parameter
space and device space, the only exposed functionality is holding on to the coordinates
and moving into and out of the layer space (using the Mapping type, which now encapsulates
the definition of parameter, layer, and device space for a given CTM).
The LayerSpace struct has specialized definitions for each of the 6 key geometric types,
exposes accessors/mutators and operations like join/intersect that work on appropriate
layer-space geometry.
FilterResult and Context have been updated to use these new types, although they no
longer take a Usage enum. If this strategy works, FilterResult will be updated to have
more utilities to operate and read from its image in layer-space so there won't be a need
to have the image space (and the usage enum to differentiate between different image
spaces).
To further reinforce the differences between getInputBounds() and getOutputBounds() (which
previously used Usage to do this), they now accept/return values in device and parameter
space. This is no different than what SkCanvas would have done before calling the old
functions, but now that work is owned by SkImageFilter (seems like a good thing), and
achieves the same reinforcement.
Change-Id: I8bebb9fadf6c8f2bd51fa863b2d6f2e4a33dd08b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244515
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
bug: skia:9503
Change-Id: I5b4e2434c6085d048d6d0fc42b2b928439b1066b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246296
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This is a reland of 6fc04f88a8
Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
- The raster pipeline JIT was an experiment that never really panned
out (except for also introducing the interpreter, which survives).
The removal should be pretty thorough, including undoing some changes
to SkRasterPipeline itself. For reference, I basically undid most of
https://skia-review.googlesource.com/c/skia/+/112204/
- With runtime shaders, always convert to Program using kPipelineStage
This makes the first-pass compile consistent with runtime color filter,
and with GrSkSLFP.
- Remove sksl_mixer.inc, which hasn't been used in a while.
- In sksl_pipeline.inc, all of the math symbols are already declared
in sksl_gpu.inc, which forms the base symbol table when this include
is parsed.
sk_x and sk_y appear to never be used? Those builtin IDs are the IDs
of the x and y params to main, but that logic still works without
these declarations.
sk_OutColor only makes sense in FP files (it's still declared in
sksl_fp.inc).
Change-Id: Ie8dd68d2c4687745d46f96804a76695bce8c1ba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246017
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Ie4653fce34e4d6f38613f63bc68ecc1b7bae361b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246019
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 6fc04f88a8.
Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)
Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
This is a reland of ce240cc6fd
Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
>
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
>
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
>
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
>
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
>
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
>
> Bug: chromium:973403
> Bug: skia:8962
>
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit ce240cc6fd.
Reason for revert: crashing in chrome unit test, abandoned context related?
Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
>
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
>
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
>
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
>
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
>
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
>
> Bug: chromium:973403
> Bug: skia:8962
>
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,brianosman@google.com
Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.
Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.
The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().
The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.
Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().
Bug: chromium:973403
Bug: skia:8962
Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
- add a unit test reproducing the bug
- fix SkRecorder::reset() to call resetCanvas(bounds) instead of
calling resetCanvas(w,h). (It was actually calling
resetCanvas(right,top), even worse...)
In short, because we were calling this old resetCanvas(), SkRecorder,
the SkCanvas* we record into, was presenting bad device bounds,
affecting code like where we query the clip to search an R-tree for ops
to draw. It was trimmed to only the positive/positive portion of the
actual bounds, so content like in the unit test that's all in negative
space was erroneously clipped out.
I'd like to get rid of these w/h methods altogether but they're still
used by some of our test tools and by Android.
Change-Id: Ie46f611250de4d655c4357823895ff885b4f3d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245599
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
* Implements onTransferPixelsFrom, onTransferPixelsTo, onFinishFlush and
checkFinishProcs.
* Adds a bind() method for allocating dynamic buffer memory that can
be used by the GPU prior to mapping on the CPU
Bug: skia:8243
Change-Id: I366ec47bf1155797d9a9b0c9f33870e50c95e914
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244301
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.
Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The lack of encapsulation was finally starting to bother me. Had to
change the Interpreter namespace to a struct so that it could be
friended, but otherwise this was a nice and simple cleanup.
Also updated the comments on the two run functions, and renamed
fInputSlots to fUniformSlots, to reflect recent clarification
around in vs. uniform.
Change-Id: I24bbc59778b3ab6448bffcf98133d5c149a060a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244883
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Give it its own header file.
Make it store SkISize rather than separate int w/h.
Change-Id: I732f2774c561decac743a950959a70cbc162b67b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
SkIota adds an index to some collection you already use:
std::vector<int> v;
for (auto t : SkMakeIota(v)) {
size_t i; int v;
std::tie(i, v) = t;
...
}
Change-Id: I18390fc084eb8509cfaeb50d9720541759a2986d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225546
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
As regular GPU and async read pixels share more it doesn't make sense
to test the async path using the regular path as the reference.
Bug: skia:9269
Change-Id: I8c32289947a7ae8b0f6e4e25ce8a588dfa5413f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244512
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
- Update the parameter lists to both run and runStriped so
that they're in the same (sane) order, named consistently,
and always take counts with pointer arguments.
- Add the same count-based safety checks to run that were
already in runStriped.
- Remove the N parameter to run, it was only used to run
things one-at-a-time (other than one spot in unit tests),
and it simplifies the code quite a bit. If you want to run
multiple times, use the striped version. I also moved that
functions 'N' earlier in the parameter list, to make the
pattern of the remaining parameters clearer.
- Remove an interpreter benchmark class that was never used.
Change-Id: Ibff0a47bdb2d29d095a0addd27e65ab13cb80fce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244716
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 85705c1b3b.
Change-Id: If189dafce53491728296a4292c76af55b05835ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244509
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previous code tried to aggregate some checks, but therefore had several
subtle bugs. Make each format check independent. It's easier to check
whether it's correct by looking up the specs/extensions referenced and
tweak it if not.
Also removes some "workarounds" that were just working around our own
bugs in extension/version detection.
Also adds some more WebGL format functionality.
Also uses glTexStorage2D for formats that previously did not check for
support.
Use glTexStorage2D on Android/NVIDIA to work around N9 and Shield TV
issues with glTexImage2D.
Bug: chromium:1003481
Change-Id: Ie3295b1ca76a6068f1426e77783d9dc07698c56a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243816
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit ac18a5ca60.
Reason for revert: breaking Chrome roll
Original change's description:
> remove 'in uniform' support from GrSkSLFP, make rules more clear
>
> Bug: skia:
> Change-Id: Iaa4d33c1bfb295d87343411ba6aacc8fae68ef9c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244300
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=brianosman@google.com,ethannicholas@google.com
Change-Id: I6e53f5197c751d961abfa21861b940d4168de213
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244508
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:
Change-Id: Iaa4d33c1bfb295d87343411ba6aacc8fae68ef9c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
It would have been passing, note that he changes to SkRecorder are needed only to obtain the
SkRecord used in asseting the correct commands were recorded.
Bug: skia: 9462
Change-Id: Ic43ab400b5954cc4f6eb465168179c0204a66040
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243818
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
With a perspective view matrix, we transform the path, which can
collapse it down and cause CheapComputeFirstDirection to fail. In that
case, just skip drawing the path, rather than asserting.
Change-Id: I59ee3c74d02d41913136626a653c64f825a9d56a
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=37330
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244298
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkMakeZip uses function parameter deduction to build SkZips
the same way std::make_tuple does. It figures out the size
from one of the inputs that has a size. In debug, it makes
sure that all the size()s match if the input has a size.
Change-Id: I8f80d1137866ff595fff10cafa861e867441bedd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242817
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
We want to reuse this sub-portion of the tests for SkPixmap initialized backend textures
Note: this also changes the format read-back into to be RGBA8
Change-Id: I3708541cb4e60cf2ba7b587da6e21169ef890b04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244056
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is setting up the test for SkPixmap-initialized backend texture testing
Change-Id: I667a0e6d622c9408d7fb42fc4b5792b0efa2ffb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243736
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I5558891882923b4e554a8b97a87da6bc4386b645
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243817
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
The intent is to add a createCompressedBackendTexture code path. This will decouple the GPU's ability to create compressed textures from raster's support for compressed SkColorTypes.
Change-Id: I5fa5dded6d5013b524fe7f99f2ebe0bdee76b3c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243657
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Our integer tests were broken: constant folding was optimizing away
the actual operations, so nothing was actually being tested. This
allowed us to not realize that integer divide / remainder didn't
work: vector division signals if any of divisor's lanes are zero,
and zeroes are common in masked-off lanes.
This replaces naive vector operations with loops and mask checks
for integer divide and remainder, and corrects the various broken
integer tests so they are actually doing stuff.
Change-Id: I6ffcad9e7b38a0bfd1604097f86d0faa24e1dbc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243698
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
A recent update to the Wuffs version that Skia uses means that the test
now passes.
While the old third_party/gif implementation and the Wuffs
implementation now both replicate interlaced rows (what the old
implementation calls a "Haeberli hack"), and the
Codec_GifInterlacedTruncated test passes either way, the exact
replication algorithm is different. In general, pixel-by-pixel output
may be different for the same (truncated) input.
For example, the old implementation only processed input on block
boundaries. If the truncation happened within a block, the old
implementation produces no output for that partial block but the Wuffs
implementation does.
Also, the old implementation used the interlaced row as the *center* of
the extrapolation (the 'broad brush'); Wuffs uses it as the *top* of the
extrapolation. There are subjective arguments (e.g. 'Venetian blinds',
'fat bottom rows') for either behavior. In any case, it isn't covered by
the GIF spec.
Bug: skia:8235
Bug: skia:8766
Change-Id: Ia8d8b1007006697498e47ec6bba7be7d81be10c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243596
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
These only support fixed shift amounts (for now) ... because that's what
skvx supports ... because that's what various SIMD instructions support.
(We could loop over lanes, but the only need for this at the moment
is fine with constant shift).
Change-Id: I0e2c17084d019ff9b9a21476633adb59b3ce4bd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243656
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Also, negation is unary, not binary.
Change-Id: Ic7c5a6f2ee0b2bbda89eef62999e4ebbc97dca12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243161
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: If7acf4107498cabc049ad130814a3814383bd14b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243418
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Everything except for SkImageInfo.h is mechanical
Change-Id: I2d775c79467fb15f6022e80d21b4a9151272fe2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>