Commit Graph

5374 Commits

Author SHA1 Message Date
Greg Daniel
6aac1193a7 Add new GrSurfaceInfo class and related backend structs.
Bug: skia:12402
Change-Id: I45b2f71dcfa5843e2a19a8de7d34196a4d552905
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445176
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-09-18 00:41:07 +00:00
Eric Boren
14cc21fd99 [sk] Update asset download references to use SK
Change-Id: If3e838f22f1b99fd7a3b1c6bca0affd39f5573b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449843
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2021-09-17 16:55:53 +00:00
John Stiles
e7830650cb Update bloaty treemap to work on Python < 3.9.
`removeprefix` was only added to Python in March 2020. It isn't
available on Python 3.8.2, which is the default macOS Python installed
version.
https://www.python.org/dev/peps/pep-0616/

Change-Id: I7b8db0dfc55f1448cc72f41ba9a6ad5f099d48ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448259
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-13 17:20:49 +00:00
Florin Malita
2e4dc863da Fix skottie2movie gpu async crash
We need to ensure all async reads are completed before we finish
encoding -- otherwise late reads will fire from the GrContext destructor
and crash because the encoder is no longer valid.

Change-Id: I0065561d2411ddd202897e625a187592e40ced87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447184
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-09-11 15:49:19 +00:00
Michael Ludwig
ecc555540b Only terminate egl display once
Unblocks angle roller into skia that was triggering an assert in
EGLImageTest. In that test, there were two egl contexts created that
shared the same egl display. The child context was destroyed first,
and ANGLEGLContext's destroyGLContext() implementation always called
eglTerminate on the display. According to the egl spec you're not
supposed to do anything with the terminated display other than call
makeCurrent() to release any active context.

In this case, the child context's termination would cause the display
to be deferred until the parent context was destroyed. This triggered
a bug in ANGLE's D3D backend, leading to the assert. However, with
that fixed, we then trigger critical error messages about calling
eglDestroySurface, etc. in the parent context's destroyGLContext()
function since the display was terminated out from beneath it.

This change adds a rudimentary ownership tracking mechanism to the
ANGLEGLContext so that when a child context is cleaned up it won't
call eglTerminate on its display. This happens to avoid the bug in
ANGLE's D3D backend as well as silencing the critical warnings if it
were fixed.

Bug: skia:12413
Change-Id: I31f64189315a1921adbee204d11138272d4b40af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446182
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-09-07 23:48:46 +00:00
Brian Osman
cbfa34a58c Convert internal SkSL to use .eval()
Also update RELEASE_NOTES to describe new syntax.

Change-Id: I2666551b98f80b61ae3a48c92a9e306cdc7242b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 15:54:54 +00:00
Robert Phillips
46d7bd56f6 Move more Ops to skgpu::v1 namespace (take 2)
GrClearOp
GrDashOp

Bug: skia:11837
Change-Id: I9ada76c061154e769e7f486e7c57a93fd1d74907
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444636
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 18:57:02 +00:00
Robert Phillips
2af13c135b Reland "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 44b7568c8a.

Reason for revert: Google 3 CL has landed

Original change's description:
> Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
>
> This reverts commit 30a6b101f4.
>
> Reason for revert: Maybe blocking G3 roll?
>
> Original change's description:
> > Fix compilation w/ "skia_enable_svg = false" (take 2)
> >
> > Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Idf73d864108067ee1c34e88ee4e5236847abd582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444501
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 17:54:08 +00:00
Robert Phillips
5fe828accb Revert "Move more Ops to skgpu::v1 namespace"
This reverts commit f3158abda3.

Reason for revert: Broke Flutter build

Original change's description:
> Move more Ops to skgpu::v1 namespace
>
> GrClearOp
> GrDashOp
>
> Bug: skia:11837
> Change-Id: Ib65418952e7d4fb1e419e4942223823f22302b34
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443518
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ic181ced7f5f2a8ff834fdcfb4e5265b99eef1666
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444365
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 14:44:46 +00:00
Robert Phillips
f3158abda3 Move more Ops to skgpu::v1 namespace
GrClearOp
GrDashOp

Bug: skia:11837
Change-Id: Ib65418952e7d4fb1e419e4942223823f22302b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443518
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 14:03:55 +00:00
Robert Phillips
44b7568c8a Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 30a6b101f4.

Reason for revert: Maybe blocking G3 roll?

Original change's description:
> Fix compilation w/ "skia_enable_svg = false" (take 2)
>
> Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 22:31:00 +00:00
Robert Phillips
30a6b101f4 Fix compilation w/ "skia_enable_svg = false" (take 2)
Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:28:25 +00:00
Robert Phillips
31f763190f Move GrAtlasTextOp to skgpu::v1 namespace
Bug: skia:11837
Change-Id: I3dde13940e57763d5a8224cb1a4b555e904351d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442716
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-30 14:56:55 +00:00
Robert Phillips
2145390fbe Move GrTextureOp to skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ie99b1c512885404351d6917bbea751d99a2ca23e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442797
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-30 14:14:14 +00:00
Brian Osman
99ddd2a98d Remove (unused) geometry shader support
Bug: skia:8451 skia:10827
Change-Id: I5b38a1d72cd4558f8e2a92aaf9b12f05efce0923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442683
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-27 19:41:10 +00:00
Chris Dalton
2a26c50a62 Store the correct number of samples in GrProgramInfo
Bug: skia:11396
Change-Id: I9480b89635bd7a6bdff8ab4876c8eeafdbc27c8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442096
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-26 17:24:47 +00:00
Kevin Lubick
f611404816 [canvaskit] Remove the need for users to keep track of contexts.
We'll switch to the correct context when necessary (e.g. before
calls that talk to the GPU). This is achieved by adding in
calls at the JS layer to switch the context before making a call
that is known to talk to the GPU (e.g. draw calls on SkCanvas).

Another implementation that was considered was to add a C++
shim in GrGLInterface that would switch the context before
every call in the GPU - however, that seemed too difficult
and would add extra overhead if a single draw* call talks
to the GPU multiple times.

Bug: skia:12255
Change-Id: I96e4c6b41a5bfcc9913aeaca7ccb125358048ad3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432136
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-25 18:23:06 +00:00
Robert Phillips
24d622d6f9 Move the GrTessellationPathRenderer into the skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ic445e99adbe2d2ada64f98f9f516c198a247ef09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440876
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-25 17:16:28 +00:00
Greg Daniel
1e16937f47 Add more flexibility to GrVkRT to support DMSAA.
Support is added so we can differentiate between using discardable
msaa for normal msaa draws and using it for DMSAA. Before this
many asserts and checks throughout GrVk* assumed we could only have
discardable msaa if the actual render target was msaa.

After this change the only thing missing to enable DMSAA on Vulkan
is to fix GrProgramInfo to store the actual sample count the program
will use instead of the same count of the GrRenderTarget.

Change-Id: Ifdb9a3beb641f96f6dfebe3241ccc5a2c8770bb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441517
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-08-25 14:09:27 +00:00
Brian Osman
293497e77f Convert internal sample() calls to shade/filter/blend
Bug: skia:12302
Change-Id: I8cf958acf9214d0de903a4097647afd74f2a659e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441541
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 21:03:44 +00:00
Brian Osman
9f1e06aef9 Reland "Add sRGB 8888 colortype"
This is a reland of 0f7c10ef56

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I5b6bb28c4c1faa6c97fcad7552d12c331535714d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 12:56:32 +00:00
Brian Osman
405eb7b72f Revert "Add sRGB 8888 colortype"
This reverts commit 0f7c10ef56.

Reason for revert: Unhappy rollers

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reed@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ie199535b9b65ec7c7fef3c773452ea06bdbd2d9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441376
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-23 17:38:05 +00:00
Brian Osman
0f7c10ef56 Add sRGB 8888 colortype
A color type that linearizes just after loading, and re-encodes to sRGB
just before storing, mimicking the GPU formats that work the same way.

Notes:
  - No mipmap support
  - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
  - Needs better testing

This is a re-creation of reviews.skia.org/392990

Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-23 15:14:41 +00:00
Robert Phillips
e453fa063d Move some v1-only gpu/tessellate files to gpu/ops
This CL just moves the files and renames them. It doesn't move them into the skgpu::v1 namespace.

Bug: skia:11837
Change-Id: Iab322d0dc5b5d1cfd32436785081539dc85c18d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440776
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-08-19 19:56:46 +00:00
Robert Phillips
43e70f1913 Move 2 path renderers to skgpu::v1 namespace
Bug: skia:11837
Change-Id: I71c8e5b7221e0eb84400e0ddc1a8126d820d24bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440538
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-19 16:16:23 +00:00
Robert Phillips
832f3fbcae Move GrTessellationPathFlags to their own header (GrTessTypes.h)
Having this enum on GrTessellationPathRenderer forced it to be over-#included and was blocking making GrTessellationPathRenderer.h v1-only.

Bug: skia:11837
Change-Id: I80660ed659946d7aa555057c9f4fd1136b44cca0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440536
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-19 14:47:45 +00:00
Brian Osman
fcb5023819 Remove old color space configs from tools
This centralizes the new color-space parsing into SkCommandLineConfig,
and then wires that up in DM, nanobench, and skpbench. It also removes
all of the old config names that encoded both color type and space.

Change-Id: I9a63a97f1d153e7636a1fb974cc4071f5ada3184
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438377
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-18 14:34:44 +00:00
John Stiles
4498aa8ac7 Fix rewrite_includes to work in both Python 2 and 3.
This is patterned after http://review.skia.org/439776, but uses the
`six` library for Python 2/3 cross-compatibility.

Change-Id: If64c48c35d86b83c77316bb5536be6e7bd24c967
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439936
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-08-17 11:53:50 +00:00
Brian Osman
9ded59bbad Revert "Update rewrite_includes.py for python3"
This reverts commit bd40fb55bb.

Reason for revert: I give up.

Original change's description:
> Update rewrite_includes.py for python3
>
> Change-Id: Ib1b6f8c17554f8121bd2351b5b214e1b2a79f758
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439776
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=kjlubick@google.com,brianosman@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I6be08249f805cce00d35e28e457fe5628b447629
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-16 21:31:04 +00:00
Brian Osman
bd40fb55bb Update rewrite_includes.py for python3
Change-Id: Ib1b6f8c17554f8121bd2351b5b214e1b2a79f758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439776
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-16 19:07:20 +00:00
John Stiles
13c9f6690e Fix additional cases of variable shadowing.
These changes will allow us to enable shadowed-variable warnings.

Change-Id: I24ee7e198c1c77b58836237c37557c00452680e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-16 17:47:14 +00:00
Greg Daniel
0e9d34d33c Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call."
This reverts commit d90777ada3.

Reason for revert: relanding with fix to GrBackendTexture

Original change's description:
> Revert "Remove GrBackendFormat's textureType use from isFormatTexturable call."
>
> This reverts commit 832c817bc8.
>
> Reason for revert: uninitialized value in GrBackendTexture
>
> Original change's description:
> > Remove GrBackendFormat's textureType use from isFormatTexturable call.
> >
> > The goal of this change was to remove the use of GrBackendFormat::textureType()
> > from GrCaps::isFormatTexturable call. Instead we will always pass in a
> > GrTextureType into this call.
> >
> > To do this a lot of plumbing of GrTextureType was added to various call
> > sites. However, this CL halts the plubming up at the proxy level where we
> > get it from the GrBackendFormat still. Future CLs will continue removing
> > these call sites and others that use GrBackendFormat::textureType().
> >
> > Bug: skia:12342
> > Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: I354bbbf00be7a86c480009f3e7b36a8777a6bf3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:12342
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439338
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

# Not skipping CQ checks because this is a reland.

Bug: skia:12342
Change-Id: I151196f149f9e191d2975b8fe81334f4f8720744
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439339
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-08-13 22:37:13 +00:00
Robert Phillips
364ea352b0 Make remaining GrOp derived classes be skgpu::v1 only
I will follow up with a CL actually moving the newly V1-only files to their final homes and adding namespaces.

Bug: skia:11837
Change-Id: I0fed1a802ae93a4357c53cde2b665ad6ddb49a6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-13 20:21:15 +00:00
Greg Daniel
d90777ada3 Revert "Remove GrBackendFormat's textureType use from isFormatTexturable call."
This reverts commit 832c817bc8.

Reason for revert: uninitialized value in GrBackendTexture

Original change's description:
> Remove GrBackendFormat's textureType use from isFormatTexturable call.
>
> The goal of this change was to remove the use of GrBackendFormat::textureType()
> from GrCaps::isFormatTexturable call. Instead we will always pass in a
> GrTextureType into this call.
>
> To do this a lot of plumbing of GrTextureType was added to various call
> sites. However, this CL halts the plubming up at the proxy level where we
> get it from the GrBackendFormat still. Future CLs will continue removing
> these call sites and others that use GrBackendFormat::textureType().
>
> Bug: skia:12342
> Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I354bbbf00be7a86c480009f3e7b36a8777a6bf3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439338
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-08-13 20:05:32 +00:00
Greg Daniel
832c817bc8 Remove GrBackendFormat's textureType use from isFormatTexturable call.
The goal of this change was to remove the use of GrBackendFormat::textureType()
from GrCaps::isFormatTexturable call. Instead we will always pass in a
GrTextureType into this call.

To do this a lot of plumbing of GrTextureType was added to various call
sites. However, this CL halts the plubming up at the proxy level where we
get it from the GrBackendFormat still. Future CLs will continue removing
these call sites and others that use GrBackendFormat::textureType().

Bug: skia:12342
Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-13 19:03:21 +00:00
Robert Phillips
06273bcb8a Prepare headers for making all ops V1-only
Basically, ensure all the headers about to become V1-only only appear in contexts that are currently or will soon be V1-only.

This is almost all fallout from retracting some of the moving headers from other headers i.e.:

GrMeshDrawOp.h from GrOpFlushState.h
GrDrawOp.h from GrOpsRenderPass.h
GrDrawOp.h from GrOpsTask.h
GrSimpleMeshDrawOpHelper.h from GrTessellationShader.h


Bug: skia:11837
Change-Id: I939f5c82c3042e9ab00571b5796ab82dbe968085
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438677
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-12 15:09:11 +00:00
Greg Daniel
f4e176b98e Update Skia's internal vulkan headers to 1.2.
This is needed so we can support VK_EXT_image_drm_format_modifier. These
headers are just used internally in Skia so this should have no effect
on anyone using Skia.

Bug: skia:12336
Change-Id: I502f8e7dbbeb8e48ff03fb7ef0e5db3e8bcbb40d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438737
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-12 14:58:05 +00:00
Brian Salomon
4895946078 Move ProgramImpl definitions into Processor subclass headers.
Move ProgramImpl function definitions into Processor subclass cpp files.

Delete separate h/cpp files.

Modify GrGLSLVaryingHandler::addPassThroughAttribute to break #include
cycle. It now takes a ShaderVar rather than a GP::Attribute, making
it slightly more flexible as the input can be any variable defined
in the vertex shader.

Bug: skia:11358
Change-Id: I94ee8cd44d29e194216592ecae5fd28de785c975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 19:45:56 +00:00
Brian Salomon
bab2d11891 Improve consistency of GP::ProgramImpl subclasses
Named "Impl" and nested in GP or makeProgramImpl definition.

Remove unused INHERITED typedefs.

Remove GenKey pattern.

Bug: skia:11358
Change-Id: Icb4d5a0844184f51d92135de6cee6f6e77f57a5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438478
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-11 16:52:09 +00:00
John Stiles
488654b839 Fix cases of variable shadowing in /tools/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

(Turtle.cpp is #included from a cpp in the tools directory.)

Change-Id: I1685086ec0ceae1d51efa7daa0f46137b535ce77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438476
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-11 16:05:52 +00:00
Ben Wagner
160cd4b53c Fix leaks in skdiff
The skdiff code leaks some file names. Instead of augmenting the
existing manual ownership, give everything an owner.

Change-Id: I8bc2cb39ad4176bb3be645710ae28271f5b12ff9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437000
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-08-11 14:52:41 +00:00
Robert Phillips
53eaa64873 Rename GrSurfaceContext -> skgpu::SurfaceContext
Almost entirely mechanical.

Bug: skia:11837
Change-Id: I984339097fdeeae2eccb6c1d790d510020511961
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438177
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-10 19:24:53 +00:00
Brian Osman
68556bc798 Move canvas helper structs to header
This is necessary cleanup before changing the type of the matrix and
clip stack. That work has landed and reverted several times, so landing
this piece separately, first.

Change-Id: I147e4cc4260fa5e07a0712503f879da120f8466a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435278
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-10 17:53:16 +00:00
Brian Salomon
f95940bc23 Rename GrGLSLGeometryProcessor to GrGeometryProcessor::ProgramImpl
return from GrGP by unique_ptr, rename factory function to
makeProgramImpl()

Bug: skia:11358

Change-Id: I61dd36f770d2fc0b54de0e0e7b78ac4d3fbd119a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437741
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-10 14:36:40 +00:00
Michael Ludwig
49914e5813 Avoid unnecessary setting of display params in Viewer
I noticed Viewer lagging significantly when interacting with certain
sliders (such as transform state). It turns out that the UI tracking
would trigger calling Window::setRequestedDisplayParams and that in
turn can trigger a full context recreation, depending on backend.

I'd recently changed GPUs in my machine and apparently its context
creation is substantially slower than my previous one. Historically
I noticed minor jank when interacting, but it was never a deal
breaker.

This splits the parameter tracking into two categories so that lighter
weight widgets can still trigger window invalidation / re-rendering,
without triggering the context creation.

Change-Id: I3eb4c15b802f8b8ea8d8eca386de5dcee22ba9ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437685
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-09 17:38:28 +00:00
Brian Salomon
13b287386a Remove GLSL from name of functions that builds GrProcessor keys.
Bug: skia:11358
Change-Id: Ie70e45b18c12126c8e86700ad1040bc319be385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436998
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-09 14:01:13 +00:00
Michael Ludwig
a0438e6604 Remove SK_SUPPORT_DEPRECATED_CLIPOPS and expanding clip op defs
Bug: skia:10209
Change-Id: I72639b7e768742dcdec810a5a714ce21ff0f6e0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436565
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-06 19:15:13 +00:00
Brian Salomon
54fd96b5fa Fix Wunused-but-set-variable warnings
Change-Id: I0e093fd35b11e9a765ef9c09f3b6346086ff66bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435983
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-05 21:49:18 +00:00
Ben Wagner
a3f996c70d Fix skia_use_gl = false build
Fix a number of warnings as errors about unused private methods when
skia_use_gl is set to false and SK_GL is not set.

Change-Id: Idcc08a1434ec11a6ce9c8df034c9fa472bf08d08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436822
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-08-05 21:34:04 +00:00
Michael Ludwig
2f6e2f8410 Use SkClipOp::kFoo instead of kFoo_SkClipOp from SkClipOpPriv
The SkClipOpPriv.h header will be going away soon, but a number of
places still use its kIntersect_SkClipOp definitions instead of the
equivalent SkClipOp::kIntersect. Besides updating these references,
a number of unnecessary includes to SkClipOpPriv.h are removed and
some test cases exercising expanding clip ops are deleted since they
will be unnecessary shortly.

Bug: skia:10208
Change-Id: I2bbdd6bb39869134c6a80ef2b4482e6cabdeb0b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436157
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-03 18:08:21 +00:00
Brian Salomon
caa760e214 Fix -Wdeprecated-copy warnings
clang-14 has a new warning for deprecated implicit copy/assignment
if the other is written.

https://clang.llvm.org/docs/DiagnosticsReference.html#wdeprecated-copy

Change-Id: Iaeb23b2470ffa0be1953d1aed31bf0423c589893
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435880
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-03 16:06:11 +00:00
Robert Phillips
a3f206e0b8 Non-substantive changes for making v1::SurfaceDrawContext V1-only
Bug: skia:11837
Change-Id: I60112e370c95e6f9d9bc12cb9b05d40dd2220bc9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435279
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-02 19:22:58 +00:00
Robert Phillips
33bf2b56f9 Pipe all SDC creation through the recording context
In the new GrSurfaceContext class hierarchy we can get either a v1 or v2 SFC/SDC depending on the context options setting.

Bug: skia:11837
Change-Id: Ia25bc10b58bbbaf65a484b323d9d0eee471bb7ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435276
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-02 16:04:52 +00:00
John Stiles
126788e087 Simplify GetRuntimeBlendForBlendMode.
Now that we support sampling from an SkBlender inside a Runtime Effect,
we can leverage that to reuse the blends from SkBlender::Mode. This lets
us avoid hard-coding copies of every built-in blend function.

Change-Id: I51f380490611fbde943c16648999b4fd4e6a14a9
Bug: skia:12257, skia:12085
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434472
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-30 16:42:36 +00:00
Brian Osman
8adb625505 Revert "SkCanvas: switch from SkDeque to std::deque"
This reverts commit cc9d20f308.

Reason for revert: Wrong API pre-C++17

Original change's description:
> SkCanvas: switch from SkDeque to std::deque
>
> Bug: skia:10987
> Change-Id: If252f644dc3b8827356f9c7044c8e01fd0fc5afe
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434676
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,reed@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ica125d5ad04332d68f54dd544373fa29eaf2b69c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10987
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434856
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-30 12:52:37 +00:00
Brian Osman
cc9d20f308 SkCanvas: switch from SkDeque to std::deque
Bug: skia:10987
Change-Id: If252f644dc3b8827356f9c7044c8e01fd0fc5afe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434676
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-29 20:50:42 +00:00
Ravi Mistry
94df5d607c Add skia_motionmarksuites_desktop.py
Bug: skia:12292
Change-Id: I80b6d1a122ef4ea5f08c237cc8d77e18262bee84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434467
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2021-07-29 19:16:05 +00:00
Chisoon Jeong
109f54d200 Correct a typo in build_workaround_header.py
Change-Id: I356cfc0c59ada46d93130af136168489f6287c02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433898
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-07-29 13:06:01 +00:00
Robert Phillips
4dca83162b Rename GrSurfaceDrawContext to skgpu::v1::SurfaceDrawContext
This CL is mostly mechanical. It:

replaces "src/gpu/GrSurfaceDrawContext.h" #includes with
         "src/gpu/v1/SurfaceDrawContext_v1.h" and reorders

replaces "class GrSurfaceDrawContext;" with
         "namespace skgpu { namespace v1 { class SurfaceDrawContext; }}"

replaces "GrSurfaceDrawContext*" with "auto" where possible
replaces "rtc" with "sdc"
replaces "surfaceDrawContext" with "sdc"
replaces GrSurfaceDrawContext with skgpu::v1::SurfaceDrawContext
reflows parameters as needed

This CL does not try to:

make skgpu::v1::SurfaceDrawContext V1-only
minimize the skgpu and/or skgpu::v1 prefixes

Those two tasks will be accomplished in follow up CLs. This CL is just trying to get the bulk of the mechanical changes comprehensibly landed.

Bug: skia:11837
Change-Id: I6fe59080249d585df8f5d27c6b67569cdc35842f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-28 20:12:10 +00:00
Robert Phillips
294d687b69 Avoid OveridePaintFilterCanvas in Viewer when possible
Since:

https://skia-review.googlesource.com/c/skia/+/431539 (Feed all top-level GPU accessors through skgpu::BaseDevice (take 2))

The OveridePaintFilterCanvas now blocks access to the true SurfaceDrawContext that backs the top device of a GPU-backed SkCanvas. This is because the SkPaintFilterCanvas doesn't pass on SkCanvas::topDevice calls to the canvas it is wrapping so it always returns a SkNoPixelsDevice.

Given that accessing the top SDC is an incredibly specialized testing-only feature this CL keeps the feature working short-term w/o gumming up the public API.

Change-Id: I99012ba34c2800e0149251667156b412c4e8aa63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433362
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-27 15:46:02 +00:00
Chris Dalton
c3176002bc Lift the tessellation atlas into its own path renderer
Creates a new path renderer, GrAtlasPathRenderer, that handles all the
atlasing. Managing the atlas in its own path renderer gives us more
control over when atlasing happens in the chain, will allow us to more
easily use the atlas in kCoverage mode, and makes the clipping code
cleaner.

Bug: skia:12258
Change-Id: Ie0b669974936c23895c8ab794e2d97206ed140f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431896
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-23 23:02:58 +00:00
Michael Ludwig
cfd204a785 Rename/simplify SkCanvas::resetClip() and make recordable
AndroidFramework uses both their own custom display list (which could
handle resetClip with android-side changes) AND conventional picture
recording. In order for replace op emulation to work when they have
been recorded into a picture, we need to make it virtual and supported
in SkPicture.

This also renames the API to ResetClip() from ReplaceClip() and does not
have any additional arguments. Based on AF's usage pattern, it only n
needs to reset the clip to the surface bounds or the device clip
restriction, it seems best to reduce the API as much as possible before
it's adopted.

Bug: skia:10209
Change-Id: I37adb097c84a642f4254b8c0f9d4c7fea8d9abdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430897
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-07-23 19:05:42 +00:00
Robert Phillips
cc6e50f041 Prevent CircleOp from being tested with MSAA
Change-Id: I307322f2d5e66ef103bdeb791066d6bba11b70ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431636
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-23 19:05:40 +00:00
Chris Dalton
8854829351 Reland "Prefer the NV_framebuffer_blit extension over ANGLE"
This is a reland of 202ce887ec

Original change's description:
> Prefer the NV_framebuffer_blit extension over ANGLE
>
> The ANGLE/CHROMIUM glBlitFramebuffer requires full size blits, which
> is really bad for DMSAA. The NV extension does allow blits of
> sub-rectangles, so we prefer that one if it's available.
>
> Bug: skia:12176
> Bug: skia:12177
> Bug: skia:12234
> Bug: skia:12235
> Change-Id: I463ac631fff64ad564f294cf2f26be7410e8c356
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430576
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: skia:12176
Bug: skia:12177
Bug: skia:12234
Bug: skia:12235
Change-Id: I41d062f9894f5a81c78a37de27a288bc17812643
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431817
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-23 16:20:36 +00:00
Chris Dalton
e3f2a63db7 Revert "Prefer the NV_framebuffer_blit extension over ANGLE"
This reverts commit 202ce887ec.

Reason for revert: Need to update Chrome first to give us the NV one.

Original change's description:
> Prefer the NV_framebuffer_blit extension over ANGLE
>
> The ANGLE/CHROMIUM glBlitFramebuffer requires full size blits, which
> is really bad for DMSAA. The NV extension does allow blits of
> sub-rectangles, so we prefer that one if it's available.
>
> Bug: skia:12176
> Bug: skia:12177
> Bug: skia:12234
> Bug: skia:12235
> Change-Id: I463ac631fff64ad564f294cf2f26be7410e8c356
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430576
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:12176
Bug: skia:12177
Bug: skia:12234
Bug: skia:12235
Change-Id: Iaa9f82e1c0c935a67dd8f446d1513b2b0a98f725
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430819
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-22 04:58:39 +00:00
Chris Dalton
202ce887ec Prefer the NV_framebuffer_blit extension over ANGLE
The ANGLE/CHROMIUM glBlitFramebuffer requires full size blits, which
is really bad for DMSAA. The NV extension does allow blits of
sub-rectangles, so we prefer that one if it's available.

Bug: skia:12176
Bug: skia:12177
Bug: skia:12234
Bug: skia:12235
Change-Id: I463ac631fff64ad564f294cf2f26be7410e8c356
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-20 19:00:21 +00:00
Brian Osman
f57f12d53a Fix symbol escaping in bloaty_treemap
All JS strings are now single-quoted, so double-quotes don't need
escaping. There are some symbols (in fullsymbols mode) that contain
single quotes, though - so escape those instead.

Change-Id: Ibdcca5634413c6a5e292f81503fbbf89f3d52b0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430040
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-07-20 00:16:10 +00:00
Mike Reed
08d206be46 Print out picture version even if its unsupported
Change-Id: I1dd61924f7b72cdae1cc0cf530e39b052ae19add
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430216
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-20 00:11:39 +00:00
Mike Reed
4043111918 Purge 2020 picture versions
Pull a thread, and end up removing logs of old fontmgr code.

Change-Id: I73cebf9c011a99e9d12fd728e8677fcb0700407f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429338
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-07-19 19:35:49 +00:00
Chris Dalton
fe49b2c6f4 Run dmsaa on ANGLE es2 bots
Bug: chromium:1220246
Change-Id: I0e9db2e403455ccc5d75acc714aa8201db285afc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429678
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-19 16:05:39 +00:00
Brian Osman
3c1c4c0d25 Standardize strings and other cleanup in bloaty_treemap.py
Follow-up from reviews.skia.org/428959

Change-Id: I3a9baaf1744dcfcea372c5a0c73af31912888c0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429818
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-07-19 14:01:30 +00:00
Chris Dalton
7c79a871c0 Run dmsaa on ANGLE es3 bots
Bug: skia:11396
Change-Id: I4d8253e61e6458b21b4e851e0b77d220394ea65d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429040
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-17 04:18:32 +00:00
Mike Reed
c82ab0839f Stop using filterquality
Change-Id: I67d1a464618f1a54f4e3bd4e1409b1d91a90e66a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-17 03:11:32 +00:00
John Stiles
9671d0aa31 Add checkbox to Viewer to force-enable Runtime Blends.
In a perfect world, this should always render the same, just perhaps a
bit more slowly.

Change-Id: I750ad43142d4d192be4db7396989d978025179a8
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429101
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>
2021-07-16 21:11:28 +00:00
Brian Osman
060dd70d2c Add bloaty_treemap.py, for visualizing bloaty data
There is so much more that could be done here (some ideas in TODO
comments), but this greatly streamlines the process for average
developers to navigate the code-size of skia executables.

Currently, I'm using a locally built copy of bloaty, but we should see
about using DEPS or adding a fetch-able package to eliminate even more
friction.

Change-Id: I92186c0370a1ab8d2c8edd73932547402c43612d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428959
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-15 19:32:04 +00:00
John Stiles
b5ac66c874 Add utility function GetRuntimeBlendForBlendMode for testing.
This will help us write tests confirming that runtime blends work the
same as the built-in blends.

Change-Id: I2f94aa7bbbc7124d09b490fc7509a4c281025307
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427618
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-07-14 20:39:09 +00:00
Chris Dalton
6aaf00fa7e Add a "usesMSAASurface" arg to GrMeshDrawOp::onCreateProgramInfo
onCreateProgramInfo needs to know if DMSAA will be rendering to a
separate MSAA target in order to properly set up its pipeline and
shaders. This CL mostly just plumbs this unformation through, but also
cleans up FillRRectOp now that this information is available.

Bug: skia:12201
Change-Id: I7300d2725da72484a12bd0c9d3ad298ae81bff90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427577
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-13 20:22:31 +00:00
Chris Dalton
475c9758eb Move the DMSAA surface flag into the public API
Bug: skia:11396
Change-Id: Iad175ea9727e0b18b94a7af341c831e03da46880
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427484
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-13 19:21:00 +00:00
Robert Phillips
a92913e169 Make GrAuditTrail V1-only
This CL has some rough edges since some classes that use it (e.g., GrOpsTask) aren't yet V1-only. That said, the big CL has to be broken up somehow.

Bug: skia:11837
Change-Id: I41ed9982ca4664f893e447ba23c7aec59f42c964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426416
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-13 13:56:53 +00:00
Robert Phillips
5e1aa8b665 Misc skgpu cleanup
This CL:
  finishes off some renaming I missed earlier
  removes some extraneous #includes from headers

TBR=bsalomon@google.com
Bug: skia:11837
Change-Id: If7163435a44d4067dac041a7f9e68b1ad63432d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426037
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-09 15:06:16 +00:00
Mike Reed
cce0b60b18 More (no more) getBlendMode cleanup
Bug: skia:12173
Change-Id: I81ed805c489024860d4e1d0601413a78c04f1010
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426006
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-08 20:28:24 +00:00
Robert Phillips
72354b0593 Move more gms and tests into the V1-only pile
Making GrDrawRandomOp and test_ops V1-only drags several GMs and tests with them. All the other GMs/tests explicitly require Ops.

Bug: skia:11837
Change-Id: I45c0a1054c3b1ec43f509595c6492581d10314cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425016
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-08 17:38:36 +00:00
Chris Dalton
7a0541e03d Run cmdbuffer_es2_dmsaa on the bots
Bug: skia:11396
Change-Id: I793cbce7efab5330a8c4eb41ce2cf425b29aeb15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-08 17:31:47 +00:00
Brian Osman
8c26479048 Remove large swaths of code related to .fp files
Change-Id: Id2061ebe7873aa8b9480a2d8b0133c2fb79e79bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424098
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-08 16:53:47 +00:00
Mike Reed
90f4e9f5f7 Hide getBlendMode()
... since it mysteriously returns something even if the blender doesn't
map to any enum. Clients should use asBlendMode() or getBlendMode_or().

Change-Id: I5dc5aea51f47f297ef9b2a89535d47ac58aea9bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425177
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-07 20:55:26 +00:00
Robert Phillips
7cef6789fd Change architecture #defines to be SK_GPU_V1 and SK_GPU_V2
A strictly mechanical CL

Bug: skia:11837
Change-Id: Id794d1fefe261d685b19e5d4d599cdab5e021cf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424038
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-01 18:42:53 +00:00
Robert Phillips
1a82a4ea49 Remove GrResourceProvider.h from all other header files
According to
https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html
these account for 583,146,886 bytes of input to the compiler, or roughly
0.25% of the input used to build Chrome.

Bug: chromium:242216
Change-Id: I2d5b73db770dba296df18c02a251da21e82b9ec0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423836
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-07-01 15:25:14 +00:00
Kevin Lubick
2d1b7165a4 [fiddle] Update named fiddles
//tools/fiddle/make_all_examples_cpp.py had not run in a while, so
some of these fiddles were not being compiled regularly and bit-rotted.

A follow-up CL will try running that script as a presubmit.

Change-Id: Ib851cb5d70485e354de3388abf56666492335d46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423956
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-01 15:20:14 +00:00
Robert Phillips
36a5dffa6f Revert "Clear the tile backend textures when drawing DDLs"
This reverts commit 0734c6223c.

Reason for revert: This was fixing the symptom and not the disease

Original change's description:
> Clear the tile backend textures when drawing DDLs
>
> It appears that the flutter SKPs don't contain an initial clear so the background can be random noise.
>
> This only appears to be an issue for the Metal backend.
>
> Change-Id: I4f5c823cdb1a0a76c0704d4d48355c3a0ed75d43
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423316
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,reed@google.com,michaelludwig@google.com

Change-Id: Iaa52a66248cef2896fc310ee199c3cef7029e532
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423581
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-30 20:10:30 +00:00
Robert Phillips
0734c6223c Clear the tile backend textures when drawing DDLs
It appears that the flutter SKPs don't contain an initial clear so the background can be random noise.

This only appears to be an issue for the Metal backend.

Change-Id: I4f5c823cdb1a0a76c0704d4d48355c3a0ed75d43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423316
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-30 18:56:35 +00:00
Brian Osman
2f5466e2b3 Initialize fBackend in Window_unix
Discovered while trying to run viewer in ASAN

Change-Id: Ic7469fdbf8cb77573c2f93503440b2137bdba783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423016
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-06-29 14:33:26 +00:00
Chris Dalton
661abd0f8d Reland "Use GL_ANGLE_instanced_arrays"
This is a reland of 76b80eca64

Original change's description:
> Use GL_ANGLE_instanced_arrays
>
> It turns out the es2 command buffer has supported instanced rendering
> all along. We just weren't using it! This CL starts using
> GL_ANGLE_instanced_arrays, after which point chrome es2 will start
> taking many of our instanced codepaths. It can even use tessellation if
> we update the shaders to not rely on gl_VertexID.
>
> Bug: chromium:1220246
> Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: chromium:1220246
Change-Id: I4d6f74adff4e2eda4b55a459faf16b5f5a230d06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 21:49:46 +00:00
Chris Dalton
e0f4de6f23 Add a cmdbuffer_es3 config
Adds the ability to create an es3 command buffer context, but does not
yet begin testing it because libcommand_buffer_gles2.dylib needs to be
updated first to respect the EGL_CONTEXT_CLIENT_VERSION attrib. Adds a
version check on the context as well to verify we actually get an es3
context when we ask for one.

Bug: chromium:1220246
Change-Id: I996f482d8ad831b81f873e1bfd2f0526e5f1e73e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419616
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-28 18:30:56 +00:00
Chris Dalton
040728364d Revert "Use GL_ANGLE_instanced_arrays"
This reverts commit 76b80eca64.

Reason for revert: Chrome layout test diffs

Original change's description:
> Use GL_ANGLE_instanced_arrays
>
> It turns out the es2 command buffer has supported instanced rendering
> all along. We just weren't using it! This CL starts using
> GL_ANGLE_instanced_arrays, after which point chrome es2 will start
> taking many of our instanced codepaths. It can even use tessellation if
> we update the shaders to not rely on gl_VertexID.
>
> Bug: chromium:1220246
> Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I62c25be4f6cf6937c0b5ab6e765a7113aad76916
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1220246
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422441
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 16:12:11 +00:00
Kevin Lubick
8fd0ccfc9f [skottie] Update lotties_with_assets to include all lotties from lottie-samples
The make_lotties_with_assets is a handy tool to take a
directory of lottie files and move them into their own
folders. This will make it easier to add assets (e.g. fonts,
images) if we want to get more accurate benchmarks.

This also makes the test not stop on the first failure, but complete
all of them, so we can see more easily if multiple things have broken.

Change-Id: Idb2ece71376a11e7524cd513a2798884a44bb59f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421927
Reviewed-by: Florin Malita <fmalita@google.com>
2021-06-28 14:59:24 +00:00
Kevin Lubick
bd71936196 [canvaskit] Document perf-canvaskit-puppeteer
We also catch any errors that happen during running the
test or flushing. This allows them to show up in the CI logs.

For skottie-frames in particular, we stop clearing the canvas
before each render, as that was masking an error (and not how
we do things on skottie.skia.org).

Change-Id: I83936a35b6c314da76a0a64e15deaabd156e71f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421923
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-28 14:59:24 +00:00
Chris Dalton
76b80eca64 Use GL_ANGLE_instanced_arrays
It turns out the es2 command buffer has supported instanced rendering
all along. We just weren't using it! This CL starts using
GL_ANGLE_instanced_arrays, after which point chrome es2 will start
taking many of our instanced codepaths. It can even use tessellation if
we update the shaders to not rely on gl_VertexID.

Bug: chromium:1220246
Change-Id: I173f4c07771691143d2540ecb9c3f8222ed8e4b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422379
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-28 14:58:39 +00:00
John Stiles
7bf799956d Reland "Add format-specifier warnings to SkDebugf."
This is a reland of e58831cd95

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:12143
Change-Id: Id3c0c21436ebd13899908d5ed5d44c42a0e23921
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421918
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 17:57:43 +00:00
Tyler Denniston
283dba5785 Revert "Add format-specifier warnings to SkDebugf."
This reverts commit e58831cd95.

Reason for revert: looks like breaking a few build bots

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I07848c1bf8992925c9498e916744d0840355a077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421917
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-25 13:33:10 +00:00
John Stiles
e58831cd95 Add format-specifier warnings to SkDebugf.
This CL fixes up many existing format-specifier violations in Skia.
Note that GCC has a warning for formatting nothing, so existing calls to
`SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
These were apparently meant to be used as a place to set a breakpoint.

Some of our clients also use SkDebug with bad format specifiers, so this
check is currently only enabled when SKIA_IMPLEMENTATION is true.

Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 11:05:59 +00:00
Kevin Lubick
bd7ed7434a [canvaskit] Fix font.getGlyphID test
The previous version accidentally retrieved all values from
the in memory glyph cache because it was always measuring
the range 1-300. This changes the glyphID to always be an
increasing number, which avoids the cache hits.

There is now some differences between the font types:
 - ttf: ~4ms
 - woff: ~160ms
 - woff2: ~230ms

The high numbers in the woff categories are expected to be
fixed by https://skia-review.googlesource.com/c/skia/+/420578

Bug: skia:12112
Change-Id: I52f6f7baf27fc28b99ac65a067142281918d7298
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421324
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-24 18:27:49 +00:00
Joe Gregorio
cd9890a0da Remove disabled_examples.txt
It is no longer used. The example runner uses the registry and fiddle
checks for the '#if'.

Change-Id: I1213702e89cc4927108eeeabcc10501b30eab934
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205588
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
2021-06-24 17:47:50 +00:00
Chris Dalton
83420eb817 Rewrite tessellation atlases as normal render tasks
Rewrites tessellation atlases as normal render tasks instead of
"onFlush" tasks. These tasks get inserted into the DAG upfront, lay
out their atlases as dependent tasks get built and reference them, and
finally add their ops to render themselves during onMakeClosed. Doing it
this way allows us to pause the flush and re-render the atlas whenever
it runs out of room.

Bug: b/188794626
Bug: chromium:928984
Change-Id: Id59a5527924c63d5ff7c5bce46a88368e79fc3ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420556
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-06-24 01:44:19 +00:00
Greg Daniel
095185d175 Ignore another vk extension implemented by nvidia but not in validation layers yet.
Change-Id: I015cc2401c9f4a87fa7a02a93890bcf0a6704a91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420901
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-06-23 17:08:35 +00:00
Kevin Lubick
0ba3bbf778 [canvaskit] Add perf tests for different font formats
As is, all 3 formats have a median time of about 0.12 milliseconds.

Perhaps the performance hit is more strongly felt on larger font
files.

Bug: skia:12112
Change-Id: Ifb4b0aa5a8240d93e94f4b674d0a50e6009887ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420097
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-22 12:09:50 +00:00
Chris Dalton
685e09b31a Reland "Purge ccpr"
This is a reland of 7bf6bc0d06

Original change's description:
> Purge ccpr
>
> Now that the clip atlas has been successfully migrated to
> tessellation, we don't need this code anymore!
>
> Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Change-Id: If0be86902e7cc4755eba91a89be1ec1a6a4b54b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419720
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-19 18:42:38 +00:00
Brian Osman
2421b9901b Remove spurious semicolons (should fix Chrome roll)
Change-Id: Ib45c569e3bbfeb41003ca9c261408840fb0af9dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419897
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-06-19 17:48:08 +00:00
Brian Osman
fe83ab6706 Revert "Purge ccpr"
This reverts commit 7bf6bc0d06.

Reason for revert: Android build references kCoverageCounting

Original change's description:
> Purge ccpr
>
> Now that the clip atlas has been successfully migrated to
> tessellation, we don't need this code anymore!
>
> Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=robertphillips@google.com,brianosman@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: I01d99287978f848eb8bf900c07cba90ceb3b6edc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419898
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-19 15:13:19 +00:00
Chris Dalton
7bf6bc0d06 Purge ccpr
Now that the clip atlas has been successfully migrated to
tessellation, we don't need this code anymore!

Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-18 21:46:36 +00:00
Robert Phillips
71143950f4 Switch GrMeshDrawOp::Target to be the stand alone GrMeshDrawTarget class
The Tessellator classes will survive in the NGA and they use
GrMeshDrawOp::Target - but GrMeshDrawOp will not survive.

This is a prelude to making all the remaining GrOp-derived classes OGA-only.

Bug: skia:11837
Change-Id: I62dc92e5f42d672342113f12dcedf3435fab993f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419198
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-06-17 19:57:43 +00:00
Robert Phillips
294723d690 Move GrOp::VisitProxyFunc to GrTypesPriv.h GrVisitProxyFunc
This is almost purely a query/replace CL (% the #include juggling).
The VisitProxyFunc is used by more than just the Ops and will probably
still be required in the NGA.

This is a prelude to making all the remaining GrOp-derived classes OGA-only.

Bug: skia:11837
Change-Id: If1c127e5c126c676be529ed2a61dd7953abb03d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419162
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-17 17:23:35 +00:00
Greg Daniel
e8502cc73c Add another new nvidia vk extension not covered by layers.
Change-Id: Ia1c775fffff7086ecc1e672792921d2146abd0f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419158
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-06-17 16:08:53 +00:00
Brian Osman
cc2d073020 Remove SkPaint::getHash
This was a particularly bad hash (A == B didn't imply
hash(A) == hash(B)). It was also entirely unused.

Change-Id: Id923bf1035effce04e12b1cc01d1c6aa4d11fdb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419336
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-06-17 14:59:23 +00:00
Robert Phillips
3674f589ee Make GrPathRenderer and all derived class be OGA-only
Bug: skia:11837
Change-Id: I92aacf8b412d0158036a5f27aa767590e426bd5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417657
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-16 17:09:37 +00:00
Chris Dalton
9a1d38c455 Convert spaces to tabs in wasm gm Makefile
Change-Id: Id6622be9e99e2db472bc3c658baf024b47751f04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419016
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-16 16:58:07 +00:00
Ethan Nicholas
d2e0960696 Removed SkSL::StringFragment in favor of string_view
This CL preserves the "StringFragment" name as an alias for
string_view to reduce the impact. The StringFragment alias
will be removed in a followup CL.

Change-Id: I89209bc626b0be0d0190823b6217f4c83cafe1bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416736
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-06-10 16:08:13 +00:00
Mike Reed
1d113ed1d9 Remove unreferenced hello world example
Change-Id: Id2f0b65a28424868e1b897688bcd451041698da4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-06-09 15:41:49 +00:00
John Stiles
cb3f56f68f Fix strings in header files.
`constexpr char` arrays in header files generate a separate object in
each translation unit; we should add `inline` to these.

http://go/totw/140#within-a-header-file-beware

Change-Id: I7e2dd8f81053577127e349e9dc4a691e432c2c05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416780
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-06-09 15:12:29 +00:00
Robert Phillips
516405c5b0 Add option to switch between OGA and NGA SkGpuDevices
Bug: skia:11837
Change-Id: Id52f05a055c97cd2644bc70d600e9313766f6730
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415796
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-07 15:23:40 +00:00
Michael Ludwig
785ecad487 Disable VK_NV_acquire_winrt_display in our apps
The GTX 1080 Ti with driver version 466.47 wants to enable
VK_NV_acquire_winrt_display, which depends on VK_EXT_direct_mode_display
but VK_EXT_direct_mode_display is not one of its available device
extensions. This leads to correct validation errors that prevent viewer
from launching in debug mode.

Change-Id: I989477861007d7a5baa529698ffd86910618b9f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415173
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2021-06-03 19:14:38 +00:00
Robert Phillips
fa8af0a545 Add methods to access the top device's render target proxy
While the SDC-accessing versions have to stick around due to their
usage in unit tests, they will return null when exercising the NGA.
The render-target-proxy versions will work in both the OGA and NGA
and should, thus, be prefered.

Bug: skia:11837
Change-Id: I36213472e46e9da3ae6561f80d413090ceb6ad3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415058
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-06-03 18:16:27 +00:00
dependabot[bot]
4377bc917f Bump ws from 7.3.0 to 7.4.6 in /tools/perf-canvaskit-puppeteer
Bumps [ws](https://github.com/websockets/ws) from 7.3.0 to 7.4.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/websockets/ws/releases">ws's releases</a>.</em></p>
<blockquote>
<h2>7.4.6</h2>
<h1>Bug fixes</h1>
<ul>
<li>Fixed a ReDoS vulnerability (00c425ec).</li>
</ul>
<p>A specially crafted value of the <code>Sec-Websocket-Protocol</code> header could be used
to significantly slow down a ws server.</p>
<pre lang="js"><code>for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
  const value = 'b' + ' '.repeat(length) + 'x';
  const start = process.hrtime.bigint();
<p>value.trim().split(/ *, */);</p>
<p>const end = process.hrtime.bigint();</p>
<p>console.log('length = %d, time = %f ns', length, end - start);
}
</code></pre></p>
<p>The vulnerability was responsibly disclosed along with a fix in private by
<a href="https://github.com/robmcl4">Robert McLaughlin</a> from University of California, Santa Barbara.</p>
<p>In vulnerable versions of ws, the issue can be mitigated by reducing the maximum
allowed length of the request headers using the <a href="https://nodejs.org/api/cli.html#cli_max_http_header_size_size"><code>--max-http-header-size=size</code></a>
and/or the <a href="https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener"><code>maxHeaderSize</code></a> options.</p>
<h2>7.4.5</h2>
<h1>Bug fixes</h1>
<ul>
<li>UTF-8 validation is now done even if <code>utf-8-validate</code> is not installed
(23ba6b29).</li>
<li>Fixed an edge case where <code>websocket.close()</code> and <code>websocket.terminate()</code> did
not close the connection (67e25ff5).</li>
</ul>
<h2>7.4.4</h2>
<h1>Bug fixes</h1>
<ul>
<li>Fixed a bug that could cause the process to crash when using the
permessage-deflate extension (92774377).</li>
</ul>
<h2>7.4.3</h2>
<h1>Bug fixes</h1>
<ul>
<li>The deflate/inflate stream is now reset instead of reinitialized when context
takeover is disabled (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/1840">#1840</a>).</li>
</ul>
<h2>7.4.2</h2>
<h1>Bug fixes</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f5297f7090"><code>f5297f7</code></a> [dist] 7.4.6</li>
<li><a href="00c425ec77"><code>00c425e</code></a> [security] Fix ReDoS vulnerability</li>
<li><a href="990306d144"><code>990306d</code></a> [lint] Fix prettier error</li>
<li><a href="32e3a8439b"><code>32e3a84</code></a> [security] Remove reference to Node Security Project</li>
<li><a href="8c914d18b8"><code>8c914d1</code></a> [minor] Fix nits</li>
<li><a href="fc7e27d12a"><code>fc7e27d</code></a> [ci] Test on node 16</li>
<li><a href="587c201bfc"><code>587c201</code></a> [ci] Do not test on node 15</li>
<li><a href="f672710797"><code>f672710</code></a> [dist] 7.4.5</li>
<li><a href="67e25ff502"><code>67e25ff</code></a> [fix] Fix case where <code>abortHandshake()</code> does not close the connection</li>
<li><a href="23ba6b2922"><code>23ba6b2</code></a> [fix] Make UTF-8 validation work even if utf-8-validate is not installed</li>
<li>Additional commits viewable in <a href="https://github.com/websockets/ws/compare/7.3.0...7.4.6">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ws&package-manager=npm_and_yarn&previous-version=7.3.0&new-version=7.4.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/skia/network/alerts).

</details>

This is an imported pull request from
https://github.com/google/skia/pull/80

GitOrigin-RevId: a9a98b522212ab86f81c15979a3550ea7e276edb
Change-Id: Ia61edf467fb25d96bed7066b9355975005ca6393
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415377
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2021-06-03 16:21:18 +00:00
John Stiles
52cb1d059d Rename GrXferProcessor::DstProxyView to GrDstProxyView.
At present, only Xfer processors allow reading back from the destination
image since they are in charge of blending. However, we'd like to expose
the destination color to fragment processors and Runtime Effects in the
future. To make this possible, the DstProxyView will need to be
accessible outside of Xfer processors.

This CL migrates DstProxyView to be a top-level Ganesh class and fixes
up the references to it throughout Skia. It's interesting to note that
several call sites were already using typedefs to hide the class
nesting anyway.

Change-Id: I93a294aa097f9319a968503c4f2f7e4f388ff033
Bug: skia:12066
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414899
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-06-02 18:00:47 +00:00
Nathaniel Nifong
2e76c84b8b Use WebGL2, not EGL, and don't use replace clip op.
Change-Id: I9e6ae22a646b9cf1f3c20857ffc50ecafe66174a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414903
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-06-02 17:00:19 +00:00
Brian Salomon
7db0e2f942 Remove wrapping of GL sync objects around EGL syncs in EGL test contexts
We did this to allow pipelining of GPU/CPU work in nanobench on devices
that don't have GL sync objects (or NV fence). However, we've found
that on the AndroidOne/Mali400 and Nexus7/Tegra3 devices that the
majority of a frame's work can be reordered to complete before an
earlier EGL sync. This makes the results unreliable, especially the
min_ms result. Just accept that we will sync the CPU and GPU on these
devices.

Change-Id: I04d168cbb05504d367f6a06b7b4903163ab2aa79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414897
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-06-02 16:21:43 +00:00
Brian Salomon
e60d268bd6 When faking GLsync with EGL insert eglSwapBuffers
A redo of https://skia-review.googlesource.com/c/skia/+/412636

Change-Id: Ib1a00e3404cab04a37d5a8f2c1fdcb74f54412a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412658
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-06-01 15:12:43 +00:00
Brian Osman
ce9d8e143d Remove all traces of OpenCL
Change-Id: I4e00edd2d1572c3e2c1fcb56824239c166253cbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412958
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-27 19:17:17 +00:00
Eric Boren
64c848b384 [infra] Delete bin/try* and tools/chrome_release_branch*
These have been replaced by `sk try` and `sk release-branch`,
respectively.

Change-Id: Idc297dd7c84a87a09f69f310de495f91fcce36b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409898
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-05-27 14:27:20 +00:00
Adlai Holler
59adca5082 Revert "Temporarily disable reordering on bots again"
This reverts commit 789ec0533e.

Reason for revert: Not ready for this yet

Original change's description:
> Temporarily disable reordering on bots again
>
> To be landed after CL 412636. This should give us a clearer picture of
> the perf impact of reordering, now that the fence issue is mitigated.
>
> Will flip it back after perf runs.
>
> Bug: skia:10877
> Change-Id: I255c68f148f7aaebacb2469a56b7eade6d41696c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412638
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Idef91adade6f2814e472c70f71bd8d1b51aa4fa8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412665
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-05-26 18:46:40 +00:00
Adlai Holler
789ec0533e Temporarily disable reordering on bots again
To be landed after CL 412636. This should give us a clearer picture of
the perf impact of reordering, now that the fence issue is mitigated.

Will flip it back after perf runs.

Bug: skia:10877
Change-Id: I255c68f148f7aaebacb2469a56b7eade6d41696c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412638
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-05-26 18:40:39 +00:00
Brian Salomon
aaccd85ac0 Revert "When faking GLsync with EGL insert eglSwapBuffers"
This reverts commit 3af709f71a.

Reason for revert: going to try double buffering sksurfaces instead

Original change's description:
> When faking GLsync with EGL insert eglSwapBuffers
>
> Change-Id: I5db86b4b0d695e74c14d48c9c29464dade2af442
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412636
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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

Change-Id: I908313e46385bb933d4ec46ffcdae1e628690821
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-05-26 17:47:59 +00:00
Brian Salomon
3af709f71a When faking GLsync with EGL insert eglSwapBuffers
Change-Id: I5db86b4b0d695e74c14d48c9c29464dade2af442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412636
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-05-26 15:46:48 +00:00
Chris Dalton
569c01bfa2 Simplify heuristics for selecting path tessellators
Now that hardware tessellators chop, support raw triangles, and can
handle any path, we don't need complicated logic anymore to determine
when we can't use them. This CL simplifies the criteria for selecting
a tessellation algorithm and adds a fAlwaysPreferHardwareTessellation
context option to override it.

Bug: skia:10419
Change-Id: I8492e8f285ff27eb9d0dd6b1e9817dbeeb386c63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411496
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-05-25 17:23:02 +00:00
Brian Salomon
5cc24c07bb YUVUtils function for splitting image into yuva planes.
Makes the code from yuv_splitter reusable and able to produce subsampled
planes.

Bug: chromium:1210557
Change-Id: Icce112658bbdb866c3ecb9dcff1a5e8d0d30135a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411297
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-05-24 14:10:39 +00:00
Adlai Holler
cbe4634d94 Revert "Temporarily disable reduceOpsTaskSplitting on bots"
This reverts commit 9604eab2bd.

Reason for revert: Got perf data

Original change's description:
> Temporarily disable reduceOpsTaskSplitting on bots
>
> When we enabled this, at that time CCPR atlasing would
> auto-disable when reordering was enabled, so the perf
> impact was unclear.
>
> Since then, CCPR atlasing has been disabled for everyone,
> so let's flip this flag, get some perf data, and then flip it back.
>
> Bug: skia:10877
> Change-Id: I67f081981e84c573dfc2907018b50c740f3a32cc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411216
> Auto-Submit: Adlai Holler <adlai@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic90be563da759b48f5aa3d9c951cfb76439ce604
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411298
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-05-21 19:25:04 +00:00
Ravi Mistry
e5be65e998 Update references to master branch
Change-Id: I1bfd1b655af6cdfbd64452b1e594a276425095fe
Bug: skia:11987
Docs-Preview: https://skia.org/?cl=410790
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410790
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2021-05-21 15:18:16 +00:00
Adlai Holler
9604eab2bd Temporarily disable reduceOpsTaskSplitting on bots
When we enabled this, at that time CCPR atlasing would
auto-disable when reordering was enabled, so the perf
impact was unclear.

Since then, CCPR atlasing has been disabled for everyone,
so let's flip this flag, get some perf data, and then flip it back.

Bug: skia:10877
Change-Id: I67f081981e84c573dfc2907018b50c740f3a32cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411216
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-05-21 14:46:56 +00:00
Chris Dalton
ea46fb7d20 Disable CCPR everywhere except testing
Skia has an atlas clipping mode (historically called CCPR clipping) that
doesn't quite work. It will fail on blend modes that require a dst read
and is also drawing the complexclip_* tests wrong on several devices.
We plan to rewrite the clip atlas, but in the meantime we need to
disable the "CCPR" clipping.

Bug: b/188794626
Change-Id: I126030a2a81057ffca85fd8b8e7db97b716451ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408557
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-05-20 16:52:15 +00:00
Ravi Mistry
850e4b5de1 Fix linkedin pageset for RecreateSKPs bot
Change-Id: I3bb2c63e0e90b36fc784a7db3512719ffeb099a8
Bug: skia:12019
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410258
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-05-19 17:37:28 +00:00
Corentin Wallez
19f8f27282 Fix usage of deprecated wgpu::TextureUsage::OutputAttachment
Fixed: dawn:788
Change-Id: I2ec810fdd177aff61519192c234d5cb8cabe68d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409236
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@google.com>
Reviewed-by: Stephen White <senorblanco@google.com>
2021-05-17 14:42:30 +00:00
Brian Salomon
33ec611316 viewer can show offscreen layers in MSKPSlide
Also three fixes for drawing to offscreen layers in MSKPPlayer:
*Only play from last full redraw to next cmd
*Clear before full redraw
*Actually track current cmd in layer state.

Bug: skia:11900
Change-Id: I988afb61f96c8acb7e7554d65bfa6cd6020196c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407460
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-05-12 19:49:03 +00:00
Brian Osman
a5842bc903 Move SkSpan to include/, for use in public API
Change-Id: I674f038600afd6d49316c1ece515941ee5579068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406939
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-12 13:19:32 +00:00
Brian Osman
ae87bf1e49 Remove SkSpan class template deduction guides
This effectively reverts a80ce1a36d,
and goes back to using SkMakeSpan (which works in C++14).

Change-Id: Iaa63c86b5acaadbdd60588b0a5c703820e810770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406938
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-11 20:06:29 +00:00
Brian Salomon
96263aa7c6 Reuse GL enums for ANGLE vendor/renderer
Currently our ANGLE vendor/renderer detection is based ANGLE's D3D
backends. To detect on the GL backend it'd be helpful to reuse the
normal GL detection after extracting the relevant GL backend strings
that ANGLE puts in GL_RENDERER in its GLES frontend. This is a step in
that direction.

Bug: 1203705
Change-Id: I5367c49e8aaee2e138088316566f95900b9c4831
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405689
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-05-10 13:38:30 +00:00
Brian Salomon
1989342920 Consolidate gathering of info from GL strings.
Should not change functionality.

Bug: 1203705
Change-Id: I2a17fb0ccb729033c964a138dbd5e86be7f93d9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405200
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-05-07 13:20:18 +00:00
Michael Ludwig
97f85bb7fd Remove SkTextBlobDiffCanvas, use tracking device directly with base SkCanvas
Chromium has been updated to use makeAnalysisCanvas directly and there are
no more references to SkTextBlobDiffCanvas as a type in its code base.

Since the GlyphTrackingDevice extends SkNoPixelsDevice, any SkCanvas that
uses it is effectively a "no-draw" canvas. However, by returning a base
SkCanvas the text tracking now automatically happens in the context of
the base's AutoLayerForImageFilter handling it applies on every draw. This
means that drawing a text blob with an image filter that modifies the
transform state will now be analyzed in that context automatically
(simplifying code in chrome after this lands).

Another behavioral change is that all non-text draws will still go through
the base SkCanvas' virtuals and invoke the device function. Since it's an
SkNoPixelsDevice, it'll still be a no-op, it just happens a little later.
This won't really impact performance because oop-r already inspects their
operations and only plays back text and transform related ones to the
analysis canvas, so we shouldn't really see non-text draws being invoked
anyways.

Bug: chromium:1187246
Change-Id: I83f86571300751f385b3065dfe889f218fa1edc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405196
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-05-06 16:11:57 +00:00
Brian Osman
c9125aa8f3 Reland "Better first-class shader & color filter support in runtime effects"
This is a reland of adadb95a9f
... adds a temporary workaround for some Android framework code.

Original change's description:
> Better first-class shader & color filter support in runtime effects
>
> This does a few things, because they're all intertwined:
>
> 1) SkRuntimeEffect's API now includes details about children (which Skia
>    stage was declared, not just the name). The factories verify that the
>    declared types in the SkSL match up with the C++ types being passed.
>    Today, we still only support adding children of the same type, so the
>    checks are simple. Once we allow mixing types, we'll be testing the
>    declared type against the actual C++ type supplied for each slot.
> 2) Adds sample variants that supply the input color to the child. This
>    is now the only way to invoke a colorFilter child. Internally, we
>    support passing a color when invoking a child shader, but I'm not
>    exposing that. It's not clearly part of the semantics of the Skia
>    pipeline, and is almost never useful. It also exposes users to
>    several inconsistencies (skbug.com/11942).
> 3) Because of #2, it's possible that we can't compute a reusable program
>    to filter individual colors. In that case, we don't set the constant
>    output for constant input optimization, and filterColor4f falls back
>    to the slower base-class implementation.
>
> Bug: skia:11813 skia:11942
> Change-Id: I06c41e1b35056e486f3163a72acf6b9535d7fed4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401917
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

Bug: skia:11813 skia:11942
Change-Id: I2c31b147ed86fa8c4dddefb7066bc1d07fe0d285
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404637
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-05 22:06:46 +00:00
Greg Daniel
c2cca5a8a0 Revert "Better first-class shader & color filter support in runtime effects"
This reverts commit adadb95a9f.

Reason for revert: breaking android

Original change's description:
> Better first-class shader & color filter support in runtime effects
>
> This does a few things, because they're all intertwined:
>
> 1) SkRuntimeEffect's API now includes details about children (which Skia
>    stage was declared, not just the name). The factories verify that the
>    declared types in the SkSL match up with the C++ types being passed.
>    Today, we still only support adding children of the same type, so the
>    checks are simple. Once we allow mixing types, we'll be testing the
>    declared type against the actual C++ type supplied for each slot.
> 2) Adds sample variants that supply the input color to the child. This
>    is now the only way to invoke a colorFilter child. Internally, we
>    support passing a color when invoking a child shader, but I'm not
>    exposing that. It's not clearly part of the semantics of the Skia
>    pipeline, and is almost never useful. It also exposes users to
>    several inconsistencies (skbug.com/11942).
> 3) Because of #2, it's possible that we can't compute a reusable program
>    to filter individual colors. In that case, we don't set the constant
>    output for constant input optimization, and filterColor4f falls back
>    to the slower base-class implementation.
>
> Bug: skia:11813 skia:11942
> Change-Id: I06c41e1b35056e486f3163a72acf6b9535d7fed4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401917
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: I94ba57e73305b2302f86fd0c1d76f667d4e45b92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11813 skia:11942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404117
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-05-04 13:36:26 +00:00
Brian Osman
adadb95a9f Better first-class shader & color filter support in runtime effects
This does a few things, because they're all intertwined:

1) SkRuntimeEffect's API now includes details about children (which Skia
   stage was declared, not just the name). The factories verify that the
   declared types in the SkSL match up with the C++ types being passed.
   Today, we still only support adding children of the same type, so the
   checks are simple. Once we allow mixing types, we'll be testing the
   declared type against the actual C++ type supplied for each slot.
2) Adds sample variants that supply the input color to the child. This
   is now the only way to invoke a colorFilter child. Internally, we
   support passing a color when invoking a child shader, but I'm not
   exposing that. It's not clearly part of the semantics of the Skia
   pipeline, and is almost never useful. It also exposes users to
   several inconsistencies (skbug.com/11942).
3) Because of #2, it's possible that we can't compute a reusable program
   to filter individual colors. In that case, we don't set the constant
   output for constant input optimization, and filterColor4f falls back
   to the slower base-class implementation.

Bug: skia:11813 skia:11942
Change-Id: I06c41e1b35056e486f3163a72acf6b9535d7fed4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401917
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-05-04 01:29:57 +00:00
Brian Salomon
31fddc3769 MSKP support in nanobench
Bug: skia:11900
Change-Id: I97d1f2a9523252318ffb4f479b197cb0ef9cf0b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402920
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-30 20:04:08 +00:00
Brian Salomon
8e880af78e Choose background color and whether to draw mskp bounds in viewer
Default the background color to transparent black, which is correct for
mskps captures from Android framework.

Bug: skia:11900
Change-Id: I97cab04993c0f85259e831f3d0c44f9b962365af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/403077
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-30 19:33:49 +00:00
Brian Salomon
5276ba274b Add --reducedshaders to fm
Sometimes I like to dump the shaders from reduced shader mode.

Bug: skia:11844
Change-Id: I33c986116e326a023c432d582e3653267f311bca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402999
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-04-30 16:04:08 +00:00
Brian Salomon
0bc48228ae Reland "FPS and frame control for MSKP slide."
This is a reland of 3b7587814d

Use SkTPin instead of std::clamp (C++17 library feature).

Original change's description:
> FPS and frame control for MSKP slide.
>
> Bug: skia:11900
> Change-Id: Ib4d8da6a86da7966e613de2d7cfd61ff545b296a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400676
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:11900
Change-Id: I29d3f6a717bbdd4e1fee3322e98d33e51a28f264
Cq-Include-Trybots: luci.skia.skia.primary:Housekeeper-PerCommit-CreateDockerImage_Skia_Release
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402917
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-30 13:15:33 +00:00
Joe Gregorio
a9d3cfbda2 Revert "FPS and frame control for MSKP slide."
This reverts commit 3b7587814d.

Reason for revert: Failing on Housekeeper-PerCommit-CreateDockerImage_Skia_Release:

obj/tools/viewer/viewer.MSKPSlide.o
../../tools/viewer/MSKPSlide.cpp:64:23: error: no member named 'clamp' in namespace 'std'

        fFrame = std::clamp(fFrame, 0, fPlayer->numFrames() - 1);


Original change's description:
> FPS and frame control for MSKP slide.
>
> Bug: skia:11900
> Change-Id: Ib4d8da6a86da7966e613de2d7cfd61ff545b296a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400676
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I4a97deb1ac441f223977d2dbad2f93f5d4376a23
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402777
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-04-29 22:09:22 +00:00
Brian Salomon
3b7587814d FPS and frame control for MSKP slide.
Bug: skia:11900
Change-Id: Ib4d8da6a86da7966e613de2d7cfd61ff545b296a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400676
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-04-29 21:05:58 +00:00
Brian Salomon
06c9e2962b Revert "Revert "Add mskp player, use in viewer slide""
This reverts commit 0d174586c4.

Use SkTLazy instead of std::optional (C++17 library feature)

Bug: skia:11900
Change-Id: Ia41caa9322d812f9ba6644dd14ede7d0015cf8b3
Cq-Include-Trybots: luci.skia.skia.primary:Housekeeper-PerCommit-CreateDockerImage_Skia_Release,Build-Debian10-Clang-x86_64-Release-CMake
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402642
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-29 19:40:08 +00:00
Brian Salomon
0d174586c4 Revert "Add mskp player, use in viewer slide"
This reverts commit 9230fc59b7.

Reason for revert: broke something in housekeeping docker build.

Original change's description:
> Add mskp player, use in viewer slide
>
> viewer now takes --mskps <dir> and will have a slide per mskp and
> overview slide (just like --skps).
>
> Player uses offscreen surfaces to draw offscreen layers, allows
> random access to mskp frames.
>
> slide just plays mskp at fixed frame rate (for now).
>
> Bug: skia:11900
> Change-Id: I66104ffe88f5df721a1a835570acc3e4c23c3f07
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400537
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=jvanverth@google.com,bsalomon@google.com,nifong@google.com

Change-Id: I97fb7a64d5ef2ca14dba1cf9e2ba91ab0e9d0018
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402639
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-29 17:15:58 +00:00
Brian Salomon
9230fc59b7 Add mskp player, use in viewer slide
viewer now takes --mskps <dir> and will have a slide per mskp and
overview slide (just like --skps).

Player uses offscreen surfaces to draw offscreen layers, allows
random access to mskp frames.

slide just plays mskp at fixed frame rate (for now).

Bug: skia:11900
Change-Id: I66104ffe88f5df721a1a835570acc3e4c23c3f07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400537
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-04-29 16:35:07 +00:00
Mike Reed
b2497ddd0e Revert "Revert "onMatchFaceStyle is unused, so remove it""
This relands the idea that onMatchFaceStyle is no longer used, but
leaves the baseclass virtual to stage removing it from client
subclasses.

This reverts commit 3c04a65508.

Change-Id: I18570065249c86f7f155c28288dce3ea9d59f619
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401759
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-27 16:40:29 +00:00
Mike Reed
3c04a65508 Revert "onMatchFaceStyle is unused, so remove it"
This reverts commit 40f2985ec8.

Reason for revert: flutter has subclasses

Original change's description:
> onMatchFaceStyle is unused, so remove it
>
> Change-Id: I2b249d226af1c222edea6ec5f8de0b4d2542e34a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401676
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: I455b3f177570cc757442b772edbf969b9544e019
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401757
Reviewed-by: Mike Reed <reed@google.com>
2021-04-27 15:34:30 +00:00
Mike Reed
40f2985ec8 onMatchFaceStyle is unused, so remove it
Change-Id: I2b249d226af1c222edea6ec5f8de0b4d2542e34a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/401676
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-27 14:45:12 +00:00
Ravi Mistry
5d8a09ebff Add wait time to ebay pageset
Bug: skia:11898
Change-Id: I0bb58f1d8e9c6ad48148d50b840f152fc158f071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400538
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2021-04-24 15:17:04 +00:00
Chris Dalton
57ab06c14e Delete mixed samples
Mixed samples is no longer relevant for Ganesh. DMSAA and the new
Ganesh architecture both rely on full MSAA, and any platform where
mixed samples is supported will ultimately not use the old
architecture.

Change-Id: I5acc745010e090ef26310d92ec6240be2cd494cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399837
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-04-22 20:11:34 +00:00
Adlai Holler
d37a085cd0 Enable DAG reordering on almost all bots
We exclude the NUC5PPYH just to get desktop coverage,
and we exclude the Pixel4, 4XL, 5 because of an apparent driver
bug I'm in the progress of tracking down.

Bug: skia:10877
Change-Id: Ic925cc7434c5228bcc2ee07ae752f89229db55c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399742
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-04-22 16:55:39 +00:00
Chris Dalton
94df572a13 Convert dmsaa to an SkSurfaceProp
Bug: skia:11396
Change-Id: I1c2a72d80679df1c11529d05cbe781f6dfae6a79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396810
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-04-20 16:24:56 +00:00
Adlai Holler
4d92e41839 Revert "Enable DAG reordering on all bots except one"
This reverts commit b8e02c5f38.

Reason for revert: Broke Pixel5 glesmsaa4 desk_mapsvg.skp

Original change's description:
> Enable DAG reordering on all bots except one
>
> Before this CL, only select bots used reordering. After this CL,
> all bots except the NUC5PPYH use the flag.
>
> Once all our clients are migrated, we'll remove the flag altogether.
>
> Bug: skia:10877
> Change-Id: Iee734f8b99ae9eba6c1947009d8164032594b051
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398219
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>

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

Change-Id: Iadf4f779bbaa1c5406d5f88e448994951ae89ae4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398179
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-04-20 15:48:07 +00:00
Adlai Holler
b8e02c5f38 Enable DAG reordering on all bots except one
Before this CL, only select bots used reordering. After this CL,
all bots except the NUC5PPYH use the flag.

Once all our clients are migrated, we'll remove the flag altogether.

Bug: skia:10877
Change-Id: Iee734f8b99ae9eba6c1947009d8164032594b051
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398219
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-04-20 14:19:35 +00:00
Ben Wagner
f6cc85844f Reland "Fix sk_app macOS raster window build conditions."
The "raster" window on macOS and iOS is actually backed by GL. Fix the
build rules and code conditions to reflect this. This allows for some
sk_app applications to run on macOS and iOS with skia_use_gl=false.

> Revert:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397737
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

> Land:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397256
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ia8a421f4818856dd90cb4847095eee0d1836d1e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398056
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-04-19 18:25:44 +00:00
Adlai Holler
53a65b2b6f Reduce VRAM budget on one perf bot
This will let us see the reordered_dags_over_budget stat
in perf so that we know our fallback code path is getting tested.

Bug: skia:10877
Change-Id: I073c8622ddb8f3449511193bac045bfebc4e277c
Cq-Include-Trybots: luci.skia.skia.primary:Perf-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398217
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2021-04-19 16:04:34 +00:00
Brian Osman
9d4741370c Revert "Fix sk_app macOS raster window build conditions."
This reverts commit 163ba10dde.

Reason for revert: Mac linker errors

Original change's description:
> Fix sk_app macOS raster window build conditions.
>
> The "raster" window on macOS is actually backed by GL. Fix the build
> rules and code conditions to reflect this. This allows for some sk_app
> applications to run on macOS with skia_use_gl=false.
>
> Change-Id: I5d7b37c4172079e163690faa4e55a622a6d4f844
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397256
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=bungeman@google.com,brianosman@google.com

Change-Id: Ie5fa24138e4387784c21559f28528a4c4d335626
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397737
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-04-17 17:41:27 +00:00
Ben Wagner
163ba10dde Fix sk_app macOS raster window build conditions.
The "raster" window on macOS is actually backed by GL. Fix the build
rules and code conditions to reflect this. This allows for some sk_app
applications to run on macOS with skia_use_gl=false.

Change-Id: I5d7b37c4172079e163690faa4e55a622a6d4f844
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397256
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-04-17 15:18:05 +00:00
Jim Van Verth
b5ea786dbd Viewer: apply same transform as slide to dimensions display.
Change-Id: Ic5192b072c98617dee85f28f8f4214c7a805a1fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397318
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-04-16 19:24:23 +00:00
John Stiles
f35853a4a2 Clarify output from rewrite_includes assertion.
Previously, the conflicting header names were printed between several
lines of "boilerplate" text, and without any explanatory text. This
made them difficult to notice. The assertion now has an explanatory
message and prints the conflicting filenames directly at the point of
the assertion.

Before:
---
Running presubmit upload checks ...
tests/sksl/dslfp GrSwizzle.h /Users/johnstiles/skia/src/gpu/GrSwizzle.h
Traceback (most recent call last):
  File "tools/rewrite_includes.py", line 60, in <module>
    assert file_name not in headers
AssertionError

** Presubmit ERRORS ** (etc)
username$ _

After:
---
Running presubmit upload checks ...
Traceback (most recent call last):
  File "tools/rewrite_includes.py", line 61, in <module>
    assert file_name not in headers, message
AssertionError: Header filename is used more than once!
- tests/sksl/dslfp/GrSwizzle.h
- /Users/johnstiles/skia/src/gpu/GrSwizzle.h

** Presubmit ERRORS ** (etc)
username$ _

Change-Id: I2b6848ef82c4b1c6d4b5577a76969785e5e122bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397149
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-04-15 19:44:32 +00:00
Herb Derby
0b1228d53e put an arena on GrRenderTargetProxy
This is a reland of 5a2de5e72f

This is part one of two CLs. In this CL, I put a
sk_sp<GrArenas> on GrRenderTargetProxy where GrArenas wraps
a SkArenaAlloc to add ref counting. Creating
a GrOpsTask shares the GrArenas with the ops task. When an
GrOpsTask is destroyed, it nulls out the fArenas sk_sp on
the GrRenderTargetProxy to limit the life span of the arenas.

New plumbing was added to GR_DRAW_OP_TEST_DEFINE to allow a
proper GrSurfaceDrawContext to be passed to GrAtlasTextOp's
GR_DRAW_OP_TEST_DEFINE so the arena will have a proper lifetime.

The second CL will work on replacing GrOpsTask's fAllocators
system with the shared arena.

Change-Id: Ieb568e4533c17e31b3b015e7781365d7d898c483
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396818
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-04-15 14:37:59 +00:00
Brian Osman
cbb60bd0b0 Add runtime color filter and shader modes to the SkSL compiler
These enforce stricter rules about the signature of main, and each one
uses a separate pre-include module. That prevents color filters from
being able to reference sk_FragCoord (or coords passed to main) at all.
It also limits the versions of sample() that are exposed.

In the new world, an effect created for a specific stage of the Skia
pipeline can only be used to create instances of that stage (SkShader or
SkColorFilter). For now, SkRuntimeEffect::Make uses kRuntimeEffect,
which continues to be more lenient and allow creation of either shaders
or color filters from a single effect. After we migrate all clients, we
can deprecate and then delete that mode.

Bug: skia:11813
Change-Id: I0afd79a72beeec84da42c86146e8fcd8d0e4c09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/395716
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-04-15 13:30:59 +00:00
Brian Salomon
5a32828e5e No VS specialization for identity or scale/trans in reduced shader mode
Modifies helpers on GrGLSLGeometryProcessor that insert, set, and make
keys for view/local matrix uniforms to not omit the uniform when
the matrix is identity or use a float4 when it is scale/trans. Always
uses a 3x3.

Bug: skia:11844
Change-Id: I0f25b60b46b8932d7e2cac4a50159d22b9cd84d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/395656
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-14 20:09:09 +00:00
Adlai Holler
8e2a8b202c Surface resource cache through cmdline flag
This lets us test out the memory-fallback code in the new
ops task reordering pathway on our bots.

Bug: skia:10877
Change-Id: Ic5662ef68e46b144eb2821687390c858d0056ba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396157
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-04-14 18:49:48 +00:00
John Stiles
3738ef531b Move code generators to codegen/ directory.
We are up to having seven distinct types of codegen, and will soon have
an 8th (DSL C++).

Change-Id: I6758328390c234ba1d5c30c118199dbc820af52a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/395817
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-04-13 15:34:24 +00:00
John Stiles
f2c2d3020e Migrate PersistentCacheUtils logic into a cpp file.
This code is not performance-sensitive, and there doesn't seem to be any
benefit to making it header-only.

Change-Id: Ic83be5cbb96f08c18a144954be7453aaabaa5a72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394900
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-04-12 14:09:59 +00:00
Brian Salomon
91216d5b65 Add "reduced shader" testing mode.
Currently doesn't do anything other than add new configs that set
a GrContextOption that becomes available in GrCaps. Runs new configs
on Perf/Test bots (MTL/iPhone11 and GL/Ubuntu).

Bug: skia:11844
Change-Id: I58586cae0980e52701abd1633dbc79b381f6015b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394996
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-04-09 20:15:37 +00:00
Mike Klein
a12796b42c fix git-sync-deps
We really do use this.

Change-Id: I0defcf8aa3b23eec89b38b6720228daa8d50c27b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394956
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2021-04-09 15:52:57 +00:00
Herb Derby
27ce7df013 Revert "put an arena on GrSurfaceDrawContext"
This reverts commit 5a2de5e72f.

Reason for revert: Upon further investigation this still leaks

Original change's description:
> put an arena on GrSurfaceDrawContext
>
> This is part one of two CLs. In this CL, I put a
> sk_sp<GrArenas> on GrSurfaceFillContext where GrArenas wraps
> a SkArenaAlloc to add ref counting. Creating
> a GrOpsTask shares the GrArenas with the ops task. New plumbing
> was added to GR_DRAW_OP_TEST_DEFINE to allow a proper
> GrSurfaceDrawContext to be passed to GrAtlasTextOp's
> GR_DRAW_OP_TEST_DEFINE so the arena will have a proper lifetime.
>
> The second CL will work on replacing GrOpsTask's fAllocators
> system with the shared arena.
>
> Change-Id: Ife3be0ab265441cbffab360f2808f5eed86db8b3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392936
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: I9ca5c8b1e16b468003788cd3126eda1d40ff93ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393177
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-04-06 20:16:08 +00:00
Ravi Mistry
3e1dd8df28 Fix crashing skia_wikipedia_mobile.py
Bug: skia:11839
Change-Id: I3aa1c7d36e61a6a6c40ae10e9463f94d83f45790
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393137
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-04-06 18:17:39 +00:00
Ravi Mistry
826b653926 Specify wait time for new motionmark SKPs to prevent timeouts
Bug: skia:11817
Change-Id: I395a565b3df2f7745891e182b390f938df8623fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393136
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-04-06 18:15:16 +00:00
Herb Derby
5a2de5e72f put an arena on GrSurfaceDrawContext
This is part one of two CLs. In this CL, I put a
sk_sp<GrArenas> on GrSurfaceFillContext where GrArenas wraps
a SkArenaAlloc to add ref counting. Creating
a GrOpsTask shares the GrArenas with the ops task. New plumbing
was added to GR_DRAW_OP_TEST_DEFINE to allow a proper
GrSurfaceDrawContext to be passed to GrAtlasTextOp's
GR_DRAW_OP_TEST_DEFINE so the arena will have a proper lifetime.

The second CL will work on replacing GrOpsTask's fAllocators
system with the shared arena.

Change-Id: Ife3be0ab265441cbffab360f2808f5eed86db8b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392936
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-04-06 15:15:46 +00:00
Mike Klein
3144a1e698 have fm mkdir -p
This allows directories in sources, e.g.

    $ fm -b cpu -s skimage/dm/01_original.jpg -w foo
        skimage/dm/01_original.jpg  f181c4655d0f55d7000dd04a4d28d407      330ms

    $ find foo
        foo
        foo/skimage
        foo/skimage/dm
        foo/skimage/dm/01_original.jpg.png

where previously,

    $ fm -b cpu -s skimage/dm/01_original.jpg -w foo
        sk_fopen: fopen("foo/skimage/dm/01_original.jpg.png", "wb") returned nullptr
        (errno:2): No such file or directory
        libpng error: HashAndEncode::encodePNG() failed writing stream

        Signal 6:
        _sigtramp (+0x1d)

Change-Id: I6950d77cacba16363315fb8d5c6d866d207c9a25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392198
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-04-02 20:35:35 +00:00
Brian Salomon
2c673409ef Expose writing to mip levels via GrSurfaceContext::writePixels
Bug: skia:11786
Change-Id: Id17952db0aede56fa39845d9d371cf0a141f9dd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391836
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-04-02 19:16:15 +00:00
Brian Osman
d18967c67d Add integer uniforms to runtime effects
Bug: skia:11803
Change-Id: I925f14be282b96355721986de6049090b35adf3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391856
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-04-01 17:20:03 +00:00
Ravi Mistry
7724291b6e Add new motionmark SKPs
Bug: skia:11817
Change-Id: Ibd940ffa904171e43377b0852375d835e59bc230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391076
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2021-03-31 16:37:02 +00:00
Ravi Mistry
f29c646ccf Replace desk_intelwiki.skp with desk_gujuratiwiki.skp
Bug: skia:11819
Change-Id: I504a58f5d1da51cf715b73efef44d00c0edef5e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391196
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-31 16:36:37 +00:00
Brian Salomon
5392c94fe8 GrConvertPixels takes pixmaps
Add GrCPixmap, a GrPixmap but with const void* instead of void*. Share
impl via template base class GrPixmapBase.

Change-Id: I7dfdf24a73c1bc8557ff7b90f93a9399da2f3f75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350022
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-03-31 00:23:17 +00:00
John Stiles
2ee4d7a7f5 Rework optimization override flags.
Previously, the Compiler optimization overrides only supported force-
disabling a particular behavior; we assumed that the default state of
a Compiler was to allow all optimizations. This assumption is about to
be invalidated, as the Inliner will soon be off by default unless you
are using GLES.

The override flags are now a tri-state; optimization and inlining can
be set to "default", "on" or "off".

Change-Id: I5637693222ca1de74ca1073c24d86c8e7c5026f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390136
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>
2021-03-30 15:39:15 +00:00
Robert Phillips
0d8722c8b5 Make use of shareable promise images in tools
The main change here is just fusing the following three methods into recreateSKP:
   deflateSKP
   createCallbackContexts
   createSKP

All the remaining changes are just API fallout from that.

Bug: skia:11728
Change-Id: Iae2ce65983ad56c8288bdc830e248394a0055bfb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389925
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-30 14:25:55 +00:00
Ravi Mistry
430fd53936 Add scrolling to go to the more interesting parts of desk_intelwiki.skp
Bug: skia:11804
Change-Id: I96ce34311b5e5420ee343a0dbc68ef20f399be4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390336
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-30 13:46:19 +00:00
Ravi Mistry
9340b43508 Remove anchor and increase wait time for desk_intelwiki.skp
No-Try: true
Bug: skia:11804
Change-Id: Ib30df7f233bd3c2bcbfdf5c62e803be187a4ff01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389712
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-29 15:14:22 +00:00
Eric Boren
a1db799824 Fix Python3 compatibility
Bug: skia:11768
Change-Id: I6107362457dce380e3fb1647ad58d8e33e453e2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388743
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-03-25 14:15:35 +00:00
John Stiles
15da98ce58 Revert "Performance experiment: Disable SkSL inliner in nanobench/skpbench."
This reverts commit 3f5bee1a7a.

Reason for revert: concluding experiment

Original change's description:
> Performance experiment: Disable SkSL inliner in nanobench/skpbench.
>
> This is a reland of 045d7513d7
>
> This will allow us to measure the impact (positive or negative) of
> inlining functions before submitting a shader to the driver.
> In previous trials, we encountered an issue with overloads of cross()
> which prevented us from collecting data on some platforms.
>
> Original change's description:
> > Performance experiment: Disable SkSL inliner in nanobench/skpbench.
> >
> > This is a reland of 3f35ac10b4
> >
> > Time to run this experiment again.
> >
> > Original change's description:
> > > Performance experiment: Disable SkSL inliner in nanobench/skpbench.
> > >
> > > This will allow us to measure the impact (positive or negative) of
> > > inlining functions before submitting a shader to the driver.
> > >
> > > Change-Id: Icbd64096445a353187b30feea68573d89ca18664
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: John Stiles <johnstiles@google.com>
> >
> > Change-Id: I278a770d4129f4ad0bf867c33a01b49a88cea588
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387256
> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: I49a1555bde93c339fda567fc85a85e937af95628
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388396
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: Ifd63edeb06fea8eea4ac0a4242c93449b288b074
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388796
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-24 19:21:25 +00:00
John Stiles
3f5bee1a7a Performance experiment: Disable SkSL inliner in nanobench/skpbench.
This is a reland of 045d7513d7

This will allow us to measure the impact (positive or negative) of
inlining functions before submitting a shader to the driver.
In previous trials, we encountered an issue with overloads of cross()
which prevented us from collecting data on some platforms.

Original change's description:
> Performance experiment: Disable SkSL inliner in nanobench/skpbench.
>
> This is a reland of 3f35ac10b4
>
> Time to run this experiment again.
>
> Original change's description:
> > Performance experiment: Disable SkSL inliner in nanobench/skpbench.
> >
> > This will allow us to measure the impact (positive or negative) of
> > inlining functions before submitting a shader to the driver.
> >
> > Change-Id: Icbd64096445a353187b30feea68573d89ca18664
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: I278a770d4129f4ad0bf867c33a01b49a88cea588
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387256
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I49a1555bde93c339fda567fc85a85e937af95628
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388396
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-24 13:24:50 +00:00
Robert Phillips
84fd1c2dec Clean up remaining NVPR bits & bobs
Bug: skia:11760, skia:11787
Change-Id: Idfedb90576e0484bf32a9002081c0fcb888141eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388216
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-23 19:12:12 +00:00
Robert Phillips
f10535f6fa Fuse GrGLSLPrimitiveProcessor and GrGLSLGeometryProcessor ...
into a new GrGLSLGeometryProcessor. Since NVPR is no more this
distinction (between GLSL- Primitive and Geometry -Processor)
probably isn't needed/useful.

Bug: skia:11760
Change-Id: I75621725bd2b0ef3dbac2ea6449bd571551babab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388036
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-23 14:30:18 +00:00
Robert Phillips
787fd9d80a Fuse GrPrimitiveProcessor & GrGeometryProcessor into a new GrGeometryProcessor
With the removal of NVPR we no longer need this distinction.

Bug: skia:11760
Change-Id: I225a4feb764395fb72aca3ffc8b6d05396bf0b1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386890
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-03-22 19:44:40 +00:00
Robert Phillips
43e3dc994e Remove NVPR entry points from Skia's GL interface
This is blocked on the Chrome-side CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2774573 (Remove setting of NVPR entries on Skia's GL interface)

Bug: skia:11760
Change-Id: I1788de07d8f0208e15356a147005b87110dfeab5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387096
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-22 17:44:16 +00:00
John Stiles
1a4fae1a5f Revert "Performance experiment: Disable SkSL inliner in nanobench/skpbench."
This reverts commit 045d7513d7.

Reason for revert: experiment complete

Original change's description:
> Performance experiment: Disable SkSL inliner in nanobench/skpbench.
>
> This is a reland of 3f35ac10b4
>
> Time to run this experiment again.
>
> Original change's description:
> > Performance experiment: Disable SkSL inliner in nanobench/skpbench.
> >
> > This will allow us to measure the impact (positive or negative) of
> > inlining functions before submitting a shader to the driver.
> >
> > Change-Id: Icbd64096445a353187b30feea68573d89ca18664
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: I278a770d4129f4ad0bf867c33a01b49a88cea588
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387256
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I54d417e65bd134dee72ff46e9331f8fabfc724df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387536
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-21 14:30:49 +00:00
John Stiles
045d7513d7 Performance experiment: Disable SkSL inliner in nanobench/skpbench.
This is a reland of 3f35ac10b4

Time to run this experiment again.

Original change's description:
> Performance experiment: Disable SkSL inliner in nanobench/skpbench.
>
> This will allow us to measure the impact (positive or negative) of
> inlining functions before submitting a shader to the driver.
>
> Change-Id: Icbd64096445a353187b30feea68573d89ca18664
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I278a770d4129f4ad0bf867c33a01b49a88cea588
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387256
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-20 15:10:16 +00:00
Mike Reed
7cee3efb6b FilterQuality should no longer be needed.
Start to clean up.

Change-Id: I6dea9344d8a19010d6e22ee8d0cd2b795910a82c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386843
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-03-20 14:30:06 +00:00
Robert Phillips
31798c2796 Remove NVPR
Bug: skia:11760
Change-Id: Ie0fc1aaa3120b37b1d452fdc9a8b5cb91b6ffe1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386559
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-19 12:26:38 +00:00
Chris Dalton
fd708655ae Reland "Add tooling support for dmsaa"
Reland 188443be8d without the DMSAA bots
to ensure nothing else changes.

Original change's description:
> Add tooling support for dmsaa
>
> Adds a "fAlwaysAntiAlias" flag to GrContextOptions that can be set from
> tooling code. When dmsaa is set, SkGpuDevice draws everything
> antialiased. Adds new "gldmsaa" and "glesdmsaa" configs and creates bots
> to run them.
>
> Bug: skia:11396
> Change-Id: I165e89434b733f7b02312cea0e6649812528083b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Bug: skia:11396
Change-Id: Icb45097e0a34543dc577fa32f19a692e90643a35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386338
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-18 04:57:10 +00:00
Chris Dalton
22dd57b82c Revert "Add tooling support for dmsaa"
This reverts commit 188443be8d.

Reason for revert: It looks like non-dmsaa bots might have been
affected. Let's land first without the new bots to make sure nothing
else changes.

Original change's description:
> Add tooling support for dmsaa
>
> Adds a "fAlwaysAntiAlias" flag to GrContextOptions that can be set from
> tooling code. When dmsaa is set, SkGpuDevice draws everything
> antialiased. Adds new "gldmsaa" and "glesdmsaa" configs and creates bots
> to run them.
>
> Bug: skia:11396
> Change-Id: I165e89434b733f7b02312cea0e6649812528083b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com

Change-Id: Ib805b417ebd34d1fad79e0e1fe625765ee487f65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386336
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Chris Dalton <csmartdalton@google.com>
2021-03-17 23:36:12 +00:00
Chris Dalton
188443be8d Add tooling support for dmsaa
Adds a "fAlwaysAntiAlias" flag to GrContextOptions that can be set from
tooling code. When dmsaa is set, SkGpuDevice draws everything
antialiased. Adds new "gldmsaa" and "glesdmsaa" configs and creates bots
to run them.

Bug: skia:11396
Change-Id: I165e89434b733f7b02312cea0e6649812528083b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-17 15:58:40 +00:00
Chris Dalton
180b4a1422 Update tooling code to store surface flags instead of "useDIText"
Change-Id: I4556a6222f358c4a853318703a406caea65d0fd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-17 15:09:30 +00:00
Ravi Mistry
3aff6ae597 Replace crashing pokemonwiki with intelwiki
intelwiki has html tables to test

Cq-Include-Trybots: luci.skia.skia.primary:Housekeeper-Nightly-RecreateSKPs_DryRun
Bug: skia:11354
Change-Id: I84fb2b91ffd7b28b46bb5d303f546f193a9883d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385498
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-16 22:30:25 +00:00
Brian Osman
164bafafbe Reland "On NVIDIA + ANGLE, test 4x MSAA, not 8x"
This is a reland of c0c3231bde

Original change's description:
> On NVIDIA + ANGLE, test 4x MSAA, not 8x
>
> By all accounts, this should produce much more deterministic output,
> letting us remove quite a few ignores.
>
> Bug: skia:6813 skia:6545
> Change-Id: I7bc2c8e05c2f6e8110ea550882d5f0a45548008b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384856
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Bug: skia:6813 skia:6545
Change-Id: I2bbff8c8807940024eeefbca823656ab105acdd1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384998
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-15 18:39:38 +00:00
John Stiles
46e7507b0d Revert "Performance experiment: Disable SkSL inliner in nanobench/skpbench."
This reverts commit 3f35ac10b4.

Reason for revert: concluding experiment

Original change's description:
> Performance experiment: Disable SkSL inliner in nanobench/skpbench.
>
> This will allow us to measure the impact (positive or negative) of
> inlining functions before submitting a shader to the driver.
>
> Change-Id: Icbd64096445a353187b30feea68573d89ca18664
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,johnstiles@google.com

Change-Id: Ia7c34e3e2bb4f777a4bd18a5646e494eeb3c93ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384456
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-13 13:08:19 +00:00
John Stiles
3f35ac10b4 Performance experiment: Disable SkSL inliner in nanobench/skpbench.
This will allow us to measure the impact (positive or negative) of
inlining functions before submitting a shader to the driver.

Change-Id: Icbd64096445a353187b30feea68573d89ca18664
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384317
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-12 20:45:08 +00:00
Chris Dalton
7d592cda58 Delete all low-level rendering from ccpr
This converts ccpr to just a poorly named atlas manager. The atlas
gets rendered by normal calls on its MSAA draw context:

  for (;;) {
      surfaceDrawContext->stencilPath();  // Stencil.
  }
  surfaceDrawContext->stencilRect(atlasBounds);  // Cover.

Bug: chromium:1158093
Change-Id: I758ffd372b2ed5bb8b370156b6f80f6204146700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381618
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-12 17:02:56 +00:00
Chris Dalton
03730e6ca6 Delete path caching and path rendering from ccpr
All that's left is a clip atlas renderer.

Bug: chromium:1158093
Change-Id: I8b509904a752a202ff1321e5302c41a3f57a5edb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383741
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-12 16:02:16 +00:00
Robert Phillips
edff467fd4 Add a DirectContextID to GrDirectContexts
Bug: skia:11728
Change-Id: I80ab54f2cfa0bbc69f688e1e598eeeb4bde1a1a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/383023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-11 14:58:40 +00:00
John Stiles
f3a28db703 Eliminate control-flow analysis.
We no longer derive a performance benefit from this pass in practice,
and it is a very expensive compilation step. It is also prone to fuzz-
related errors.

Doc: http://go/optimization-in-sksl

Change-Id: Ief08ffac659a8fe7fe92c92b9a5da14c9f713bc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381261
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-11 13:24:54 +00:00
Chris Dalton
2603c1fb14 Delete coverage counting backend from ccpr
This declutters the atlas generation code so there are fewer variables.
Next we will delete all the lower level rendering code and render the
atlas with stencilPath/stencilRect instead.

Bug: chromium:1158093
Change-Id: I36cff285d0f7de6f8ece4b027e62ae84aa01adc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380656
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-11 04:26:00 +00:00
John Stiles
4d7ac49dca Declare outputColor and outputCoverage inside emitCode.
This is useful because it allows the variables to be declared as `const`
when they are trivial values like `half4(1)`. This enables the constant
folder to simplify or eliminate them. In most cases, this is only a
small benefit, as you'd expect a competent GPU driver to do the same.
However, Mali-400 can benefit significantly from optimizing away the
multiplication against a constant half4(1) coverage in Porter-Duff.

Mali-400 performance is back to normal: http://screen/3cDxdaGkYE8oBcS

Change-Id: I21fd23f91f747079cd05b082f7b3444aeabafb93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/382476
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-10 16:03:18 +00:00
John Stiles
7247b48102 Add shader optimization level toggles to Viewer.
This lets us see at a glance what each optimization pass contributes to
our final compiled SkSL output.

Change-Id: I52c56c92c408eee34045c5e6f60298cf9548ff5d
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381257
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-08 16:33:39 +00:00
John Stiles
8ef4d6c882 Add Viewer checkbox to toggle Control-Flow Analysis.
This gives Viewer a way to dynamically toggle CFA off and on, so we can
immediately see the impact on shader optimization.

Change-Id: I912df70de126a74a1f0d11c511b2acc64f1e9f28
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380456
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-05 22:00:14 +00:00
John Stiles
a8f6b6fe8a Update Shaders tab in Viewer.
- Added "Dump Shaders" button; this writes the shaders to disk in the
  `/resources/sksl` directory. This will allow us to more easily check
  real-world shader code generation, instead of synthetic examples.
- Renamed "Load" and "Save" to "View" and "Apply Changes," to clarify
  that they are not about files on disk. (Otherwise they seemed
  confusing when placed next to a Dump Shaders button.)

Also, fixed a bug which would prevent a new deferred action from being
registered while running deferred actions.

(This CL implements the "test real-world shaders" portion of
http://go/optimization-in-sksl)

Change-Id: I7626a9e9c4f3ecb31b51f29b8106e4ca55de4dd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380317
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-05 21:47:29 +00:00
Ethan Nicholas
daed2592bb Made SkSL DSL into public API
In addition to the unsurprising changes to eliminate references to
src/, we also had to tighten up some C++17-isms as they are not
permitted in public headers.

Change-Id: Ie5005a33d7a135e69fb66beca5e7a5f960dbd453
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378496
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 21:03:58 +00:00
Adlai Holler
55aaefe687 Reland "Support sharing promise images between DDLs"
This reverts commit 38b9a4bc3e.

Reason for revert: Fixed ASAN, TSAN, and other bugs via other CLs.

Original change's description:
> Revert "Support sharing promise images between DDLs"
>
> This reverts commit 07e11d48cb.
>
> Reason for revert: Broke DDL3_ASAN and DDL3_TSAN
>
> Original change's description:
> > Support sharing promise images between DDLs
> >
> > - Migrate our code to SkImage::MakePromiseTexture
> > - Have DDLTileHelper share one SKP and one set of promise images across all tiles.
> > - Disallow on-the-fly allocation of mips for promise textures.
> >
> > Bug: skia:10286
> > Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: I939b14875d1a20e4a92eab94680adcfe9596ad81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10286
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375738
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>


Bug: skia:10286
Change-Id: Ibfd7dfcd72f10a4e29a87fa8c610f2dfd018e0db
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3_ASAN,Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-DDL3_TSAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-03-04 13:10:37 +00:00
Brian Osman
9e1ef99d1e fm: Make --writeShaders dump fragment, vertex, and key files
Bug: skia:11372
Change-Id: Ib764b8d995655317e8968e57b1ea0528339d430b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379060
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 20:10:06 +00:00
Brian Osman
f0de96f7b8 Reland "Redesign program key construction"
This is a reland of bbbf1a7f50

Original change's description:
> Redesign program key construction
>
> This does two things:
> 1) Moves responsibility for bit-packing portions of the key into the key
>    itself. A new GrKeyBuilder type manages adding bits, with asserts to
>    ensure a value always fits in the requested number. In theory this
>    will let us generate smaller keys overall, at the expense of slightly
>    more complex code during construction.
> 2) Adds a string label parameter for key methods that fold in data. For
>    new methods, the label is required. To ease migration, the old add32
>    does not require a label (yet). This will let us generate detailed,
>    human readable keys, either based on SK_DEBUG, or a runtime option
>    (if we're comfortable paying the cost).
>
> Bug: skia:11372
> Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:11372
Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan
Change-Id: I179ed581bc9ba772191e727274ac0ac6979ebdf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378778
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 17:44:00 +00:00
Brian Osman
acf26501fb Revert "Redesign program key construction"
This reverts commit bbbf1a7f50.

Reason for revert: D3D Failures

Original change's description:
> Redesign program key construction
>
> This does two things:
> 1) Moves responsibility for bit-packing portions of the key into the key
>    itself. A new GrKeyBuilder type manages adding bits, with asserts to
>    ensure a value always fits in the requested number. In theory this
>    will let us generate smaller keys overall, at the expense of slightly
>    more complex code during construction.
> 2) Adds a string label parameter for key methods that fold in data. For
>    new methods, the label is required. To ease migration, the old add32
>    does not require a label (yet). This will let us generate detailed,
>    human readable keys, either based on SK_DEBUG, or a runtime option
>    (if we're comfortable paying the cost).
>
> Bug: skia:11372
> Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: I7bfb20905c87083e84a1ea21bc53d63e882e2c68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378777
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 13:35:22 +00:00
Brian Osman
bbbf1a7f50 Redesign program key construction
This does two things:
1) Moves responsibility for bit-packing portions of the key into the key
   itself. A new GrKeyBuilder type manages adding bits, with asserts to
   ensure a value always fits in the requested number. In theory this
   will let us generate smaller keys overall, at the expense of slightly
   more complex code during construction.
2) Adds a string label parameter for key methods that fold in data. For
   new methods, the label is required. To ease migration, the old add32
   does not require a label (yet). This will let us generate detailed,
   human readable keys, either based on SK_DEBUG, or a runtime option
   (if we're comfortable paying the cost).

Bug: skia:11372
Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-02 23:46:48 +00:00
Mike Klein
bc4a36af7c add --race to FM
Try to uncover races by running parallel replicas.

The default --race 0 should keep FM working as before, but now with
--race ≥2 we'll actively try to race replicas, syncing between tests.
--race 1 is almost pointless, just changing the thread tests run on but
without any interesting concurrency.

Rearrange a bit how fm_driver decides what flags to pass to which
invocations of FM, so individual runs can easily override defaults (e.g.
--nativeFonts overriding the usual --nonativeFonts).  Use that here to
set --race 0 for unit tests; many unit tests are not reentrant.

Change-Id: Ida451626c093793b0805d3036beb185e7d54f27e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376761
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-02 20:43:05 +00:00
Mike Klein
a9e62e893b add flags for clipping to FM
tabl_mozilla.skp is uselessly large without a clip.

Change-Id: I6e8ab8c31e790b6629be01e6eeb2e8d60c6ff56f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378360
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 19:06:24 +00:00
Mike Klein
db8340f15f scope AutoreleasePool tightly
We think this has the same effect as written right?

I'm looking ahead to a mode of FM where each round
of this loop might run in a different thread, and
I think there we'd want to give each its own pool?

Change-Id: I8f4e215fb2f96f4fe433d15f8654445200fdca5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377896
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-02 16:25:53 +00:00
Mike Klein
4636ac68de print only once per source in FM
This does mean we won't print the name of a failing source, but that
shouldn't be needed so much given how FM runs on the bots... should be
obvious what failed without it.

On the flip side, this means each log line will print out atomically,
which might be nice when reading through TSAN runs with async threads.

Change-Id: Ib971416f255e60ea6d900ea687abb8404d799dfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377916
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-01 19:57:00 +00:00
Jim Van Verth
07c8401a54 Getting Metal shader precompiling working.
* Adds GrMtlPipelineStateBuilder::PrecompileShaders.
* Adds GrMtlPrecompileShaderLibrary.
* Stores metadata with SkSL shaders so we can convert to MSL properly

Change-Id: Id2c23a54cc04ca3b61a639c1cbc7234b697c41ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376856
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-02-26 22:43:17 +00:00
Mike Klein
6706c9fa14 use SkColorInfo in fm
Just refactoring code that predates SkColorInfo.

Change-Id: Iba5ffdf91e2e2517bf55ea8c5a36c4fe6583a6b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376760
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-26 19:52:34 +00:00
Robert Phillips
96f6d9a37f Add DDLTileHelper option to tile separately in x & y
afaik Chrome only tiles in Y which should yield less threaded text blob contention

Change-Id: I9ff484ed2ce66428e2d7ca6188eba79cd99b1547
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376608
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-02-26 16:34:51 +00:00
Robert Phillips
1cc7d45f9a Remove ViaDDL
With the removal of promise image texture caching here (https://skia-review.googlesource.com/c/skia/+/375201) we no longer need these configs.

This can't land until after (https://skia-review.googlesource.com/c/skia/+/376221) which removes use of these configs on the bots.

Change-Id: I49e122fc820d5b72498b65933e15bcc74c0f3fa3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376219
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-02-26 15:31:01 +00:00
Brian Salomon
76d13bbdf8 Remove texture idle proc mechanism
Bug: skia:11369
Change-Id: I0d1a74cc64dd74486acbb69df529ccc0f8b63ef3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375202
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-02-25 22:23:20 +00:00
Adlai Holler
38b9a4bc3e Revert "Support sharing promise images between DDLs"
This reverts commit 07e11d48cb.

Reason for revert: Broke DDL3_ASAN and DDL3_TSAN

Original change's description:
> Support sharing promise images between DDLs
>
> - Migrate our code to SkImage::MakePromiseTexture
> - Have DDLTileHelper share one SKP and one set of promise images across all tiles.
> - Disallow on-the-fly allocation of mips for promise textures.
>
> Bug: skia:10286
> Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I939b14875d1a20e4a92eab94680adcfe9596ad81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10286
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375738
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-02-25 17:55:00 +00:00
Adlai Holler
07e11d48cb Support sharing promise images between DDLs
- Migrate our code to SkImage::MakePromiseTexture
- Have DDLTileHelper share one SKP and one set of promise images across all tiles.
- Disallow on-the-fly allocation of mips for promise textures.

Bug: skia:10286
Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-25 17:00:19 +00:00
Chris Dalton
4ac9aadd30 Make it possible to enable hw tessellation outside of test builds
Bug: chromium:1172543
Change-Id: I9733a8758d902a8d46d442de5d099d923efc2184
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-25 16:21:09 +00:00
Ben Wagner
5d9c20ecc9 Make TextBlob 'Text' allocators public.
This will allow users to create PDFs with the actual text embedded. This
will allow for correct search and copy operations on the generated PDF.

Since these are now public, SkTextBlobBuilderPriv is no longer needed
and is removed. For consistency, the allocRunRSXform overload is renamed
to allocRunTextRSXform.

Change-Id: I44be82d9038a433e1221d5cbfd8ed113ecb6d4fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375017
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-24 18:48:44 +00:00
Ben Wagner
0baacb50bc Remove lang parameter from TextBlob alloc methods.
The 'lang' was never stored or used, so this makes no current practical
difference. The original intent was to be able to specify a language so
that it could be emitted as a 'Lang' override in the 'ActualText' when
generating a PDF. However, due to the way 'ActualText' is generally used
this would be impractical. If there is ever a desire to mark up sections
of the PDF with a specific language it would be better handled in a
different way.

Change-Id: Id63596190235fc45ce17249b9b578b6f9b838b2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375060
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-24 17:08:04 +00:00
John Stiles
cbd65754f2 Revert "Performance experiment: Disable SkSL optimization in nanobench/skpbench"
This reverts commit b34a896c12.

Reason for revert: experiment is complete

Original change's description:
> Performance experiment: Disable SkSL optimization in nanobench/skpbench
>
> Cloned from http://review.skia.org/369716
> Re-running the experiment now that @switch is supported when
> optimizations are disabled.
>
> Change-Id: I428051d9c679a8084589fba428a637f36587be16
> Bug: skia:11341
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374516
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,brianosman@google.com,johnstiles@google.com

Change-Id: I1e91c55538ef35f413f2c41c83df9d9c0f29d9a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375016
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-24 14:14:26 +00:00
Ben Wagner
9a7fcf7eda Scale Viewer status by backing scale.
The Viewer status box 's' is quite small on high resolution displays.
The 'u' key doubles its size and has been used as a work-around, but
let the status box scale take the backing scale into account.

Change-Id: I98db37a4ed86698ba7c02666478dff248ff6daae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374377
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-02-24 03:42:04 +00:00
John Stiles
b34a896c12 Performance experiment: Disable SkSL optimization in nanobench/skpbench
Cloned from http://review.skia.org/369716
Re-running the experiment now that @switch is supported when
optimizations are disabled.

Change-Id: I428051d9c679a8084589fba428a637f36587be16
Bug: skia:11341
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/374516
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-23 22:21:30 +00:00
Brian Salomon
e666254f0f Remove SkImage_Base::peekProxy.
This is the only place we provide a proxy from a SkImage other than
asView() and is only used in one place in the library. Add a utility
function to replace uses in tests based on asView().

Bug: skia:11208
Change-Id: Ica6eae6e5f153f208523331566acc0360925a20e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-23 19:59:31 +00:00
Robert Phillips
cd1e397350 Add new experimental ddlbench
This intended to let us experiment w/ threaded compilation before having
to worry about upstreaming features.

Change-Id: Id9d1807de0fa16475184203d293e00bfaf5fcc01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373736
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-02-23 13:15:20 +00:00
Jim Van Verth
2db4ba1caf Reland "Remove ARC from tools lib."
This is a reland of 4c4c80fa12

Original change's description:
> Remove ARC from tools lib.
>
> Trying this in baby steps to manage leaks better.
>
> Change-Id: Id8597ba236c752bcbf1c7ec94f6c1021e636d547
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372556
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

Change-Id: Ib5c949ee9e8ac9f47de1991297aec718f3185424
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373616
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-22 17:55:52 +00:00
Jim Van Verth
e8a1c0150b Revert "Remove ARC from tools lib."
This reverts commit 4c4c80fa12.

Reason for revert: Need to update Flutter with sk_cf_obj renaming.

Original change's description:
> Remove ARC from tools lib.
>
> Trying this in baby steps to manage leaks better.
>
> Change-Id: Id8597ba236c752bcbf1c7ec94f6c1021e636d547
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372556
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

TBR=jvanverth@google.com,bsalomon@google.com,adlai@google.com

Change-Id: I7dc226d002184b80a1d8d2aee09d122d2e13d732
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372680
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-02-20 00:08:41 +00:00