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>
Bug: 1005615, oss-fuzz:17491
Change-Id: Ice8686890efad4693ba436ec74a99d9e73f25d8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243097
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:8046
This is used both by SkJpegCodec and SkWebpCodec, so make it possible
to use it when SK_HAS_JPEG_LIBRARY is not set.
Change-Id: I34aa3587500cca3d2d74c4eb33945451592bf72b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/175428
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The choke point now checks all the deleted conditions.
Change-Id: I064b107a09fdfeccf1cdf04b1b58a3c617c9ac96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243697
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@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>
Change-Id: Iec1eba6a3e54b06685ca637e9950b3e8f95a4ae6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243176
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:8757
Change-Id: Idc521302d0a2b677f6b5cd2e5ef9cf20a51607b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243427
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:8046
The only method it has in it is SkParseEncodedOrigin, so rename to
match. As with the original file, this is here so we can update
Chromium's build file, then land the CL which makes it do something.
Change-Id: Idc8bf44ea3d3f251bd122858e10313c31d0eeec6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243426
Commit-Queue: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
- Fix a tiny documentation bug in the README: layout(key) needs to be on
an 'in' variable (not just a 'uniform').
- Remove an unused list of key variables from GrSkSLFP. Guessing that
this was planned to be used, but the key calculation requires a running
offset through all input variables, so doesn't refer to this.
Bug: skia:9451
Change-Id: I0f32a742c14c0ba70a2c3373b92438093cd62216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243423
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The primary purpose of this commit is to track upstream Wuffs more
closely.
A side effect is to pull in the Wuffs commit
ca9015bd2d
"Have std/gif replicate interlaced rows", which lessens a difference
between the old third_party/gif decoder and the new third_party/wuffs
decoder.
Bug: skia:8235
Change-Id: I8f42423e0e931ce32c49b791b325d50f83dd7eac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243336
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@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>
This also makes createBackendTexture take SkPixmaps (instead of a raw pixels pointer)
Change-Id: I5d8a5a58fa7b15862fbf46a3c232cb6ea7f58976
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243158
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Restores scratch pool checks that were accidentally removed here:
https://skia.googlesource.com/skia/+/a90382fcf6759d4e13c20cf542ab5440ffd4f02d
Also enables checking scratch pool for mip-mapped textures, which was not
previously done.
Consolidates level prep and write-pixels code.
Bug: chromium:1005237
Change-Id: I6f23ce15299290ca5b666f910dc5fc85541ec316
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243038
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Fixes the case where someone uses the kF16ColorType flag to saveLayer
but the GPU doesn't support F16 render targets.
Follow-up to https://skia-review.googlesource.com/c/skia/+/243041,
which improved the quality of the savelayer_f16 GM on most GPUs, but
removed the final draw on the GPUs that can't respect the flag.
Change-Id: I03dac6b2370bc9117c082f6c5c9b14e84b631339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243156
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I1483cdf7229b7234be41d21407e2b4abf99fff76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239925
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 80c1f093cd.
Updated make_layer_info to avoid swizzling when the previous layer
was either version of 8888. Fixes all of the ANGLE MSAA failures.
Change-Id: Iedd410988882f3dce05bb5ec18bcd84363e3591a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243041
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: I573b966bc8ad599adfe81008d053bfbbcefd42b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243040
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 16559a1f9f.
Reason for revert: ANGLE images look bad
Original change's description:
> Use saveLayer-determined CT in SkGpuDevice::onCreateDevice
>
> Currently Ganesh always uses the prev render target CT, but saveLayer
> may force a different CT, depending on flags.
>
> This fixes handling of saveLayer/kF16ColorType (added in
> https://skia-review.googlesource.com/c/skia/+/227066).
>
> Change-Id: Iab476c4afa4c70e25c452b2c430cbded5adb25e9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241876
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,fmalita@chromium.org
Change-Id: I1e8eafbfdd7391c18eda4942cbdf0046a4ee2b53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/243039
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Currently Ganesh always uses the prev render target CT, but saveLayer
may force a different CT, depending on flags.
This fixes handling of saveLayer/kF16ColorType (added in
https://skia-review.googlesource.com/c/skia/+/227066).
Change-Id: Iab476c4afa4c70e25c452b2c430cbded5adb25e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241876
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@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>
These two formats are now exercised in the wacky_yuv_formats GM
Change-Id: I07a5649401b7928e8c4666e39793915ac1d45646
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Spun off from https://skia-review.googlesource.com/c/skia/+/242776.
I was worried there that this indicated a bug, that we're actually
working with a slightly-wrong denominator, but thanks to the wonders of
float rounding, turns out everything's probably ok. This is the same as
that CL above with unit tests that the important boundary conditions
work correctly.
Change-Id: I1df469daf48df12f0e72778e6af58f5e733452ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242841
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: I87b0fc76ef48c1a21498e576853a6c3b4a6a98f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242563
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This allows us to demand exact matches in size and eliminate our
dependence on absClear.
In the future we can take this a step further and offset the mask to
leave a transparent border on all sides, thereby creating a "decal"
effect.
Bug: skia:
Change-Id: I8cd02ba1365ace0ccaae250a7195f51d0c77ce8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242720
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This optimization also decreases register pressure, making it possible
to JIT where we couldn't before, in particular, srcover through an A8
mask into 8888.
These programs could use fewer registers still if skvm weren't so
literal minded about running things in the order you asked, and if it
weren't so much easier to express code as [r,g,b,a] = load_dst() than to
unpack one at a time as they're needed... we sometimes have a bunch of
registers holding temporary values where we really only need one or two
if reordered. This might be an area where it's better to explore
backing SkVM to a more powerful code generator, like LLVM, cranelift,
subzero, V8, etc. But it's possible I can come up with some sort of
register-pressure-reducing code reorderer?
Add more debugging tools that helped pointed to this:
- tack on debug names to JITted routines so I can tell what's what
- when debugging is enabled, dump out programs that fail to JIT
Change-Id: I56f1288d830f85d5fce7c59ca0ec3360069665ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242559
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This is a reland of fd1414608b
Original change's description:
> Reorder msaa and mipmap resolves to happen all at once
>
> Makes it so every renderTask has only one textureResolveTask, and
> modifies GrTextureResolveTask to perform multiple resolves
> back-to-back.
>
> Bug: skia:9406
> Change-Id: I93566cf4b23764bd846a1e0a0848642c9b3a507a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:9406
Change-Id: I0e98ec6749e88628f8c1bae34351f5ff95cd2066
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242519
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Previously this clamping was inserted by the program builder.
Adds GrSaturateProcessor to handle saturating in the fragment shader.
Clamp the GrPaint color rather than using a fp when possible.
Has to be plumbed through GrTextureOp because that skips SkPaint
conversion.
Removes a usage of GrPixelConfig.
Bug: skia:6718
Change-Id: Ifa6544496d34677f17e797433e6ef3a97be5c2b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242558
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
I happened to have this on when profiling skottie_tool and got curious
why I was seeing the interpreter run and not JIT code. Mostly this
moves the code in bulk out of SkVMTest.cpp to SkVM.cpp so that code in
SkVM.cpp can call dump() on itself.
Also this CL has the skvm::Program hang onto the original value-based
builder program (in addition to its own interpreter program and JIT
program if we can). This is entirely so that when JIT bails out I
can have it dump out both the builder and interpreter programs for
more debugging aid.
I'm still going to need more debug tools somewhere to figure out
what the program that needs 17 registers is, and what to do about
it.
Finally, remove skvmtool. It's annoying to maintain its build
rules, and I don't use it much if ever anymore.
Change-Id: I995d15d04bda79ddfc4d68bda8aaa3b5b9261f08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242520
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This is a reland of f3c4a829c6
Original change's description:
> SkZip - synchronized indexing of several pointers
>
> This is the mechanism for syncing a bunch of things with
> contiguous memory like vector<>, array<> and SkSpan<>.
>
> In a following CL, a convenience function SkMakeZip will
> easily convert most containers into a zip.
>
> Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I7d1a91a9c35dde721147bb3c1f23c9b3a8d59d04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This CL adds:
kAlpha_F16_SkColorType
kRG_F16_SkColorType
kRGBA_16161616_SkColorType,
which should be it for a while.
Bug: skia:9121
Change-Id: I81b9d46a202a76e9b7d7ca86495d72dbdae32576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241357
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This reverts commit a37ea9246e.
Reason for revert: Perf regressions
Original change's description:
> Use a "decal" domain for filterMaskGPU
>
> In addition to requiring absClear, the old approach yielded
> asymmetrical blurs where the top and left edges got a "clamp" mode,
> and the right and bottom edges effectively got a "decal" mode.
>
> Bug: skia:
> Change-Id: If72da4374eb2f0475acae59e269d44cb72c5ce95
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240759
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=robertphillips@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I653fd59401c06914cbe85bca77175e3fb182bc73
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242502
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Include protected in scratch key.
Change-Id: I0dfc58c9f54e8279a39adf4bad808b7e0e72cba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241397
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is a reland of c25802db30
Original change's description:
> Add ETC2 support to Metal backend.
>
> Fills out onCreateCompressedTexture and sets iOS caps to support ETC2.
> Skia supports no compressed texture formats on MacOS as yet.
>
> Bug: skia:8243
> Change-Id: I2ce20f601c035a8822e658c88b815fdd8587aa98
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240692
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:8243
Change-Id: Idebc46f29f4b75d216cf877606af290b0b3b8318
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242080
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: Ic4a0e640623677c06112d0735ffc5682049baf11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240771
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit fd1414608b.
Reason for revert: red bots
Original change's description:
> Reorder msaa and mipmap resolves to happen all at once
>
> Makes it so every renderTask has only one textureResolveTask, and
> modifies GrTextureResolveTask to perform multiple resolves
> back-to-back.
>
> Bug: skia:9406
> Change-Id: I93566cf4b23764bd846a1e0a0848642c9b3a507a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com
Change-Id: I12f340da3dfec81477ceeab806ca76ce2b3c397b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9406
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242390
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Makes it so every renderTask has only one textureResolveTask, and
modifies GrTextureResolveTask to perform multiple resolves
back-to-back.
Bug: skia:9406
Change-Id: I93566cf4b23764bd846a1e0a0848642c9b3a507a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit f3c4a829c6.
Reason for revert: std::get<T> is a c++14 std library call
Original change's description:
> SkZip - synchronized indexing of several pointers
>
> This is the mechanism for syncing a bunch of things with
> contiguous memory like vector<>, array<> and SkSpan<>.
>
> In a following CL, a convenience function SkMakeZip will
> easily convert most containers into a zip.
>
> Change-Id: Icda5b1774ae21c4c163a663f6d2b0f119f63ccba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240200
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
TBR=bungeman@google.com,herb@google.com
Change-Id: Idc52b0552cd01b163357a45d43d9531e62694dda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242356
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
In addition to requiring absClear, the old approach yielded
asymmetrical blurs where the top and left edges got a "clamp" mode,
and the right and bottom edges effectively got a "decal" mode.
Bug: skia:
Change-Id: If72da4374eb2f0475acae59e269d44cb72c5ce95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240759
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>