Bug: skia:13118
Change-Id: I0d6e0a9f542680456d3de82a32376722c5b9cd1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549097
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
initializer_list constants only have a scope until the next
sequence point.
Change-Id: I5c52310042fc4773a3ac0e5f9d23ae45bb7b1229
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549574
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Use std::size and std:data to get needed values.
Add a SkMakeSpan for initializer_list.
Change-Id: I43b4b2391323c84b3d6aad22ac4775487c6d5570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549565
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
No longer call glBufferData with a partial size and track a true
buffer size in the subclass.
Bug: skia:13427
Change-Id: Ibfd04ff8a18d54e1e4cd3fce6863cb48b5495294
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549276
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is a reland of commit 55f9ee1e35
Original change's description:
> Move RecursiveComparison tests to run on GPU
>
> These all require the GPU to generate NaN values. We don't have a static
> way of checking that in caps. Instead, added a probing function to
> decide if the GPU will generate them, and a flag to indicate which tests
> require that behavior.
>
> Change-Id: I9411969b042684ac583a9eb4e9b1aacf2525cc22
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549099
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Ie29d32756ceebf872faf1db8d1a1273ad842529b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549562
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:13118
Change-Id: I06d3f899b60ac2cf8d48a46da6097a15c5d40024
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543923
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
At present, we calculate the coordinates, but we don't yet use them
anywhere, because the runtime effect code isn't being included in the
finished program.
Change-Id: I6eb6b1b43ce78da31884b7a8b1bac2aa9ba5407b
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549101
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Runtime shaders are now distinguished by the hash of their shader text
and number of uniform bytes that they will use. Fortunately, we were
already computing the shader text hash so all we needed to do was
bring it into our data payload.
Change-Id: Ifc0bba6a7f18acd9affca5822e1a54fbff594d88
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This was introduced here:
https://skia-review.googlesource.com/c/skia/+/549618
When resizing the buffer pass nullptr as src.
Change-Id: I99b7c9a12379e3285119e62adb5a02c93c2f66d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549657
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The previous logic in handling complex bbox intersections in Graphite's
clip stack was fundamentally flawed. It's now replaced with the correct
solution, which is to use the separating axis theorem, instead of just
checking corner points.
The flow through the intersection case has been re-worked to move the
rect-stays-rect dual to the forefront, since that is the most common and
simplest scenario.
Also adds an extra fast check for contains() to avoid more expensive
analysis when the outer bounding boxes already show containment is not
possible.
Found a minor bug in the creation of the clip stack elements where it
was only applying the rect-stays-rect transform to map shapes to device
space when it was *only* rect-stays-rect and not simpler. Importantly,
this meant that translate and positive scale+translates were remaining
un-mapped so comparisons between elements would always then hit the
more expensive "differing coordinate space" codepaths. Previously, the
only cases that would trigger this would be mirrors and 90 degree
rotations.
Change-Id: I328ca1515ff578a617ef18992819c7c9465cb30d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548478
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This is a reland of commit 02ee07325f
Original change's description:
> Use glInvalidateBufferData when available.
>
> Also move common onUpdateBufferData checks and asserts to base class.
>
> Bug: skia:13427
> Change-Id: Iccae5b654a6ed3eab71ac701a78434aa1116e00e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548482
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
Bug: skia:13427
Change-Id: I4a133bca44b52924453b6e5d2e4e812e80900606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549618
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 55f9ee1e35.
Reason for revert: MacMini failures
Original change's description:
> Move RecursiveComparison tests to run on GPU
>
> These all require the GPU to generate NaN values. We don't have a static
> way of checking that in caps. Instead, added a probing function to
> decide if the GPU will generate them, and a flag to indicate which tests
> require that behavior.
>
> Change-Id: I9411969b042684ac583a9eb4e9b1aacf2525cc22
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549099
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I4e2bb4f0d2908f2fb4a2f2d64953c1366549d397
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549559
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Also move common onUpdateBufferData checks and asserts to base class.
Bug: skia:13427
Change-Id: Iccae5b654a6ed3eab71ac701a78434aa1116e00e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548482
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
These all require the GPU to generate NaN values. We don't have a static
way of checking that in caps. Instead, added a probing function to
decide if the GPU will generate them, and a flag to indicate which tests
require that behavior.
Change-Id: I9411969b042684ac583a9eb4e9b1aacf2525cc22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549099
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Godbolt before: https://godbolt.org/z/KMG3WE1fq
Godbolt after: https://godbolt.org/z/sPvjn9W97
Our compact lexer tables contain four values--zero plus and three actual
values. Previously, we used a bitfield to squish those each of those
nonzero values into the least amount of space possible--given our
current data set, the first value always fit into 6 bits, and the other
two needed 9 bits. This adds up to 24. Unfortunately though, in practice
the values cost us 32 bits since there's no 3-byte int in C.
I realized that we could do significantly less work if we used the same
number of bits for each of our three values--we can just shift by
`9 * value` and mask it off. This adds up to 27, which is still within
our 32 bit margin. This also plays well with the special-case of zero;
if we make zero live in position 3 (instead of its original home at
position 0), we can shift all the bits off and we'll be left with zero.
This approach will even extend to 10 bits per value without any
problem. If our lexing tables grow past that, we will need to switch to
64-bit ints or come up with a different packing algorithm.
On my desktop machine this was able to win back 1.5%-2.5% in
sksl_large (maybe below the noise floor for typical Skia perf).
Change-Id: Id5c4d6eec749294f2c596d4c81cde6f429af993f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549376
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This allows mskps produced with Chromium to be displayed in the
debugger. Previously, the debugger would produce invalid json if any
string contained characters which needed to be escaped. The debugger
also treated all strings like NULL terminated strings, but json is
Unicode based and code point U+0000 is a perfectly good code point.
Change-Id: I28150bad666b02be9f1e4af4078a4ca1e65bf000
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549098
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Since the state per recorded draw is reduced when occlusion culling
isn't part of the API, I switched BruteForceBoundsManager to use two
parallel SkTBlockLists, one for the rects and one for the orders. Since
Rect is over-aligned, this should save on memory.
Bug: skia:13201
Change-Id: Ib9b4b1faf9831f66708475faaf399cc4fadc4f45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548777
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Clarifications based on comments for the newly created DrawAtlas.
Change-Id: I61488043b6be8e08debec5fbe34ebf72f7a4bca0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549040
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
We continue to draw a solid magenta placeholder, but we now use a
RuntimeShaderBlock and dedicated RuntimeShader code-snippet to do it.
We no longer use the SolidColor shader or data structures.
Change-Id: Ib5a707596dda593c515f4da5eabd4f6b5efd889c
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548836
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This adds a new SkShaderType for runtime shaders, but it doesn't do
anything interesting yet; for now, we draw solid magenta as a
placeholder.
Change-Id: If0e4af9000d97fcf1184fbed004a64fff8fa4e63
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548477
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
* Move SkSubRunBuffers implementation to where it lives now.
* Clean up unused #if stuff.
* Clean up includes.
Change-Id: I9f606d1ecbe1cfb94e00c1890f30adeec05c8b3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549039
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
@stage() is deprecated, the new form is @vertex or @fragment.
Re-generated the .wgsl files to fix the Housekeeper bot.
Change-Id: I7f0a9ee4a456a1a6b0ddadf0c1063eac77130af2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549096
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
In an upcoming CL the CombinationBuilderTestAccess object will need
to be accessed in multiple test .cpp files.
Bug: skia:12701
Change-Id: I66c969dbe054b7fd333bcd201fcebed4c1dfcc91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548698
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13420
Change-Id: I4b99a5d75e9fa4ce87b3f0bcb1210d2ec47ae112
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548996
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: chromium:1335249
Change-Id: I441d48fd97e0fccfb25de2bd4a2d8006c2e80ce7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549038
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
I have two reasons for doing this. The first is that I don't think
it was doing anything. In order to set the bit field the statement:
digest->canDrawAsMask() && digest->canDrawAsSDFT()
had to be true. Which I think is impossible because this is
in the mask (not SDFT) case, nd the mask is never SDF when
preparing for mask drawing, since SDF masks will be prepared
when preparing for SDF drawing.
Second, this code is optimized for TextBlob use. Optimizing for
Slugs means that we will need to keep more information around.
This bit vector will never be useful for Slugs.
Change-Id: Ic9233a8a061b58a53d773ae278756b0b714f7c73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548481
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I27eb99450b2b261a4688c62d91a9002dfe7d14df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548484
Auto-Submit: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12701
Change-Id: Ibaeedcbf478546f2942df95d362bee8632ba0ded
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548419
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Just a minor cleanup to hide some cruft.
Bug: skia:12701
Change-Id: I70e9c8ba89a5b7d100a3d3f9b9dd084ad0a70715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548418
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
We were returning Expressions from ConstructorArrayCast which didn't
match the passed-in Position. We now make sure to set the position of
the returned expression properly.
Change-Id: I2099d006e7dff2c94a9590c7159c4b0947c91257
Bug: oss-fuzz:47935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548483
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We are trying to enable ANGLE on Android. However with ANGLE, chrome
will use L16F instead of R16F textures, so we should not disable it
with ANGLE. BTW, if there is a driver bug for L16F, ANGLE can emulate
L16F with R16F.
Bug: chromium:983167
Change-Id: I6d0edfdc8d33c2b8a650f67ab36c7c84ef448372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547836
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Symbol name lookup is generally simple, except for overload handling.
This factors out the complex, rarely-hit parts into a separate function.
Also, this replaces a vector with a span, which is probably a wash
since it's generally either empty or needs to be modified.
Change-Id: Ia4207fabc08e11b0214406de372cf429c4967ffd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548158
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Replace the empty label string with the label name for
different Skia components.
Bug: chromium:1164111
Change-Id: I10bf62f8febace584db624a33b07b272517df38e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548857
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I0925a52cc3a504c95ec4453e74c4580ce692275c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548896
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Commit-Queue: Eric Boren <borenet@google.com>