Commit Graph

4593 Commits

Author SHA1 Message Date
Brian Salomon
1caf3789f8 Revert "Add async rescale and read APIs to SkImage."
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>
2020-06-26 17:13:22 +00:00
Robert Phillips
e922953cab Adjust how GM::gpuSetup is handled in the tools
Change-Id: I7a49ff49030b4c8aba1f0798a3742641030fe44f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298710
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-26 15:37:30 +00:00
Brian Salomon
7ac9b5fdb6 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>
2020-06-26 15:25:10 +00:00
Robert Phillips
d26d25ed67 Make gpuSetup draw a error message on failure
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>
2020-06-26 13:50:35 +00:00
Adlai Holler
7580ad47b7 Add an sk_sp API for DDLs with a macro for staging
Chromium CL 2261229 adds the temporary opt-out.

Bug: skia:10425
Change-Id: I54f32f9389b31f8f83124ab1ea3f16f58cf248e8
Depends-On: Ie090d0cdcc4f6aeee1a845cecf699f4e2f7bd617
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298509
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-06-25 13:13:58 +00:00
Brian Salomon
9a5acc5a2d Add another make_get_error_with_random_oom valgrind suppression
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>
2020-06-24 22:15:33 +00:00
Greg Daniel
632db1c742 Revert "Make glPatchParameteri required when tessellation is supported"
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>
2020-06-24 20:48:42 +00:00
John Stiles
38b7d2f223 Add support for magenta highlights on shader mouseover in Metal.
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>
2020-06-24 16:55:53 +00:00
Brian Salomon
24069ebd23 Add GrContext::oomed() and implement for GL and VK.
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>
2020-06-24 16:04:06 +00:00
John Stiles
03b92cd667 Fix crash in Viewer when attempting to view shaders in Metal.
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>
2020-06-24 15:34:53 +00:00
Robert Phillips
900630c7cd Add GM::gpuSetup call in fm
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>
2020-06-24 15:16:56 +00:00
Robert Phillips
c23b732da6 Update viewer to call the gpuSetup GM entry point
Change-Id: Ic2562d985e144f25dcbb5cf40fafc86a33fb76c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298505
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Trevor Barton <trevor.barton@sydstu.catholic.edu.au>
Reviewed-by: Kobi Robinson <kobi.robinson@sydstu.catholic.edu.au>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-24 13:43:59 +00:00
Chris Dalton
7d7cd2b178 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>
2020-06-23 18:45:41 +00:00
Robert Phillips
f105d38d10 Update image_from_yuv_textures GM for *ooprddl configs
Change-Id: I01bd7f19457be16f081334bacec2d9b0b7141283
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297716
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-23 13:10:02 +00:00
Stephen White
362db5828f DawnTestContext: print validation errors with SkDebugf.
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>
2020-06-22 19:27:17 +00:00
Brian Salomon
0f39699192 Reland "Make it easier to test rectangle textures by using createBackendTexture."
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>
2020-06-22 16:13:04 +00:00
Michael Ludwig
553db62fde Reland "Centralize geometry processor vertex shader transform code"
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>
2020-06-22 14:52:05 +00:00
Greg Daniel
b57765532b Don't submit vk command buffer in updateBackendTexture.
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>
2020-06-20 13:13:03 +00:00
Michael Ludwig
ce86910dd8 Revert "Centralize geometry processor vertex shader transform code"
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>
2020-06-20 00:37:45 +00:00
Michael Ludwig
0426947243 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>
2020-06-19 20:26:05 +00:00
Florin Malita
579e63af00 [skrive] Reset the node system
Tacking another hierarchy on top of SkSG doesn't work well.

Let's start fresh.

TBR=
Change-Id: Ieb379b57e1a77df3c62048d3be7e81e1429f9b23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297807
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-06-19 20:00:55 +00:00
Derek Sollenberger
96f8db0323 Revert "Make it easier to test rectangle textures by using createBackendTexture."
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>
2020-06-19 19:14:39 +00:00
Brian Salomon
4e37751693 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>
2020-06-19 17:50:18 +00:00
Greg Daniel
d4928d03e2 Implement flush finish proc support for d3d backend.
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>
2020-06-19 16:28:33 +00:00
Kevin Lubick
df4e3ab185 HTML typo egde => edge
Same problem was in infra repo:
https://skia-review.googlesource.com/c/buildbot/+/297738
https://skia-review.googlesource.com/c/buildbot/+/132921

Change-Id: I686e293aaf2a6c09f388eef864d3ea143ca2f69e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297719
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-06-19 15:12:06 +00:00
Brian Osman
f847f3106c In SkSLSlide, directly use Viewer's shader error handler
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>
2020-06-18 19:24:02 +00:00
Ravi Mistry
346f8e0989 Change URL in skia_css3gradients_desktop.py
NoTry: true
Bug: skia:10390
Change-Id: I8afbf6303d9f42966456174381fa56909d9b1f53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296732
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2020-06-18 15:36:18 +00:00
Brian Osman
c85f1fa20f Support viewing/changing backend shaders in Viewer
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>
2020-06-16 21:03:53 +00:00
Robert Phillips
889d613875 Add GM::gpuSetup step
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>
2020-06-16 18:31:55 +00:00
Robert Phillips
5f0cda4ad4 Refine VkYcbcrSamplerHelper to only hold backend memory for YCbCr textures
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>
2020-06-16 14:05:30 +00:00
Robert Phillips
762cb4ea46 Add option to DDL test harness to better match OOP-R behavior
Change-Id: I043613c127dbfa1ebb7dcf5eab7b996afb676b61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296449
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-16 12:30:41 +00:00
Greg Daniel
9efe386978 Add SkSurface flush call that takes a GrBackendSurfaceMutableState.
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>
2020-06-12 20:40:54 +00:00
John Stiles
616da104ab Allow printf-style formatting to be used in SK_ABORT.
(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>
2020-06-12 20:26:34 +00:00
John Stiles
30212b7941 Fix implicit fallthroughs throughout Skia.
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>
2020-06-11 22:29:53 +00:00
Robert Phillips
85aa42820e Move VkYcbcrSamplerHelper's context functionality into VkTestHelper
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>
2020-06-11 19:39:21 +00:00
Robert Phillips
0d6ce7cc13 Split VulkanTestHelper out into its own files
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>
2020-06-11 13:49:33 +00:00
Nathaniel Nifong
cd0df4f7cd Add a basic readme to help the uninitiated build and run skpbench
Change-Id: Ib276f960f385c88392bca90924a9a42752e585ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295603
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-06-11 13:27:03 +00:00
Kevin Lubick
51891392d8 [canvaskit] Add benchmarks on SKPs
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>
2020-06-10 20:11:00 +00:00
Robert Phillips
ae413d8b81 Move VkYcbcrSamplerHelper to its own files
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>
2020-06-10 16:39:17 +00:00
Brian Osman
9e4e4c7e97 Reland "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.

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>
2020-06-10 14:55:37 +00:00
Mike Reed
90e82904b5 Revert "Switch persistent cache to use SkReadBuffer/SkWriteBuffer"
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>
2020-06-10 00:19:45 +00:00
Brian Osman
5fa11d4040 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>
2020-06-09 22:34:03 +00:00
Florin Malita
45cd20004c [skrive] Initial artboard plumbing
"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>
2020-06-09 19:58:38 +00:00
Greg Daniel
8a6e53ad22 Disable support for sample locations in vulkan.
Bug: skia:10346
Change-Id: Ie741fcf84a8c71d663f240d49c35fdbc5cb812e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295088
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-06-09 17:05:27 +00:00
Stephen White
37a46d2536 Dawn: fix for crash on GrContextFactory_sharedContexts unit test.
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>
2020-06-05 18:00:44 +00:00
Brian Osman
43f443f086 Fix caching of GL program binaries
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>
2020-06-05 15:54:19 +00:00
Geoff Lang
c3320be506 Reland "Request specific ANGLE context versions."
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>
2020-06-04 12:49:20 +00:00
Herb Derby
64aa5138c7 Remove SkAtlasTextTarget
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>
2020-06-04 03:52:35 +00:00
Stephen White
64c8b811b5 Dawn: fix memory corruption in DawnTestContext.
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>
2020-06-03 18:40:49 +00:00
Brian Salomon
392780277b Remove submit from async read pixels. User must submit.
Bug: chromium:1087118

Change-Id: Iab152ac483787fbdcca448aee0c4b9d2b354a92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292840
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-02 16:55:04 +00:00
Greg Daniel
aa9d99ff6b Add support for vk image sharing mode and handle queues xfers correctly.
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>
2020-06-02 15:58:28 +00:00
Joe Gregorio
e8121e57ab Revert "Request specific ANGLE context versions."
This reverts commit 8eeff5ccf3.

Reason for revert: Breaking the Win10 ANGLE bots. https://status.skia.org/repo/skia?commit_label=author&filter=search&search_value=ANGLE

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>

TBR=bsalomon@google.com,geofflang@google.com

Change-Id: I5be9651bdc5d72fd02049f3280f11fc32213c231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10309
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293536
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-06-02 12:27:06 +00:00
Geoff Lang
8eeff5ccf3 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>
2020-06-01 22:42:40 +00:00
John Stiles
7a8e394496 Revert "Allow printf-style formatting to be used in SK_ABORT."
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>
2020-06-01 19:32:08 +00:00
John Stiles
67e50a6b5c 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>
2020-06-01 18:49:37 +00:00
Adlai Holler
33dbd65611 Pass file and line number when asserting single owner
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>
2020-06-01 17:10:40 +00:00
Stephen White
f40cef851c Dawn: fix Device leak in DawnTestContext.
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>
2020-06-01 15:38:40 +00:00
Elliot Evans
b437d7b5e4 Add puppeteer perf for performance degredation related to transforming a complex path. Translations
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>
2020-05-29 20:17:14 +00:00
Robert Phillips
5dbcca5634 Update DDL test harness to better match OOP-R
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>
2020-05-29 15:58:05 +00:00
Michael Ludwig
7c12e28cf4 Reland "GrClips provided as pointers to GrRTC"
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>
2020-05-29 15:09:54 +00:00
Brian Salomon
c0d88a12d1 Remove SkSurface::MakeFromBackendTextureAsRenderTarget from public API
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>
2020-05-29 15:09:52 +00:00
Weston Tracey
074414fed5 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>
2020-05-29 12:55:44 +00:00
Chris Dalton
3e7d511de3 Add svg parsing to CanvasKit viewer.html
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>
2020-05-28 20:39:43 +00:00
Michael Ludwig
226b689471 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>
2020-05-28 18:55:13 +00:00
Chris Dalton
f3242c44cf Add an skp loader to CanvasKit viewer
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>
2020-05-28 17:29:28 +00:00
Nigel Tao
3ab9b1f8e9 Add convert-to-nia command-line program
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>
2020-05-28 15:08:08 +00:00
Mike Reed
4348097fd4 tell gms when they are being run in viewer
Motivated here: https://skia-review.googlesource.com/c/skia/+/291696

Change-Id: I7388c20fafc27684d55c1493a96fc3b5ccd88bea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292314
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-27 21:26:58 +00:00
Kevin Lubick
41fe8bc350 [canvaskit] Fix width/height API
Change-Id: I2c4e2e847de15c135fef24456903ff5ff819213d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292239
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-27 14:44:01 +00:00
Mike Reed
fd9745eee9 SkDrawLooper has not been supported by Skia for a while. Update dox and remove examples
Change-Id: I7ff5d06f85b5100947089c4376d98a2ab144a016
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292076
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-27 01:22:06 +00:00
Mike Reed
1f60733fb3 Revert "Revert "move onto new factories for SkMatrix""
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>
2020-05-21 16:58:39 +00:00
Mike Reed
c80ee456ad Revert "move onto new factories for SkMatrix"
This reverts commit 046c2b7d90.

Reason for revert: need to update/guard flutter

Original change's description:
> move onto new factories for SkMatrix
> 
> Just rename, no functional changes expected.
> 
> Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Ic74f177128913374b8c60b4df88f04cf72fbacb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:05:20 +00:00
Mike Reed
046c2b7d90 move onto new factories for SkMatrix
Just rename, no functional changes expected.

Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-21 15:04:09 +00:00
Kevin Lubick
4ad6b50df3 [canvaskit] Fix some other usages of .ready
Leftover from https://skia-review.googlesource.com/c/skia/+/291182

Change-Id: I7350839d43299846e9e9cbc58425013eb063b041
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-21 14:52:53 +00:00
Florin Malita
67ff541ac1 [skottie] Add support for embedded fonts (glyph paths)
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>
2020-05-21 01:27:34 +00:00
Greg Daniel
f83baf230c Fix D3d window context after submit change.
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>
2020-05-20 21:44:41 +00:00
Greg Daniel
49de1031d4 Reland "Remove deprecated flush calls."
This reverts commit 5e6d789ce4.

Reason for revert: Relanding with fix landed in chrome

Original change's description:
> Revert "Remove deprecated flush calls."
> 
> This reverts commit d8fd0bf574.
> 
> Reason for revert: chrome roll
> 
> Original change's description:
> > Remove deprecated flush calls.
> > 
> > Bug: skia:10118
> > Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10118
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10118
Change-Id: Ie24d7845a4ad75f95afe59037ea80a9f38082f13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290918
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-20 15:48:46 +00:00
Greg Daniel
5e6d789ce4 Revert "Remove deprecated flush calls."
This reverts commit d8fd0bf574.

Reason for revert: chrome roll

Original change's description:
> Remove deprecated flush calls.
> 
> Bug: skia:10118
> Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I49d35cdb258e632f645974c5ec62075d3392efe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290834
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:58:40 +00:00
Greg Daniel
781c2de9b2 Revert "Another missed flush call fix."
This reverts commit 2d3d45a625.

Reason for revert: reverting base CL for chrome roll

Original change's description:
> Another missed flush call fix.
> 
> TBR:bsalomon@google.com
> Change-Id: Ia9891916d41c2550b82e2e7222ec24bde7a939b6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290896
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Iac0c9b82f0a7e7748db3ef6d8724786e15b94db5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290832
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:53:38 +00:00
Greg Daniel
2d3d45a625 Another missed flush call fix.
TBR:bsalomon@google.com
Change-Id: Ia9891916d41c2550b82e2e7222ec24bde7a939b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290896
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-19 20:29:40 +00:00
Ben Wagner
dde503476e Correct TestTypeface::onCharsToGlyphs signature.
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>
2020-05-19 19:55:25 +00:00
Greg Daniel
d8fd0bf574 Remove deprecated flush calls.
Bug: skia:10118
Change-Id: I13758b5416784c296b8b5be9f3228230ac1be05f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290540
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-19 18:01:24 +00:00
Adlai Holler
e5c379d3a1 Reland "Update skpbench to let the gpu thread run alongside the recording threads"
This reverts commit 2403a1001b.

Reason for revert: Fixed bot failure

Original change's description:
> Revert "Update skpbench to let the gpu thread run alongside the recording threads"
>
> 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>

TBR=robertphillips@google.com,adlai@google.com


Bug: skia:10176
Change-Id: I1b57c91ed60b093440191274d1acb72d9e0c3b37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290443
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-05-18 15:12:47 +00:00
Brian Osman
28590d54f5 Add 'shader' as an alias for 'fragmentProcessor'
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>
2020-05-15 13:52:15 +00:00
Robert Phillips
2403a1001b Revert "Update skpbench to let the gpu thread run alongside the recording threads"
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>
2020-05-15 12:19:27 +00:00
Adlai Holler
ca06ce48f1 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>
2020-05-14 21:13:16 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Jim Van Verth
682a2f4de6 Add Direct3D swapchain support
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>
2020-05-14 14:23:02 +00:00
Eric Boren
3101370f0b [infra] chrome_release_branch: maintain the last 3 branches
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>
2020-05-13 18:13:13 +00:00
Adlai Holler
8e82123bef DDLTileHelper: Use SkAutoTArray instead of raw pointer
Noticed this while poking around.

Change-Id: Ibc371cc3dcf2ed4b1e029ec74b16bb41a4b8e592
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289017
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-05-12 16:26:05 +00:00
Adlai Holler
684838f1f5 Mark SkStringPrintf as SK_PRINTF_LIKE
Change-Id: I3d2ee8dca1d2e962794ce8c3c391779bff357f0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288762
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-05-12 15:22:14 +00:00
John Stiles
00ee8f58aa Fix format specifier in skpbench.
`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>
2020-05-06 20:57:14 +00:00
Florin Malita
fbddfbb9f3 [skottie] Introduce an external layer API
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>
2020-05-06 20:31:14 +00:00
Jim Van Verth
28d920a916 Fix OpenGL MSAA on Catalina.
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>
2020-05-06 19:55:04 +00:00
John Stiles
5daaa7f0f9 Limit the Viewer MSAA options to the context's max sample count.
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>
2020-05-06 19:54:44 +00:00
John Stiles
31964fd155 Qualify local constant strings with static, and remove unused strings.
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>
2020-05-06 17:36:44 +00:00
Greg Daniel
c1ad77cf48 Add finisehd proc to backend texture creation.
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>
2020-05-06 16:50:33 +00:00
Chris Dalton
de5003768b Remove SkPath::RawIter from tests/tools/samplecode
Change-Id: I66c1b4aee9b07a4db294ed0cd82d01f3097c6acb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287857
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-06 16:31:53 +00:00
Chris Dalton
c69d47954d Remove SkPath::RawIter from docs and examples
Change-Id: Ibfcc596855f35a1d08d85e602c7ef7ab9c39a315
Docs-Preview: https://skia.org/?cl=287893
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287893
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-06 14:00:59 +00:00
Jim Van Verth
517af96936 Fix colorspace in Viewer for Metal
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>
2020-05-06 13:00:19 +00:00
John Stiles
e1d9b10f9a Add missing NSOpenGLPFAMultisample attribute to the OpenGL pixel format.
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>
2020-05-06 12:44:29 +00:00