This reverts commit 7ac9b5fdb6.
Reason for revert: abandon context bots breaking
Original change's description:
> Add async rescale and read APIs to SkImage.
>
> These function the same as the already existing
> SkSurface APIs.
>
> Bug: skia:10431
>
> Change-Id: I4f1e842d8d4b72ee27bae5f8a85e499e130d420c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299281
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: I351795274245fc9f553cd210d82178f497f22660
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
These function the same as the already existing
SkSurface APIs.
Bug: skia:10431
Change-Id: I4f1e842d8d4b72ee27bae5f8a85e499e130d420c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299281
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Since gpuSetup can preempt draw's execution it needs to draw the error message too.
This is pulled out of the gpuSetup refactoring.
Change-Id: Iafe06d924fc1b694c59aa3100e9fbe95c4773222
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299140
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
First one worked for me locally, second one should work for bots.
Change-Id: Ib22e3507b910089a2516fab8dd41dfbc22d5862f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
This reverts commit 7d7cd2b178.
Reason for revert: breaking chrome roll
Original change's description:
> Make glPatchParameteri required when tessellation is supported
>
> Chrome started wrangling this entrypoint in the following CL:
>
> https://chromium-review.googlesource.com/c/chromium/src/+/2253344
>
> Change-Id: Ief4dfb1ddca8d86e0c09dfdc443e01830cb4de20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298405
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=kjlubick@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I569f2a16de156c5b2e819cb2a45ea942ca2cdec7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298819
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: Ia449e2cfd8b1153e7ab1cd7ad1916550aecf55ef
Bug: skia:10428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298744
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Surfaces to client whether GrContext has seen a GL_OUT_MEMORY,
VK_ERROR_OUT_OF_HOST_MEMORY, or VK_ERROR_OUT_OF_DEVICE_MEMORY error.
Bug: chromium:1093997
Change-Id: I8e9799a0f7d8a74df056629d7d1d07c0d0a0fe30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298216
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: Ia19063f13e74d7dc2f1ead1fad20ad6828a3648d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298742
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I have a more complete fix in the works but this should unblock fm users.
Change-Id: I0af40f801f7d6d8c02b077b2e6b8ff2b875a4ad8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298707
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This helps to diagnose errors in DM tests.
Change-Id: Ib585e6e78c1d0a03493befe970558e6f9c9731a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298136
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
This is a reland of 4e37751693
Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
>
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
>
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
>
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ibf6921c97278c9f0f71c46883cfbaa04f229affa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297865
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is a reland of 0426947243
Original change's description:
> Centralize geometry processor vertex shader transform code
>
> GrGLSLGeometryProcessors no longer have to call emitTransforms() in
> their onEmitCode() function. Instead, the GpArgs struct allows them to
> set a GrShaderVar that holds the computed or explicitly provided local
> coordinates in the vertex shader.
>
> The base GrGLSLGeometryProcessor now automatically uses that to collect
> all of the transforms that can then be lifted out of FPs to the vertex
> shader, and base their computation on the GP provided local coordinate.
>
> As part of this, there is no more built-in magic concatenation of a
> local matrix / inverse view matrix to these coordinate transforms. GP
> implementations that relied on this now manage their own uniform for this
> matrix and compute the local coordinate before assigning to GpArgs.
>
> The base GrGLSLGeometryProcessor is updated to provide helpers for this
> pattern.
>
> Bug: skia:10396
> Change-Id: I56afb3fff4b806f6015ab13626ac1afde9ef5c2b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297027
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:10396
Change-Id: If1347bcacb7c405a66f9d4c5b0059e9d735b3f9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298062
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
So apparently I did all the work to allow us to not submit in
updateBackendTexture, but then I never actually removed the submit...
Bug: chromium:1087124
Change-Id: Id08a9c5e116cff57dbbeada74186f94da6e28656
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297866
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 0426947243.
Reason for revert: unblock chrome roller
Original change's description:
> Centralize geometry processor vertex shader transform code
>
> GrGLSLGeometryProcessors no longer have to call emitTransforms() in
> their onEmitCode() function. Instead, the GpArgs struct allows them to
> set a GrShaderVar that holds the computed or explicitly provided local
> coordinates in the vertex shader.
>
> The base GrGLSLGeometryProcessor now automatically uses that to collect
> all of the transforms that can then be lifted out of FPs to the vertex
> shader, and base their computation on the GP provided local coordinate.
>
> As part of this, there is no more built-in magic concatenation of a
> local matrix / inverse view matrix to these coordinate transforms. GP
> implementations that relied on this now manage their own uniform for this
> matrix and compute the local coordinate before assigning to GpArgs.
>
> The base GrGLSLGeometryProcessor is updated to provide helpers for this
> pattern.
>
> Bug: skia:10396
> Change-Id: I56afb3fff4b806f6015ab13626ac1afde9ef5c2b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297027
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: I203b7c72591d39b159e0405716fe8cdc28b083af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297917
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
GrGLSLGeometryProcessors no longer have to call emitTransforms() in
their onEmitCode() function. Instead, the GpArgs struct allows them to
set a GrShaderVar that holds the computed or explicitly provided local
coordinates in the vertex shader.
The base GrGLSLGeometryProcessor now automatically uses that to collect
all of the transforms that can then be lifted out of FPs to the vertex
shader, and base their computation on the GP provided local coordinate.
As part of this, there is no more built-in magic concatenation of a
local matrix / inverse view matrix to these coordinate transforms. GP
implementations that relied on this now manage their own uniform for this
matrix and compute the local coordinate before assigning to GpArgs.
The base GrGLSLGeometryProcessor is updated to provide helpers for this
pattern.
Bug: skia:10396
Change-Id: I56afb3fff4b806f6015ab13626ac1afde9ef5c2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297027
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 4e37751693.
Reason for revert: breaking some mac test bots
Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
>
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
>
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
>
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ia14c60ae996757369f1711ec0851e199cbbd4157
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297812
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Also allows internal creation of rectangle textures, only used by unit
tests currently.
Previously GrContext::createBackendTexture() would ignore the request
for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
supported and always fails for EXTERNAL.
Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This also adds a GPUTEST_FOR_D3D_CONTEXT macro to help with debugging
tests.
Change-Id: I72db01d148755c3bbbbb4d948d441a31dcf9482b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297717
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
With the CPU backend, there is no GrContext on the canvas, so we were
sending errors to the default handler (SkDebugf + assert), so editing
shaders was impossible. Now they fail gracefully (and produce a popup
window with the message).
Change-Id: I29bad24f201be59ba1cec45f446a433c01cf86dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297461
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously, all backends allowed the SkSL to be edited, and GL allowed
GLSL to be edited. Now any backend's source can be seen, and they can
all be edited (other than SPIR-V). Tested with HLSL and SPIRV. I don't
have a Mac available, but MSL should work, too.
Change-Id: Ia2a11bb5922dd49a5f25840e48384e0246a28b69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
In order to emulate OOP-R's behavior, GM needs to pass GPU-backed resources to a DDL recorder.
This change allows GMs to create GPU resources first (in onGpuSetup w/ a direct context) and then use them in onDraw (with only a GrRecordingContext).
Change-Id: Ifa3002af73eb9926f653fb4c4bf4542c0749d658
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This arrangement allows the backend texture to outlive the YCbCr SkImage.
Change-Id: I34939d05bf1091c8efcacb687dc1900729d4cbe5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296478
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This new api will eventually replace the version that takes an
SkSurface::BackendAccess.
Change-Id: I48cd013725e14027f386b0b111223459944ac44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295567
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
(This is a simple reland of
https://skia-review.googlesource.com/c/skia/+/293272
and is functionally unchanged, but needed to be reconstructed
manually because JavaInputStreamAdaptor.cpp was deleted.)
SK_ABORT was already using SkDebugf to print the error message to the
console, so all the moving parts were there. This CL just adds a
mechanism for the calling code to pass in arguments.
Added a use case to demonstrate usage--when an allocation fails, the
requested size is now shown in the error message.
Change-Id: If8600a9febad15b7c8b7a04479a1d92442521f21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294705
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This CL is not fully comprehensive; for instance, it does not contain
fixes for backends that don't compile on Mac. But it does resolve the
vast majority of cases that trigger -Wimplicit-fallthrough.
A few minor bugs were found and fixed, but none that were likely to
affect normal operation.
Change-Id: I43487602b0d56200ce8b42702e04f66390d82f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295916
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This should make the YCbCr sampler helper usable in a GM (with a normal Vk context).
Change-Id: I75451f6ca934f7b59c48349c77234856d0946a12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295766
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The aim here is to unify VkTestHelper with the VkYcbcrSamplerHelper's context creation code. AFAICT they have a ~90% overlap.
Change-Id: Iba8d1482b8c1d7164682f90e19d2183d8cfe45d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295583
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
For each skp in the corpus, we start a fresh instance of
Chromium (via puppeteer), draw the skp and measure that time.
This process is repeated a fixed amount of repetitions
and the median, the average, and the std deviation is reported
to perf (as well as the individual datapoints as an FYI).
Importantly (and something we'll need to change about
SkottieFrames), we measure the average time between frames
after unlocking the framerate. This ensures we account for
the time needed by the GPU to actually draw (flush() returns
after the GPU has all the instructions, but not necessarily
has been able to draw).
This implementation is very similar to the SkottieFrames
code; a notable deviation is the repetitions are handled
outside of the html, i.e. a new chrome window per run.
I explored using content_shell, but noticed that requires
building Chromium, which our infrastructure is not set up
to do well.
Change-Id: I14fdbdc951604d3fdf06e81a4be7e614d0e53c03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295079
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
The intent is to reuse this helper to create a YCbCr GM.
Change-Id: I4d6af42745dbf845e28753bec670ad4a75c393b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295443
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
These are much safer than SkReader32/SkWriter32 (they do validation and
ensure we never read past the end of the buffer).
Where we used to just assert that the contents of the cache were valid,
we now validate everything, and fail gracefully by discarding the cache
contents if it's corrupted or invalid.
Reland includes a new skipByteArray API. The previous technique for
reading into an std::string relied on data(), which doesn't return a
writeable pointer until the C++17 standard library.
Bug: skia:9402
Change-Id: I3b88efbf8ca590c8ad4f8164f7c07eee12696ec6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 5fa11d4040.
Reason for revert: breaking some compiles..
https://chromium-swarm.appspot.com/task?id=4cb41acadb936310
Original change's description:
> Switch persistent cache to use SkReadBuffer/SkWriteBuffer
>
> These are much safer than SkReader32/SkWriter32 (they do validation and
> ensure we never read past the end of the buffer).
>
> Where we used to just assert that the contents of the cache were valid,
> we now validate everything, and fail gracefully by discarding the cache
> contents if it's corrupted or invalid.
>
> Bug: skia:9402
> Change-Id: Ib893681f97f9413c28744f11075dc2e392364db6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294998
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: Iabea26cde82043e3f3a23cde81503ea3abdd8398
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295394
Reviewed-by: Mike Reed <reed@google.com>
These are much safer than SkReader32/SkWriter32 (they do validation and
ensure we never read past the end of the buffer).
Where we used to just assert that the contents of the cache were valid,
we now validate everything, and fail gracefully by discarding the cache
contents if it's corrupted or invalid.
Bug: skia:9402
Change-Id: Ib893681f97f9413c28744f11075dc2e392364db6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294998
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
"Artboards" are top-level Rive containers (similar to AE compositions),
holding the scene graphics and related animations.
Artboard properties:
- name
- width/height (size)
- translation (position)
- origin (anchor point for transforms?)
- (background) color
- clip contents flag
Plumb artboard parsing + background rendering, and hook into viewer.
TBR=
Change-Id: Ib188245ce41a76197cf9e0937689adf8243826d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295244
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Like Vulkan, Dawn requires "early abandon", so that the wgpu::Device is
freed before the dawn_native::Instance which created it.
Bug: skia:10334
Change-Id: I72346b724868790ede69c3cb09641e9054ef738e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294602
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Our "header" reading and writing code didn't agree, so we always failed
to recognize cached program binaries. The asserts in the testing sink
failed to notice, because we did get a 100% cache hit rate, but we
immediately discarded the data we received.
We now also check that we didn't insert anything into the cache, as a
proxy for doing any shader compile work. That change, plus the tweak to
set cached=false when the header fields are invalid (like we do if we
encounter problems further in the blob) detected the problem. Adding the
version tag to the start of the encoded blob fixes the test, and means
that program binary caching is actually working again.
This code still looks (and is) fragile. The next CL is going to rewrite
things to use SkReadBuffer and SkWriteBuffer, make the parsing code less
brittle, and give us a more robust way to detect failure anywhere in the
stream.
Bug: skia:9402
Change-Id: I0329f088e0afce3998494d91ef2206e5eb9cac42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294599
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 8eeff5ccf3
Original change's description:
> Request specific ANGLE context versions.
>
> Using the ANGLE_create_context_backwards_compatible extension, request
> explicit ANGLE context versions to make sure test coverage of context
> versions matches Chrome.
>
> BUG=skia:10309
>
> Change-Id: Ifa4a36851a0517b369d094e5707348a20eaf3879
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293339
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Geoff Lang <geofflang@google.com>
Bug: skia:10309
Change-Id: Ida0f226a693354211f35c391bdc0b5bb285a2d3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293761
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
I can find no references to SkAtlasTextTarget in AOSP or in Chromium.
With google3 CL/314226466 there are no more uses in Google3.
Change-Id: I60b5f06fc17c0e4f8d008886c96645475e3d48e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293839
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Move the dawn_native::Instance ownership from DawnTestContextImpl to
DawnTestContext (its parent class), which owns the wgpu::Device.
dawn_native::Instance must outlive any wgpu::Devices created from it.
Bug: skia: 10311
Change-Id: Iedc4ed94f03b61d5e43cd5c93eb68e24bc4474e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293852
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Change-Id: I9dbe6020d67cc452c9cbbdeace68f1d01275b419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293559
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Using the ANGLE_create_context_backwards_compatible extension, request
explicit ANGLE context versions to make sure test coverage of context
versions matches Chrome.
BUG=skia:10309
Change-Id: Ifa4a36851a0517b369d094e5707348a20eaf3879
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293339
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Geoff Lang <geofflang@google.com>
This reverts commit 67e50a6b5c.
Reason for revert: roller complains about LICENSE issue. cl/314177415
Original change's description:
> Allow printf-style formatting to be used in SK_ABORT.
>
> SK_ABORT was already using SkDebugf to print the error message to the
> console, so all the moving parts were there. This CL just adds a
> mechanism for the calling code to pass in arguments.
>
> Added a use case to demonstrate usage--when an allocation fails, the
> requested size is now shown in the error message.
>
> Change-Id: I42f141151fb57a399c086926249816833f349ddb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293272
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=djsollen@google.com,bungeman@google.com,herb@google.com,johnstiles@google.com
Change-Id: I7a2e98bcda82bbe6edfa3d00057586754df0ee71
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293342
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SK_ABORT was already using SkDebugf to print the error message to the
console, so all the moving parts were there. This CL just adds a
mechanism for the calling code to pass in arguments.
Added a use case to demonstrate usage--when an allocation fails, the
requested size is now shown in the error message.
Change-Id: I42f141151fb57a399c086926249816833f349ddb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293272
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Working on debugging some multithreading and when a bot fails single owner, currently we get the unhelpful message "GrSingleOwner.h:33" with no backtrace. With this at least we get the real function.
Bug: skia:10305
Change-Id: I201ae96839bf9c043d009abc44a6ba784a9b9742
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293246
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
The C WGPUDevice returned by CreateDevice needs an Acquire call to
ensure it's correctly refcounted.
Bug: skia:10291
Change-Id: If5d917165b5846bea1472f24aa12db2db7f3a9e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292958
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
and rotations both have an effect on cache usage. Snapping translations to integer coordinations
reduces cache usage. Opacity of path painting does not have an effect on cache usage.
Bug: skia:10272
Change-Id: Id5d5f08cb43645c9ec44b9d8e5e96643041727c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292280
Reviewed-by: Kevin Lubick <kjlubick@google.com>
OOP-R, on the gpu thread, creates the DDL, pre-compiles its shaders, draws it, flushes and then deletes the DDL. This process triggered a bug (cf. https://skia-review.googlesource.com/c/skia/+/292818 and crbug.com/1056730).
Prior to this CL all the programs were compiled and only at the end was any work flushed - thus it was likely that the bound program would be reset to the correct value when rendering.
With this CL, the addition of the flush right before the DDL deletion, makes it more likely that the wrong program will be bound when rendering begins.
Change-Id: I60479bd429e132d8652bbffde6c8b71094be6225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292257
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 074414fed5.
Reason for revert: updated to guard against nullptr before calling
quickContains(rrect).
Original change's description:
> Revert "GrClips provided as pointers to GrRTC"
>
> This reverts commit 226b689471.
>
> Reason for revert: Breaks Android roller
>
> Original change's description:
> > GrClips provided as pointers to GrRTC
> >
> > A null clip represents no high-level clipping is necessary (the implicit
> > clip to the render target's logical dimensions is fine).
> >
> > This also removes GrNoClip and GrFixedClip::Disabled() since they are
> > replaced with just nullptr.
> >
> > By allowing nullptr to represent no intended clipping, it makes it easier
> > to require GrClip and GrAppliedClip objects to know about the dimensions
> > of the device. If we required a non-null clip object to represent no
> > clipping, we'd have to have an instance for each device based on its
> > size and that just became cumbersome.
> >
> > Bug: skia:10205
> > Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
> Reviewed-by: Weston Tracey <westont@google.com>
> Commit-Queue: Weston Tracey <westont@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com,westont@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Still some more work to do to remove internal usage.
Bug: skia:9832
Change-Id: Id0403d92debc26af2002630a4dfcf960c9343260
Docs-Preview: https://skia.org/?cl=292719
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292719
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 226b689471.
Reason for revert: Breaks Android roller
Original change's description:
> GrClips provided as pointers to GrRTC
>
> A null clip represents no high-level clipping is necessary (the implicit
> clip to the render target's logical dimensions is fine).
>
> This also removes GrNoClip and GrFixedClip::Disabled() since they are
> replaced with just nullptr.
>
> By allowing nullptr to represent no intended clipping, it makes it easier
> to require GrClip and GrAppliedClip objects to know about the dimensions
> of the device. If we required a non-null clip object to represent no
> clipping, we'd have to have an instance for each device based on its
> size and that just became cumbersome.
>
> Bug: skia:10205
> Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
Also enables ccpr and makes flags parsing more robust.
Change-Id: Ia98467403de87423a63167681b2ee635b0fa593a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292690
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).
This also removes GrNoClip and GrFixedClip::Disabled() since they are
replaced with just nullptr.
By allowing nullptr to represent no intended clipping, it makes it easier
to require GrClip and GrAppliedClip objects to know about the dimensions
of the device. If we required a non-null clip object to represent no
clipping, we'd have to have an instance for each device based on its
size and that just became cumbersome.
Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The new loader works by checking for a "slide" flag, and if it ends in
".skp", then we treat the slide name as a URL and try to pull it in with
an HTTP request and parse it as an SkPicture.
It is the user's responsibility to copy or link skps into their
canvaskit server directory.
Change-Id: Iaafa84300d36d2d5a0bb29c47761ec67076c0f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292204
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Together with similar programs in other repositories, this helps find
disagreements between Chromium's, Skia's and Wuffs' image decoders.
Change-Id: I9a0d8aabb47b1d5bd29f9139755e76bf56ab4bbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290618
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This reverts commit c80ee456ad.
fix: update flutter's gn file to add guard
Change-Id: Iac5171c8475d9a862d06255dab1c6f38f10de2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Parse embedded fonts into SkCustomTypefaces, and pass down the text
animation pipeline. Things seem to mostly work for Latin examples.
Most existing Lottie files come with embedded fonts (the option is
enabled by default), so to minimize disruption only use the new
feature as a fallback for typefaces which cannot be resolved otherwise.
Also introduce a builder flag to prioritize embedded fonts over native
(kPreferEmbeddedFonts), and plumb in existing tools for testing.
Change-Id: Ia2a659f76e354fea6081b0f2e0dce1d8bdf63c52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291180
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ifec54ef7948707f0d9811bc0b865223ad02822b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291181
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This is a trivial change which makes no practical difference except for
removing the green squiggle from Visual Studio and allow it to
understand that this is actually a real implementation of the
declaration.
Change-Id: I7b8542e801ee1cfd8a1698d5bf4adc092640dae1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290828
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Change-Id: I2d95c63de18125e6258709b48b03abd7904b7537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278596
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit ca06ce48f1.
Reason for revert: It is dying on a bot with the error:
skpbench.py: error: unrecognized arguments: --ddlNumRecordingThreads c:\b\s\w\ir\skp
Original change's description:
> Update skpbench to let the gpu thread run alongside the recording threads
>
> Bug: skia:10176
> Change-Id: Ibadd52b86abfd2802b9b3f31c86ab573554601db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289883
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=robertphillips@google.com,adlai@google.com
Change-Id: Iec316410563f0fe1d06f44bcfa58f6790c547f98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10176
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290117
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I4d4025fb842eb937785509bc7947f85f28a98ab8
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288551
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I2402394fa02d2e2e0957fe55e7c9088ddfeffcc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289483
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
`zu` is the expected specifier for a size_t. `li` can cause errors in
the Android build.
Change-Id: Ie418c9e8778a629acf47ae58a2720fd11a732c87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287896
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Add support for external precomp Skottie layers. This allows embedders
to seamlessly mix custom/Lottie content.
General flow:
* embedders register a PrecompInterceptor callback with
the animation builder
* at build time, Skottie invokes the callback for each pre-composed
layer
- the returned ExternalLayer implementation is used instead of the
Lottie layer payload
- (a nullptr value signals Skottie to use the usual Lottie payload)
* at render time, ExternalLayer::render() is called to defer content
rendering to the embedder
Also implement a sample PrecompInterceptor which attempts to substitute
precmp layers matching a given pattern with external Lottie animations:
precomp_name: "__foo.json" -> Animation("foo.json")
This new mechanism is a generalization of (and supersedes) the old
NestedAnimation hack - so we can remove that.
Change-Id: Id80fe11881c62b8717c2476117c7c03ad5300eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288130
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Catalina requires that we call [NSOpenGLContext clearCurrentContext]
when tearing down contexts. We were doing it in the GLWindowContext
destructor, but not when switching for MSAA.
Bug: skia:10134
Change-Id: I81be962419ca4afa724ab3f896081af4bbedda3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288157
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Selecting an MSAA option that the context does not support can cause
issues, so prevent those options from being displayed.
This fix was suggested by jvanverth@ during his review of
https://skia-review.googlesource.com/c/skia/+/287976
Bug: skia:10134
Change-Id: If8c35786da83e6ace336328281d7005cc75cf301
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288096
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: Icd317eb1b260e9640473e8a201a204a6e49bc002
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287916
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.
This change also removes the hard sync in vulkan during creation.
Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Id8394acf854f1c069c5fde449ede225b2d81968b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288056
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
According to the documentation at
https://developer.apple.com/documentation/appkit/nsopenglpfamultisample
this attribute is necessary to enable MSAA antialiasing.
(Unfortunately, even with this change, MSAA is still not working
properly in OpenGL.)
Change-Id: I1f59a4659d4891fc239ab4c56df7b134f0f5f2a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287996
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>