Bug: skia:12754
Change-Id: I666bda6a192e3c3dc95953e5a36fbabbf65171ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515857
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Guarded for chromium and Google3
Bug: chromium:1302855
Change-Id: If9b085a24d5f03e6971506c98463aa8c09100a67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516016
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We only want to run pass/fail unit tests on SkQP. Gold image support has
been removed.
In this CL, the command-line argument for render tests has been left
as-is to avoid breaking scripts which rely on it. This can be removed in
a followup. The Java binding continues to exist as a no-op.
Change-Id: Ib8acb6cb490b935b10d841e2319fe4537696bda1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516336
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
that wouldn't allow to use RasterPipeline
when SkVM blitter cannot be created
Change-Id: Ieadf06169c8163a8490df19258eb4dd25e31ee05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516997
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
ag/16935648 added a method to detect the color depth of R/G/B channel
for input sources. This change does the following: (1) call this new method and default
SkAndroidCodec to 1010102 for 10-bit images; (2) add color-depth to
SkEncodedInfo.
Change-Id: I3ede4a7a6223da2d4c075403d6ee280db086e0be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512076
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
as a small optimization and to prepare for future
bigger optimization
Change-Id: Iafda673533c05417de5092549105e82959ba9fcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516378
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
ES2 disallows opaque types in expressions (other than passing them to
their associated builtin functions). We now enforce a similar
restriction on SkSL opaque types.
While I was there, I added several other cases to the invalid-shader
test to make sure that they were all caught.
I needed to reorder some code to make sure that ternary expression error
messages didn't change. Ternary expressions now check for opaque types
before checking that the left-side type and right-side type are
compatible. This is because we check for "compatible" ternary
expressions by checking if `leftSide == rightSide` would be accepted.
`shader1 == shader2` used to be considered a valid expression for the
purposes of this test, but not anymore.
Change-Id: I62a0a31feca9dadd428da7d1b48d7693c4b6434d
Bug: skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516802
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The fuzzer discovered that we allow == on void types (confusing the SkVM
backend).
Change-Id: Ia9494642faf67f3f86e3a365807be8bd4a7062e4
Bug: skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516796
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, we would take the vector-folding path for all types. This
didn't cause any problem for scalars, but failed for "zero-size" types
like void. It isn't valid to compare zero-size values, but we currently
don't reject such code (see skia:13026), and the fuzzer noticed this.
It's safest to only run the vector-folding code when we actually have
multiple slots that need to be folded into one result.
Change-Id: I0bc88043d9a4aeea38ae24dc1a6d1a7430d3d7b0
Bug: oss-fuzz:45279, skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516676
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
If an object did not have the expected type, we would return null, but
leak the undesired object.
Change-Id: I4f799e6583f8d35e852319106b5b07a5a2e4d354
Bug: oss-fuzz:45240, oss-fuzz:45256, oss-fuzz:45265, oss-fuzz:45270
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516797
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
We don't want to use any negative index in fFactoryArray.
Change-Id: Ib87b3c0a28fb61653dbffc700a96001421930060
Bug: oss-fuzz:42237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516376
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
When deserializing an SkSL shader, it's possible to encounter code that
doesn't compile (particularly from the last year, when syntax tweaks
were being made). By default, we still treat this as an error and fail
to load the SKP. In the SKP debugger, though, we add a lenient mode that
permits these failures. If any of the children were SkShaders, we
instead return that. If all else fails, we just return nullptr, which
will cause the triggering draw to use a solid paint-color, but at least
allow the SKP to be loaded and viewed.
For color-filters and blenders, we allow malformed SkSL, but always
return nullptr.
The bug that prompted this change involved Android's overscroll stretch
shader, where this approach works particularly well (it turns the
stretch into a simple pass-through of the underlying content).
Change-Id: I756c694739d31b11efa1b82c126f34440a7de66a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515543
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The power sliders have been deprecated in favor of specifying that the
sliders are logarithmic. This doesn't appear to work very well, but at
least it doesn't crash at runtime with an assert.
Change-Id: I2c80aaf8e387efbb878c81a1ca0f754f6c45e80a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516160
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I49ed41170d5ac39658554435f806af0218911316
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516158
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
We seem to save about 1K of code size each time an unordered_set/map is
replaced.
Change-Id: I7e04076d470e6c7ad4ae8301ded231ae69168bc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515361
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This leverages our new ability to initialize a hash map at construction
time (http://review.skia.org/515319)
Change-Id: I2e6038b3a6645f19128930d3c58707a682b5232f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515320
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I7b10f475598b070b1b690f38dc7d54b40f240f14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515676
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I6f50d8020c15acf664cdfcb2918c2e547427b838
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515321
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:12754
Change-Id: I66f5f64dc6d27f3bd9bf936fd5989531e33ecdc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515856
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The blend mode implementation, in particular, will require access to
the prior stage's result.
Bug: skia:12701
Change-Id: I8db0d70edf0c17b934a3d751d2b632765e0900df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514958
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:12754
Change-Id: Iec046dedb088f226e5928712222fa786426b2689
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515517
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This will allow us to easily replace unordered_set/unordered_map in more
places.
Change-Id: Ic0b5245e8cdce2918d7b043bfc370eca95caf889
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515319
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
It seems to reduce code size by about 1K every time we remove an
unordered map.
Change-Id: I120aa6130b4283c7d41b9db5bfeec3c2eb99bcd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515545
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The slot-assignment logic has been changed to associate slots with
function calls, instead of function definitions. In our test case, you
can now see that the calls to `get` are now mapped to $15, $17 and $18.
This change also jiggles some existing tests and improves their
register allocation slightly (!).
One minor hitch here is that there's no FunctionCall node associated
with main() (it's never explicitly called). However, our slot map key
can be any IRNode, and we know main() can't be called by anyone else,
so it's harmless to use the function definition as the key in this case.
(This entry could probably stay out the map entirely if it made a
difference, but I don't think it matters.)
Change-Id: I68a6ff24cbd3a2db77f24126502bd3d11e8c0962
Bug: skia:13011
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514578
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
If a function is called multiple times on one line, stepping over that
line does not show all of the function-call results. It only shows the
last result.
e.g. in this example, I have just stepped over the first line which
calls "get" three times. We should see three results, but we only see
one: http://screen/3WfJoZWm77cSexM
In this test you can see that all three calls to `get` are assigned to
the same slot, $15.
Change-Id: Id0c486ef349a1e527001efbcee2ed2b836f56e83
Bug: skia:13011
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514577
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Navigating away from the Debugger in Viewer could lead to a null
dereference.
Change-Id: I2686edd3716e7a375d394a4dc1a296395b5f35b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514579
Reviewed-by: Arman Uguray <armansito@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
should not be pushed until scuba is updated (cl/431716076)
Change-Id: Ic1b6b76eb0ebd1ab0c9d7875c7b5789af39e21c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514763
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
In a following CL the ShaderSnippet will need to shared between the SkPaintParamsKey and the SkShaderDictionary.
Bug: skia:12701
Change-Id: I69935765a32a5a0eb61a23178037ab6be3d110b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515357
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is rarely accessed so I don't expect much impact on performance,
but it will be interesting to see if it impacts code size.
Change-Id: I407ef5f8dc71f328e541243073b7e82dd1303268
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515359
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This leverages our new support for standard strings in SkGoodHash, added
in prior CL http://review.skia.org/515356.
These tests already included checks for SkString, so it was easy to add
a template which tested std::string and std::string_view with the same
checks.
Change-Id: Ia2d9b889e66a50556a25e40493d14a5b692214a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515358
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>