Commit Graph

11461 Commits

Author SHA1 Message Date
John Stiles
1a2cef7fbc Avoid returning a DSLExpression with an invalid type.
We shouldn't return expressions that violate basic invariants (such as a
Constructor with an invalid Type) because future code should be able to
rely on those invariants to hold. Returning a Constructor with an
invalid Type broke some assertions I had added; these assertions checked
that the Constructor's type was valid before operating on it.

Change-Id: I861927ad042f30d4a1e20896149ce404f4160ffb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455657
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-04 17:34:49 +00:00
Ethan Nicholas
de42a9d2fc Fixed unsupported type errors in pure DSL
Change-Id: I5a57e2db46734ca08825e6aef7a6363bcaada45a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453759
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-10-04 14:32:19 +00:00
Jim Van Verth
bedb69ccfb Clean up #includes in SkCFObject.
SKCFObject.h wasn't compiling without prefixing it with other includes,
so adding them into the actual file itself. Also changed to use the
more generic __APPLE__ as a guard rather than BUILD_FOR_MAC or
BUILD_FOR_IOS defines, and added the file to BUILD.gn so it will be
added to Xcode projects.

Change-Id: I67a48d0156ef1eb5c69dd045f0acadf147053eb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455163
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-04 14:02:02 +00:00
Mike Reed
ce22e059ff pulling the plug
Change-Id: I89c7bfb536d11cfbd1a13218d71eec24678e64f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455258
Commit-Queue: Heather Miller <hcm@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
2021-10-02 13:33:49 +00:00
John Stiles
906e9eb538 Emit qualifiers in the GLSL ES-required order.
This should fix a failure in the ES2 conformance suite's "const_in_int".

Change-Id: I8b5487749291ef57712b8fe6c3949dc7c3e76883
Bug: skia:12499
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455157
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-10-01 19:09:43 +00:00
John Stiles
66aa1ded16 Allow precision qualifiers in function params.
Previously, `Type::applyPrecisionQualifiers` would return a new type
(e.g. `mediump + float` returned `half`) but left the precision
qualifier flags as-is. This was implemented that way because the
modifiers were already baked into a pool, so mutating them was
difficult.

The rewritten DSLParser does not share this limitation--every place
where applyPrecisionQualifiers is used, the Modifiers are easily
mutable. As a result, `applyPrecisionQualifiers` can now clear the
precision-qualifier bits on the Modifier, meaning that `half` and a
`mediump float` will generate the exact same Type/Modifier combination.

This change fixes a bug where precision qualifiers were not allowed on
function parameters. (See `check_parameters` in FunctionDeclaration.cpp
to pinpoint the cause of the error. A less-invasive fix could have just
marked those modifier bits as allowed in `check_parameters`, but this
fix addresses the root of the issue and is honestly how I wanted
`applyPrecisionQualifiers` to work all along.)

Change-Id: I331813efa54138f469a0d5bff2d274cd3ce64b70
Bug: skia:12489
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455156
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-01 18:59:27 +00:00
Ethan Nicholas
791c0d36a6 Remove ASTNode and SkSLParser
Now that DSLParser is used for everything we can get rid of this
unused code.

Change-Id: I7b586a7d7a51ac9df7d2c52baa1f525233f489b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443076
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-28 13:36:49 +00:00
Kevin Lubick
cabbddfdd0 [infra] Allow RubberStamper to revert public API changes
RubberStamper won't +1 changes that modify include/*.h or other
non-trivial files, unless they are a clean revert.

Even after this change, someone on include/OWNERS will be needed
to verify actual API changes, one won't be able to just use
rubber-stamper to bypass the check.

Bug: skia:12124
Change-Id: I0e6af8b7e384c1013cf1d5b61bd8c3e55df0046e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453484
Owners-Override: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-09-28 13:30:09 +00:00
John Stiles
43264640f2 Revert "Remove SkRuntimeShader::makeImage."
This reverts commit 65967ab2c9.

Reason for revert: used in Android - http://screen/3fk6K3RUWZG8x5f

Original change's description:
> Remove SkRuntimeShader::makeImage.
>
> We don't have any known users, and it no longer exposes anything that
> a user can't just do directly.
>
> Change-Id: Id653a6be3f265a2847b1670f3e6c054cf2d094a2
> Bug: skia:12482
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453142
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:12482
Change-Id: I6cc2e79796f53c42e9f53b7d9927c853e7e2d71c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453317
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-28 13:24:50 +00:00
John Stiles
65967ab2c9 Remove SkRuntimeShader::makeImage.
We don't have any known users, and it no longer exposes anything that
a user can't just do directly.

Change-Id: Id653a6be3f265a2847b1670f3e6c054cf2d094a2
Bug: skia:12482
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453142
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-27 20:26:49 +00:00
Ethan Nicholas
89cfde1dbe Reland "Renamed SkSL "offset" to "line""
This reverts commit cc91452f0a.

Change-Id: I7eff0ddeebef4ce298893f9b3ba410b09647e9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453138
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-27 19:52:08 +00:00
Ethan Nicholas
5fad2b8849 Reland "Use SkSL "offset" to actually mean "line""
This reverts commit a909dd6b8d.

Turns out those reportPendingErrors() calls I removed were in fact
necessary, just not on any of the CQ bots.

Change-Id: I8be0898ac0b41dbb703a35f705cac06ca716c0b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453077
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-27 19:48:39 +00:00
Brian Osman
837b89c505 Reland "Add OWNERS to include (and include/private) to enforce API review"
This is a reland of be0e255c3e

Original change's description:
> Add OWNERS to include (and include/private) to enforce API review
>
> Change-Id: I3ae83fbdcb4b3b13150df8b6a6461c36cbeaa55e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445641
> Reviewed-by: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I090456a05128865bc134b9c4df4e5ffcb5d0e1dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450479
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-09-27 18:20:19 +00:00
Brian Osman
a909dd6b8d Revert "Use SkSL "offset" to actually mean "line""
This reverts commit 47f76853c6.

Reason for revert: Test failures

Original change's description:
> Use SkSL "offset" to actually mean "line"
>
> SkSL internally tracks token offsets, but only ever reports errors using
> line numbers. With the introduction of the DSL, which (being embedded in
> C++ source) only has access to line numbers in the first place, tracking
> offsets went from merely providing little benefit to actively making
> life more difficult.
>
> We are changing SkSL's position tracking from handling offsets to
> handling line numbers, but to simplify the review process the change is
> split up into two main steps. The first step (this CL) starts using
> line numbers everywhere, but avoids the thousand-line churn of actually
> renaming "offset", so most "offset" fields, variables, and parameters
> will be briefly misnamed and will actually contain a line number.
>
> The followup CL will complete the process by renaming all of the
> now-misnamed fields, variables, and parameters, but will not make any
> behavioral changes.
>
> Bug: skia:12459
> Change-Id: I30dc87cf4b816c5ddd7b8ae1be32586388962085
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451419
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

Bug: skia:12459
Change-Id: I562d9980cd43a2fc5108e562155fe731a1761dca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452720
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-24 19:03:24 +00:00
Brian Osman
cc91452f0a Revert "Renamed SkSL "offset" to "line""
This reverts commit 58d47fa1ec.

Reason for revert: Tree broken

Original change's description:
> Renamed SkSL "offset" to "line"
>
> https://skia-review.googlesource.com/c/skia/+/451419 changed the meaning
> of "offset" throughout SkSL, so that it was actually tracking line
> numbers rather than offsets (and thus had a misleading name). This
> completes the transition by renaming all of the now-misnamed "offset"
> fields, parameters, and variables to "line'.
>
> Bug: skia:12459
> Change-Id: I394e6441f6ddfaad6d4098352ba9b1bfeaf273be
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450644
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

Bug: skia:12459
Change-Id: Idcec3b65cb81d51c8b860c4388578700030b40a9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452718
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-24 18:59:18 +00:00
Ethan Nicholas
58d47fa1ec Renamed SkSL "offset" to "line"
https://skia-review.googlesource.com/c/skia/+/451419 changed the meaning
of "offset" throughout SkSL, so that it was actually tracking line
numbers rather than offsets (and thus had a misleading name). This
completes the transition by renaming all of the now-misnamed "offset"
fields, parameters, and variables to "line'.

Bug: skia:12459
Change-Id: I394e6441f6ddfaad6d4098352ba9b1bfeaf273be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450644
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-24 14:23:15 +00:00
Ethan Nicholas
47f76853c6 Use SkSL "offset" to actually mean "line"
SkSL internally tracks token offsets, but only ever reports errors using
line numbers. With the introduction of the DSL, which (being embedded in
C++ source) only has access to line numbers in the first place, tracking
offsets went from merely providing little benefit to actively making
life more difficult.

We are changing SkSL's position tracking from handling offsets to
handling line numbers, but to simplify the review process the change is
split up into two main steps. The first step (this CL) starts using
line numbers everywhere, but avoids the thousand-line churn of actually
renaming "offset", so most "offset" fields, variables, and parameters
will be briefly misnamed and will actually contain a line number.

The followup CL will complete the process by renaming all of the
now-misnamed fields, variables, and parameters, but will not make any
behavioral changes.

Bug: skia:12459
Change-Id: I30dc87cf4b816c5ddd7b8ae1be32586388962085
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451419
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-24 13:16:11 +00:00
John Stiles
11101181b9 Restore DSLWriter to relying on a Compiler again.
This CL undoes most of the changes from http://review.skia.org/451739
and http://review.skia.org/451741 as these changes opened up a threading
can of worms that is probably not solvable. I no longer have a use case
for the new dsl::Start APIs.

Change-Id: Icf0a86364d258ea3bbf0d18bbdbd130ef590c02f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452097
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-23 20:26:20 +00:00
John Stiles
1a117d7642 Allow dsl::Start with a Context instead of a Compiler.
This should allow lightweight DSL usage without needing access to a
Compiler, but some operations won't work (for now) because they rely on
the IRGenerator. Ideally, as we will reduce our dependence on
IRGenerator, these limitations will fade away.

Change-Id: I93880f153a7425b208bdc4a866169d037e4553a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451739
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-09-22 20:29:44 +00:00
Ethan Nicholas
ec8eef24fb Slightly updated DSL Switch API
PossibleExpression / PossibleStatement should only have been used in
cases where we do not have a position available.

Change-Id: I8cd3cafce21b3c18f03e75a0c822eea75c86f225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451896
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-22 20:00:43 +00:00
Greg Daniel
77435597fa Add memoryless attachment support for vulkan dmsaa.
For this initial landing, we actually have the memoryless support
disabled because we need to update Chrome's vk memory allocator to
handle the new lazy flag added in this CL. Otherwise we will fail to
make dmsaa attachments and not draw anything.

I tested this on ARM and the it does look to keep the size of all the
lazy msaa attachments at 0. I test with both 4 and 8 sample counts. To
confirm the size check, I changed the store op on the msaa attachments
from discard to store and the reported memory size did grow.

Bug: skia:11809
Change-Id: I977f337b922cdbdbce16d67945369246e3547c17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451296
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-09-22 19:06:02 +00:00
Jim Van Verth
8d59fe04b8 Add memoryless parameter for MSAA attachment creation
Bug: skia:12086
Change-Id: I9ad293852850253a8c3b1ca6bac4cf86900daec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449842
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-21 14:17:39 +00:00
Greg Daniel
84261653c5 Reland "Add new GrSurfaceInfo class and related backend structs."
This is a reland of 6aac1193a7

Original change's description:
> 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>

Bug: skia:12402
Change-Id: Id540bea408d72ceba43ec4245c3748d630121926
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450277
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-09-20 20:44:53 +00:00
Ben Wagner
3d9c73c100 Use thread_local on iOS
Using thread_local on iOS requires iOS 9 or greater. Chrome for iOS
now requires 13, Skia sets the minimum to 11 for test builds, and
Flutter actively does not support 8 or earlier. Dropping support for
iOS 8 in practice and moving to iOS 9 makes it possible to use
thread_local without reservations on iOS.

Change-Id: Ib80cbe24e8154be650f343643281384c17356242
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447497
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-09-20 17:51:38 +00:00
Jim Van Verth
14a9b089b6 Reland "Revert "New approach to GrProcessor uniforms.""
This reverts commit a59925fb1d.

Reason for revert: Speculative revert for https://crbug.com/1251070

Original change's description:
> Revert "Revert "New approach to GrProcessor uniforms.""
>
> This reverts commit ae59426ea6.
>
> Bug: skia:12182
> Change-Id: I591a0a89ffad1a3d5d867dd247ceeec71b6041a4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449516
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12182
Change-Id: I2f37c7e9675dd35194791340012e1b4135b076a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450440
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-20 14:51:44 +00:00
John Stiles
b43596f10b Make DSLStatement-from-SkSL ctors public.
Internally, these can be very useful for assembling code fragments.

Externally, our users shouldn't have any SkSL::Statement or
SkSL::Expression objects to pass in, so it's still effectively a non-
public API.

Change-Id: I03b88507ce932b472ab5b9aed68ea67dcd10b13f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449855
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-20 14:09:14 +00:00
Ethan Nicholas
c973d26854 Fixed DSLParser assertion error uncovered by fuzzer
Bug: oss-fuzz:38108
Change-Id: I0e055d837923f00b982bc395dbf29b6ff59a3b21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448896
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-20 13:48:41 +00:00
Jim Van Verth
2f7ee02577 Revert "Add new GrSurfaceInfo class and related backend structs."
This reverts commit 6aac1193a7.

Reason for revert: Breaking Mac bots in Chromium roll. Looks like
they depend on getVkImageInfo for an unknown reason, and it's 
hidden behind SK_VULKAN.

Original change's description:
> 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>

Bug: skia:12402
Change-Id: I3c9642354dae8c955bc58d281700536393f84519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450199
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-18 16:35:38 +00:00
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
Brian Salomon
a59925fb1d Revert "Revert "New approach to GrProcessor uniforms.""
This reverts commit ae59426ea6.

Bug: skia:12182
Change-Id: I591a0a89ffad1a3d5d867dd247ceeec71b6041a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449516
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-09-17 16:02:01 +00:00
Kevin Lubick
7cece5e053 [fuzz] Require explicit SK_BUILD_FOR_*FUZZER
The existing define wasn't being used to compile :skia
(but it is for building the fuzzer code).

After this lands, oss-fuzz will be updated to set that
flag too. https://github.com/google/oss-fuzz/pull/6462

The change to SkTypes.h is to remove bit-rotted code that
prevents oss-fuzz from working.

Change-Id: I95b48d76dd3878d04ba3a5d021359ca200c20a0c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449576
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-09-17 11:59:31 +00:00
Ethan Nicholas
2280058446 Reenable DSLParser
Change-Id: I1819b2c40902611d7e86245bff73ad8c2bd7629c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449060
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-16 15:28:19 +00:00
Ethan Nicholas
5b1ae4b285 Fix DSLParser clang-tidy warning
DSLParser is #ifdef'ed out, so this doesn't currently impact anything,
but is necessary to be able to reenable the DSLParser.

Change-Id: I76d48b1b855f42ba3bc8b0734199af6e2a88becb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449517
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-16 14:49:15 +00:00
Robert Phillips
de60d7a64d Move more classes to skgpu::v1 namespace
Bug: skia:11837
Change-Id: If0bfb3009693b203b2080a1d43cc3b1865c3ab9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448274
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-15 15:20:24 +00:00
Ethan Nicholas
fd1332f5a7 Reland "Fixed DSL assertion error on source files containing nulls"
This is a reland of db38ad7b14

Original change's description:
> Fixed DSL assertion error on source files containing nulls
>
> The assertion was there to make sure we weren't running off the end of
> the source, but naturally fails in the presence of legitimate embedded
> nulls.
>
> Change-Id: I3b80499e9b182c9ea046c479f35d7a965d548401
> Bug: oss-fuzz:38107
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447182
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: oss-fuzz:38107
Change-Id: Idb1a6b7c64d2bb954edadae828d6de808158fd3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448660
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-15 15:00:23 +00:00
Brian Osman
e76530dbdd Replace DSL's Sample() with DSLGlobalVar::eval()
Bug: skia:12302
Change-Id: I7ff7bae388c5991f2c23c8945355fea55c42095a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447436
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-14 14:54:03 +00:00
Brian Salomon
ae59426ea6 Revert "New approach to GrProcessor uniforms."
This reverts commit 10c9f36bdd.

Reason for revert:bad gms, maybe blocking chrome roll

Original change's description:
> New approach to GrProcessor uniforms.
>
> The important aspect is that it allows knowing the uniforms that will
> be used by a set of processors without having to create ProgramImpls.
>
> GrProcessor subclasses specify uniforms at creation time in a similar
> style to how GrGeometryProcessors already specify attributes. That is,
> they initialize a span of structs describing the uniform which may
> contain void uniforms that are skipped. Unlike attributes, the struct
> contains an offset into the processor where the data is stored.
>
> GrUniformAggregator is used to collect the uniforms from all processors
> that compose a draw and mangle their names. The ProgramImpl subclasses
> query the aggregator for their uniform names when emitting code.
>
> The old system for uniforms is left intact and only three processors,
> one GP, one FP, and one XP, are updated to use the new system.
>
> Some pieces that are missing before everything can be moved over:
> -support for uniforms not owned by GrProcessor (e.g. rt-adjust)
> -support for samplers
> -helpers for common patterns
>  (e.g. GrGeometryProcessor::ProgramImpl::setupUniformColor(),
>   and the various matrix helpers on ProgramImpl)
>
> Bug: skia:12182
>
> Change-Id: I21c1b7a8940eb9b8aad003f5a2569e43977a33d2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440841
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12182
Change-Id: I6cc508900a599d27124f8ba48597593192d5d807
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448418
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-13 21:22:16 +00:00
Brian Salomon
10c9f36bdd New approach to GrProcessor uniforms.
The important aspect is that it allows knowing the uniforms that will
be used by a set of processors without having to create ProgramImpls.

GrProcessor subclasses specify uniforms at creation time in a similar
style to how GrGeometryProcessors already specify attributes. That is,
they initialize a span of structs describing the uniform which may
contain void uniforms that are skipped. Unlike attributes, the struct
contains an offset into the processor where the data is stored.

GrUniformAggregator is used to collect the uniforms from all processors
that compose a draw and mangle their names. The ProgramImpl subclasses
query the aggregator for their uniform names when emitting code.

The old system for uniforms is left intact and only three processors,
one GP, one FP, and one XP, are updated to use the new system.

Some pieces that are missing before everything can be moved over:
-support for uniforms not owned by GrProcessor (e.g. rt-adjust)
-support for samplers
-helpers for common patterns
 (e.g. GrGeometryProcessor::ProgramImpl::setupUniformColor(),
  and the various matrix helpers on ProgramImpl)

Bug: skia:12182

Change-Id: I21c1b7a8940eb9b8aad003f5a2569e43977a33d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440841
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-09-13 19:55:06 +00:00
Michael Ludwig
47d824415e Revert "Fixed DSL assertion error on source files containing nulls"
This reverts commit db38ad7b14.

Reason for revert: breaking g3 roll since it thinks the test case is "binary" not flagged as binary

Original change's description:
> Fixed DSL assertion error on source files containing nulls
>
> The assertion was there to make sure we weren't running off the end of
> the source, but naturally fails in the presence of legitimate embedded
> nulls.
>
> Change-Id: I3b80499e9b182c9ea046c479f35d7a965d548401
> Bug: oss-fuzz:38107
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447182
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: oss-fuzz:38107
Change-Id: I650d12d728b5d932bda79e81205b873d8b44771f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447936
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-11 18:13:13 +00:00
Ethan Nicholas
9a1f92e4ff Add ExpressionArray variants to DSL calls
This allows us to reduce the number of temporary arrays being created by
going directly to the final array type.

Change-Id: I6161c663f7f69ed1d323ae05b4a92b2d0c1b4c04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447194
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-10 20:06:56 +00:00
Ethan Nicholas
db38ad7b14 Fixed DSL assertion error on source files containing nulls
The assertion was there to make sure we weren't running off the end of
the source, but naturally fails in the presence of legitimate embedded
nulls.

Change-Id: I3b80499e9b182c9ea046c479f35d7a965d548401
Bug: oss-fuzz:38107
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447182
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-10 18:44:22 +00:00
Brian Osman
d4da5d1fd6 Remove deprecated field from SkRuntimeEffectBuilder::BuilderChild
Android has been updated to use fChild, so fIndex is dead.

Change-Id: Iec728aa91a4ad47f84e2188ade75f639f0c6087c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447186
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-10 17:41:10 +00:00
Ethan Nicholas
c9d65f0b8a Fixed duplicate function definition error discovered by fuzzer
Bug: oss-fuzz:38140
Change-Id: I76a1b3ef8289b3089192d043d173677c00741a54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445836
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-10 17:35:52 +00:00
Heather Miller
588dcc093d Update Skia milestone to 96
Change-Id: I635df8267340a9068b80a2e6c001958cfb2d10e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447578
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2021-09-10 11:51:00 +00:00
John Stiles
2533953aa3 Add Round() to DSL.
I wrote some code which needed Round(); it isn't in ES2 so it wasn't in
the DSL intrinsic set yet.

Change-Id: I304f61b502a68d255d15899181e34fcae2ef16a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447017
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-09 19:24:27 +00:00
Ethan Nicholas
327241208a Switched DSL error handling from const char* to string_view
This allows us to get rid of a lot of .c_str()'s.

Change-Id: I09102f90d69620614dc5a7a2ebc64bd3e9b1c437
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445816
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-07 18:48:04 +00:00
Brian Osman
ca5d31e459 Revert "Add OWNERS to include (and include/private) to enforce API review"
This reverts commit be0e255c3e.

Reason for revert: Android autoroller can't create CLs

Original change's description:
> Add OWNERS to include (and include/private) to enforce API review
>
> Change-Id: I3ae83fbdcb4b3b13150df8b6a6461c36cbeaa55e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445641
> Reviewed-by: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I368fa6293674d65b45f19c60dd6d47eaf33962b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446157
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-07 17:17:09 +00:00
Brian Osman
be0e255c3e Add OWNERS to include (and include/private) to enforce API review
Change-Id: I3ae83fbdcb4b3b13150df8b6a6461c36cbeaa55e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445641
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-09-07 15:45:28 +00:00
Brian Osman
0ad2d013b1 SkSL: Turn DSL parser off again
Several fuzzer issues, and one Chromium issue that's blocking the roll.

Bug: chromium:1246795
Bug: skia:12423
Change-Id: I00370b74569b447e543d9a1f22c588eb493063da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445960
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2021-09-07 14:21:57 +00:00
Ethan Nicholas
360db877be Fix line numbers of several DSLParser errors
Change-Id: I82e0d29fbcb5be93fe20a1fb442e2a429e6cab8e
Bug: skia:12411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445644
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-03 22:12:22 +00:00
Ethan Nicholas
0ed278b42d Flip the switch to activate DSLParser
Change-Id: Id894eb70273454716eb33c85dff2056333e90cdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445281
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-03 19:07:17 +00:00
Ethan Nicholas
678ec7187a Added DSL modifiers declarations
Change-Id: I97a7c5cfb3ce3f430074092616a3256422c8ad5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444979
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 17:02:59 +00:00
Ethan Nicholas
642215e8cd Added DSL extension support
Change-Id: Ia6dd32e91aa242162d4687f5c05832b87e2560ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444977
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 16:22:26 +00:00
Ethan Nicholas
b61a243294 Refactored swizzle domain testing
This moves the swizzle domain test into the path used by the DSL so that
the error check benefits both sides. To make this possible we need to
be able to distinguish between equivalent swizzle components like x and
r, so they aren't collapsed down to the same component until the very
end.

Change-Id: I48f2582886391eabd7ce6eae949babdeead6051e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445280
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-09-03 14:50:57 +00:00
Ethan Nicholas
a248a9a721 Added line numbers to DSLParser type errors
Change-Id: I2fb227d74279e38118fc466718ca742221888443
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444877
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-02 13:05:37 +00:00
Brian Osman
f80ef38d0f Add skstd::string_view::substr
Change-Id: I06ba9dd9ed8af8555233ddfa10d3e0ec6babc2ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444759
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-01 20:56:51 +00:00
Ethan Nicholas
600481f871 Made position parameter of DSL ReportErrors required
This adds line numbers to a bunch of errors which were previously
missing them.

Change-Id: Id77c08d168b0a2d8a0131a53aa004bf37b8bec02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444176
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-01 14:20:14 +00:00
Brian Osman
7db3ab5787 Remove SK_HAS_SRGBA_COLOR_TYPE guard
Chromium has been updated, this is no longer needed

Change-Id: I0bcf65c79d454c50796e04e33c213de2295c0e6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441877
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-09-01 13:46:13 +00:00
Ethan Nicholas
51b4b86da6 Improve DSL error reporting with invalid array sizes
This eliminates an extra "expected int literal" error when the
array size is an invalid expression.

Change-Id: Iaf5d15316df3ec5200d51d73c14d7e428ce17be9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443236
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-31 21:04:18 +00:00
Greg Daniel
0e32aa8a3a Rename some GrD3DTypes* header files.
I want to free up GrD3DTypesPriv to actually be private types that
include real d3d objects.

Change-Id: Id38d6baae4fa68c19301b27d4f9d51eb1d9c5db0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443676
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-31 18:49:46 +00:00
Ethan Nicholas
27633232f4 Fixed DSL handling of struct field modifiers
This fixes an issue where the field modifiers were incorrectly applied
and adds proper error detection to the modifiers.

Change-Id: I8cd88d3a459df81250c267e6007bca9663b7eda4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443237
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-31 16:35:00 +00:00
Ethan Nicholas
6f20b8d5f7 Added line numbers to DSLParser errors
Change-Id: I895c3d94c9a49cc0350b287d3aa722050b91295e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443036
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-31 12:45:45 +00:00
Ethan Nicholas
5c4463ee0e Fixed DSLParser code rot
Where DSLParser is #ifdef'ed out, it had experienced some code rot and
was no longer building. This fixes it to be able to successfully build
when SKSL_DSL_PARSER is set to 1.

Change-Id: I5846b05ba3342b5b1502663577663e332c55529b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442976
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-08-30 00:30:27 +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
Brian Salomon
0454fcb8c8 dedup tess shader flags
Change-Id: I474732cafb7d1bb8b6bdfe95fc07ecc149177ae0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442597
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-27 16:31:22 +00:00
John Stiles
aca3f22491 Add skstd::optional::emplace.
Change-Id: I178ae881191e8ed7ce5399e806838a44d2358e31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442319
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-26 19:03:29 +00:00
Robert Phillips
3e87a8eda9 Move GrOpsTask to gpu/ops and the the skgpu::v1 namespace
Bug: skia:11837
Change-Id: I9ee6343b5144b02e8f455df0ea01b8199a8f14e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440837
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-25 18:32:17 +00:00
Michael Ludwig
8c75b2d30e Simplify conservative clip tracking for SkNoPixelsDevice
Deletes SkConservativeClip as a type, it was only used by
SkNoPixelsDevice at this point.

Simplifies the clip tracking to only rely on intersect/difference ops
(but also expands it to support updating overall bounds if the diff
op is a sufficiently large rectangle).

Adds SkRect::roundIn() -> SkIRect to match the exposed API for round()
and roundOut().

Bug: skia:10205
Change-Id: I1337a51a8a4e51f94fe2b5f9ab29a0b5058b8094
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437737
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-24 18:23:43 +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
Ben Wagner
e127304700 Fix stringop-overflow in SkString
GCC 10.2.1 gives the following warning as error in a release build

../../src/core/SkString.cpp:227:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  227 |     rec->data()[len] = 0;

which is detecting that fBeginningOfData is a char and that this code
cannot be reached with len == 0. Work around this by changing
fBeginningOfData to be an array of one char containing the empty string
by default.

While making this change, also make fBeginningOfData and fRefCnt
private.

Change-Id: Ic254bac465fcd02707a06010e0d7501520f7271d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441136
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-08-23 17:19:44 +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
Mike Reed
95c9734bac Reland "In SkCanvas destructor, discard (rather than blit) unbalanced layers"
This is a reland of 879b2f2e6e

Now includes a test that demonstrates the bug found by Chrome's fuzzers,
and a different (safer) implementation.

Original change's description:
> In SkCanvas destructor, discard (rather than blit) unbalanced layers
>
> Bug: skia:12267
> Change-Id: I6808f62b2385a3466b1a93db905041a6529f58cb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433360
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

Bug: skia:12267
Change-Id: Ide7dc61b054761826faa5bca3eec6be2fc63c83a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-20 19:35:57 +00:00
Robert Phillips
461c539a04 Move several more PathRenderers to skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ifa1da88aafcaa96e0e885facaeb849cc9963bcfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-17 22:19:11 +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
Ethan Nicholas
4a5e22a8c8 Further unified error handling between SkSL and DSL
This eliminates the SkSL ErrorReporter class and funnels everything
through the DSL ErrorHandler. Since the DSL error handler can be
changed, this required a number of updates to ensure that things work
properly in the face of custom error handlers. There is probably more
work to be done in that area, but this at least passes all existing
tests.

Change-Id: Iaee27b79fc4ed426c484ccab257c09d28619ead5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438116
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-13 22:26:10 +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
John Stiles
efde90d973 Add $es3 modifier to SkSL.
This modifier is currently allowed on built-in functions only.

The presence of this modifier will be used to indicate intrinsics which
are ES3-specific (and therefore, not allowed in user code under typical
circumstances).

Change-Id: Ice6be8d9d1b2bf0c8f07f2a89f335bb2f90f6681
Bug: skia:12202
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439057
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-13 14:07:40 +00:00
Eric Boren
280ced6bd1 Update Skia milestone to 95
Change-Id: I17a6adf5f14cfc160c13a2341453e9767ab39f0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439158
Reviewed-by: Eric Boren <borenet@google.com>
2021-08-13 13:51:26 +00:00
Ethan Nicholas
a2fd01c56d Made PositionInfo's capture explicit
Breaking out the Capture method and creating a separate nullary
constructor makes the magic more obvious and makes it easier to
create empty positions.

Change-Id: Idd174522f11620fbd11679c7cd8f770ada5bde7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438820
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-08-12 16:25:44 +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
John Stiles
ed7b4f6a23 Reduce code size of DSL Struct().
The savings here are modest, likely because structs are so uncommon.
Bloaty: http://screen/BsJyB8eg62aQa2X

Change-Id: Ie1b2a13b2b545faad24f7983f7ebf8021fa328a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438556
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-11 16:42:12 +00:00
John Stiles
d6c08c9be8 Reduce code size by eliminating CollectArgs.
Replacing the SkTArray with a SkSpan, and using native parameter-pack
expansion instead of a complex recursive unpack, allowed the compiler
to simplify the generated code. (It is likely faster as well, since the
SkTArray would allocate memory and this does not.)

Bloaty: http://screen/6JPBv8aP4ukQi8c

Change-Id: I732aff8d0e58de4df65b4e8cc341ec6750dcd8a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438536
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-11 15:54:00 +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
Michael Ludwig
4979d2b18d Simplify device clip restriction impl
This removes all low-level handling of the device clip restriction. It's
no longer part of the SkDevice API, nor needed by any of the backend-
specific classes for handling their clip stack.s

The device restriction is intersected using a regular op when it's set
and it's remembered and manually applied to the device bounds when
resetClip() is called. This is all handled inside SkCanvas.

I also took the opportunity to add asserts and better state transitions
to its implementation, since it had been in an awkward middle ground
between depending on the save/restore stack and not being kept in
sync with it.

Bug: skia:12252
Change-Id: Ie7b13d262fd5e32e0e80aaf46ba009f3722208c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437689
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-10 15:22:38 +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
Ethan Nicholas
a40ddcd63d Pass dsl::PositionInfo by value
We were previously using a mix of pass-by-value and pass-by-pointer (to
allow for explicitly null PositionInfo). Being able to pass a null
PositionInfo didn't really add much, since we can just use a nullary-
constructor PositionInfo instead, so these have all been migrated to
by-value.

Change-Id: Ia31e252cac94f64c4b38c29a54e6e7f752e70672
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437276
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-06 18:10:41 +00:00
Mike Reed
09746be8de Set SkPath.fLastMoveToIndex field from SkPathBuilder
This is a "legacy" field in SkPath, and only needed for editing the
path (in funny cases, such as a relative verb or missing moveto).
When we finally make SkPath immutable, we won't need this field at all.

Note: this CL "fixes" the last 2 columns in path_append_extend gm.
They should appear the same as the previous 2 columns.

Change-Id: Ia5f2e8ec586b5f5189fc3ac2cd513fe89d31cd22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436958
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-08-06 14:12:11 +00:00
Ethan Nicholas
65e368bd81 Fixed DSLParser bit rot
DSLParser had been broken by https://skia-review.googlesource.com/c/skia/+/436156,
but it was not caught due to being #ifdef'ed out. This restores it to working
order.

Change-Id: Ic30ed6bc1950aeed08f7ae32f8060ec29cdc3cd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437019
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-08-06 13:53:14 +00:00
Robert Phillips
1c512239ff Make compressedBackendFormat accessible from GrContextThreadSafeProxy
Not having this available on GrContextThreadSafeProxy was an oversight.
This will allow Chrome to correctly prepare the correct type of compressed promise image.

Change-Id: I3002609fef00a130fe409f318ae0f442ef7591d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437016
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-05 21:44:11 +00:00
John Stiles
e53c721d78 Pass DSLModifiers by reference.
These objects are ~48 bytes apiece.
(Added bsalomon@ for public API review)

Change-Id: I41207929ec2c33caaf877d8530ad7c89b24b63cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436823
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-05 21:34:08 +00:00
John Stiles
4adb66f313 Honor lowp/mediump/highp precision qualifiers in DSLParser.
(Added bsalomon@ for public API review)

Change-Id: Id0e7f656d68f2c7bec2c38ca7ccc8c6bb49e7e91
Bug: skia:12248
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436570
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-08-05 21:34:08 +00:00
John Stiles
020143148f Add parser support for highp/mediump Tokens in vardecls.
These parse into new modifier bits; the IR generator does not yet
support these bits. That's coming in a followup CL.

Change-Id: I362e9227694f9b862eaad100f6afca45a9b62a01
Bug: skia:12248
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436336
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-08-04 21:11:14 +00:00
Robert Phillips
ea3489aa1d Make Gr*ContextPriv class hierarchy parallel Gr*Context class hierarchy
Hopefully this will make it easier to add functionality to the Gr*ContextPriv classes.

This CL is mainly mechanical but did turn up some oddities:

GrDirectContext had a separate 'fShaderErrorHandler' member and a matching GrDirectContextPriv::getShaderErrorHandler method. This now falls back to GrBaseContextPriv::getShaderErrorHandler.

GrDirectContext::resetContextStats was const.

GrRecordingContextPriv's dump and dumpKeyValuePairs methods weren't const.

GrImageContextPriv::abandoned was const. GrImageContext::abandoned is not (bc GrDirectContext can abandon inside abandoned).

Change-Id: I25bb2160031de329d514b30c05752f1bdd1d5339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435716
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-03 14:59:04 +00:00
Brian Salomon
9eca2ca0c6 Use varyings to implement MatrixEffects applied to DeviceCoord FPs.
Modify GrGLSLGP's logic to add a varying for a series of matrix sample
usages below a DeviceSpace FP in the FP hierarchy. The varying is based
off the GPs position output variable in the VS.

Adds a new sample usage type for the DeviceSpace FP.

Bug: skia:12198
Change-Id: Ic39f3296c60a073656ad0c72a431a462d5714e92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435717
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-02 19:39:13 +00:00
Brian Salomon
66b500a07c Remove explicit sample flag from GrFP.
Instead expand the map that is computed by GrGLSLGP to include a bool
that indicates whether each FP requires coords or not.

Now GrGLSLGP is solely responsible for determining which FPs take coords
and inserting any varyings. The rest of the system follows its lead when
generating FP functions and call sites.

Bug: skia:12198

Change-Id: I3471867fb64e94c7775c0b6209998159abeb6714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435018
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-02 17:41:45 +00:00
John Stiles
82c99d19a2 Reduce size of ChildPtr object.
We take advantage of their shared SkFlattenable lineage to store all
three types of object in the same sk_sp, and check their
Flattenable type to distinguish between them. Accessors allow us to
mimic the coding style of having three distinct fields.

Change-Id: I16426377f10fa2abffbf09bb7998c968614433df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435019
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-30 19:38:54 +00:00
John Stiles
ae2171eba6 Fixup enum name in SkFlattenable.
`SkShaderBase` is an implementation-detail of SkShader and doesn't need
to be in this enum name.

Change-Id: Ieb40a09ae489d4a1e11dfd306d20a8b94ee05ef9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435017
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-07-30 18:19:11 +00:00
John Stiles
ce9a5c953d Allow sampling from SkBlenders.
Runtime shaders, color filters, and blenders are all able to sample from
a blender. These use the blend-function signature; both a src-color and
dst-color must be passed to sample. i.e.: sample(blender, s, d)

Change-Id: I3738e6b0b4af6d1d79e62ca1815c80d6a1ae9d6f
Bug: skia:12257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432056
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-30 16:41:54 +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
Chris Dalton
8a1bbaa210 Remove uber paths from the tessellation atlas
Implements the atlas properly with draw lists instead of taking a
shortcut with uber paths. This speeds up the chalkboard by ~20% on my
Windows laptop (10.9 -> 8.6ms).

Bug: skia:12258
Bug: chromium:928984
Change-Id: Icabccd9a797f5802a11eb087fc97c23edd895679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433876
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-28 21:36:50 +00:00
Brian Osman
3a21d497bd Revert "Reland "SkCanvas: switch from SkDeque to simpler SkSTArray""
This reverts commit 4573ae19fe.

Reason for revert: Breaks Android roll.

Original change's description:
> Reland "SkCanvas: switch from SkDeque to simpler SkSTArray"
>
> This is a reland of 222c1c1631
>
> Original change's description:
> > SkCanvas: switch from SkDeque to simpler SkSTArray
> >
> > Faster, and much less klunky.
> >
> > Change-Id: I8531ea85bbfaff4ce1217d20803dd040a6edfff8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433477
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> Change-Id: I3efc47c7e6b7362f62188b3a6793d71edef83b67
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433979
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: Ibd0f9548bbab308cd70d6f77abb02c87e2e6aba3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434041
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-28 14:57:39 +00:00
Brian Osman
4573ae19fe Reland "SkCanvas: switch from SkDeque to simpler SkSTArray"
This is a reland of 222c1c1631

Original change's description:
> SkCanvas: switch from SkDeque to simpler SkSTArray
>
> Faster, and much less klunky.
>
> Change-Id: I8531ea85bbfaff4ce1217d20803dd040a6edfff8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433477
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

Change-Id: I3efc47c7e6b7362f62188b3a6793d71edef83b67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433979
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-28 14:45:45 +00:00
Brian Osman
79b1478ffe Revert "SkCanvas: switch from SkDeque to simpler SkSTArray"
This reverts commit 222c1c1631.

Reason for revert: Assertion failures.

Original change's description:
> SkCanvas: switch from SkDeque to simpler SkSTArray
>
> Faster, and much less klunky.
>
> Change-Id: I8531ea85bbfaff4ce1217d20803dd040a6edfff8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433477
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

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

Change-Id: I192a7f8b08c11b7be10c3248d9f89d8914fd4fa7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433978
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-28 12:51:53 +00:00
Brian Osman
222c1c1631 SkCanvas: switch from SkDeque to simpler SkSTArray
Faster, and much less klunky.

Change-Id: I8531ea85bbfaff4ce1217d20803dd040a6edfff8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433477
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-28 12:18:13 +00:00
Mike Reed
a2a85e473c Generalize composing imagefilters and shaders to blenders
The preexisting enum versions now are just shallow factories for
the new blender versions, though internally we've kept the
specializations on impl.

Change-Id: I3449682bb443a4ff9f53cc7b0860343c56e377e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424436
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-26 21:07:51 +00:00
Robert Phillips
400f52e691 Retract GrSurfaceDrawContext.h a bit
This CL just pulls GrSurfaceDrawContext.h out of headers and .cpp files where possible.

TBR=brianosman@google.com
Bug: skia:11837
Change-Id: Ib96f3619e3a50091516f81ae48f956fe83c05aff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431384
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-07-26 18:28:04 +00:00
Robert Phillips
04f22eacaa Feed all top-level GPU accessors through skgpu::BaseDevice (take 2)
This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.

This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.

TBR=brianosman@google.com
Bug: skia:11837
Change-Id: Ib69a3ea27c840fa7758bc3318395a27228c7ae9d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431539
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-26 14:56:37 +00:00
Ben Wagner
c9f475784f Document SkMatrix default constructs to identity
SkMatrix has a constexpr default constructor which initializes to
identity. This allows it to be both efficient and always initialized.
However, the pre-C++11 documentation stating that SkMatrix starts off
uninitialized still exists. Update the documentation.

Change-Id: I4f81209ea82f0cef04ca9369ccfdf8e9f448ff71
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432257
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-07-24 16:04:39 +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
d91d2341b9 Revert "Feed all top-level GPU accessors through skgpu::BaseDevice"
This reverts commit 5de8b19504.

Reason for revert: blocking Android roll

Original change's description:
> Feed all top-level GPU accessors through skgpu::BaseDevice
>
> This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.
>
> This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.
>
> Bug: skia:11837
> Change-Id: I4e205255706680ac58ffe40f714884c2ee7ac799
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431036
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I8a015be4edbe21d63db09d5593af13cc89df4217
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431538
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-22 18:56:51 +00:00
Robert Phillips
5de8b19504 Feed all top-level GPU accessors through skgpu::BaseDevice
This pulls the GPU-specific accessors off of SkCanvas and SkDevice - moving them all to skgpu::BaseDevice and SkCanvasPriv.

This will allow us to more easily change the gpu class hierarchy (esp. changing GrSurfaceDrawContext to skgpu::v1:SurfaceDrawContext) w/o churning the public API.

Bug: skia:11837
Change-Id: I4e205255706680ac58ffe40f714884c2ee7ac799
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431036
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-22 16:47:30 +00:00
John Stiles
8e51bad14f Add support for child effects on SkRuntimeBlender.
This will allow runtime blenders to leverage existing color filters or
shaders when computing a blend.

Change-Id: I743d5fc6d83a92cd190cb6bfd1c79789d8be2089
Bug: skia:12249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430658
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-22 15:09:01 +00:00
Mike Reed
aebe248575 SkFilterQuality is gone.
Bug: skia:11235
Change-Id: Iefa0156f542f217e687299f053768ee5b87f84d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430977
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-22 12:41:49 +00:00
Mike Reed
64e67c346c Remove deprecated getBlendMode
Change-Id: I2254edbe05bc3fe415f546ea9e4533f52b7c5726
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431180
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-22 10:12:19 +00:00
John Stiles
4d5708c464 Remove template from SkRuntimeEffectBuilder.
fChildren in the Builder is now a vector of ChildPtrs instead of a
vector of one particular type of child. This gives builder.child() the
flexibility to accept a color-filter, shader, or any other type that a
ChildPtr can hold.

Change-Id: I9e1ecf51aab1c74a9a15738bee7900b0c690ce9a
Bug: skia:11813
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431196
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-07-21 21:57:12 +00:00
Nico Weber
ac747ca18f Give enums in SkImageInfo an underlying type
According to goto.google.com/chrome-includes, SkImageInfo.h is a
somewhat expensive header to include. This makes it possible to
forward-declare these enums instead.

Bug: chromium:1227131,chromium:242216
Change-Id: I4e939449a8d3dfc3fa4c43999bcaecb3249bc0c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431056
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-21 19:34:36 +00:00
Brian Osman
77046a7f0f Disallow sk_FragCoord in SkRuntimeEffect
It's still accessible internally (and by default when using
SkMakeRuntimeEffect), but we don't want clients using this.
If we can come up with a simple and consistent coordinate
model that doesn't expose implementation details, we'll
revisit this.

Change-Id: I77726830480a286541ae887f9cd9822eb10ea913
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430422
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-21 13:36:56 +00:00
Mike Reed
cac5e07277 Hide the filterquality enum
Change-Id: I1d25c2f04d86374f64319a74effa2144f7d63fdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430423
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-20 23:23:54 +00:00
Ethan Nicholas
dd2fdea9c2 Initial land of DSLParser
The DSLParser is an alternative to the existing SkSLParser which goes
directly to IR code using the SkSL DSL. It is substantially faster and
simpler than the existing parser->IRGenerator pipeline, but not yet
feature complete nor fully tested.

Change-Id: Iee45e9b527a3b88faa2ea74fc512051c8a38c5d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400622
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-20 20:28:54 +00:00
Mike Reed
a9c2e3bf83 Remove vestigates of paint's filterquality
Assumes no client still defines/needs SK_SUPPORT_LEGACY_SETFILTERQUALITY

Change-Id: If51f91ca8cad493cb5c03afcfade3838c5d78a35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429816
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-20 17:20:20 +00:00
Brian Osman
946a4cb8ac First pass at a no-SkSL CPU build
This just disables everything that depends on SkSL today:

- Color filters:
  - HighContrast
  - Lerp
  - Luma
  - Overdraw
- Skottie effects:
  - BlackAndWhite
  - BrightnessContrast
  - DisplacementMap
  - FractalNoise
  - Sphere
  - Threshold
  - GradientColorFilter (indirectly, this uses ColorFilters::Lerp)

Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android,Canary-Chromium,Canary-Flutter,Canary-G3
Bug: skia:12197
Change-Id: I26269bd4423897142b8f2fdcc4ab1b274e767cba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427376
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-19 21:19:51 +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
Ethan Nicholas
da7297820f Added multi-var variants for the DSL Declare function
Change-Id: I84fe0319a15065f5de85cd4bed20d648b88c2b56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429897
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-19 19:20:16 +00:00
Ethan Nicholas
2ab47c97e2 Added DSL LogicalXor function
Because C++ does not have the '^^' operator, we had previously just
skipped support for this GLSL operator. This implements it as a
function.

Change-Id: I310658d900de4609572aed4750d6fb27f88d0722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430036
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-07-19 18:25:30 +00:00
Mike Reed
95cc53bafd Hide filterquality enum entirely
Introduce private SkLegacyFQ to allow us to continue deserializing
old content with filter-qualities, but still remove the public enum.

Need to finish removing references in clients.

Change-Id: Iacfb602ec497260e53defc4b95e297ed1ef4e69c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429476
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-19 12:34:50 +00:00
Jorge Betancourt
5514beaf3b [androidkit] bind SkImageFilters to java shared library
SkImageFilter::image
SkImageFilter::blend
SkImageFilter::dropShadow
Change-Id: Ie8cce8a06a2f50b2b3c905097740cc10b91a6c86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428577
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-16 16:18:55 +00:00
Ethan Nicholas
b18c1e2c27 DSL ReleaseProgram retains source and reports errors better
Change-Id: Id5923e1c1404bddf7f7da7d04bd91721ab637322
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429096
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-16 14:45:55 +00:00
Heather Miller
d970d81ea6 update Skia milestone to 94
Change-Id: I3bd0a1b856146172ef38c6392fdd9252480ae928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428980
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2021-07-16 14:44:15 +00:00
John Stiles
55f0d7acfa Always enforce format specifiers on SkDebugf.
Change-Id: Icba60060ab4dec45c8ef1b1e2f35056626adc0a7
Bug: skia:12143, 192062380
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428616
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2021-07-15 20:11:24 +00:00
Ethan Nicholas
a2d22b2e08 Broke DSLVar into separate subclasses
Previously, DSLVar represented local, global, and parameter variables.
This splits it into three separate subclasses.

In addition to just being a cleaner API in general, this also addresses
an issue we ran into with the upcoming DSLParser: previously, a global
DSLVar's storage was not set correctly until DeclareGlobal was called,
so an AddToSymbolTable call prior to DeclareGlobal would create the
SkSL variable with the wrong storage, causing spurious errors on
global-only modifiers. But holding off on the AddToSymbolTable tends to
break constructs like "int x = 0, y = x", so improving the API seemed
like the best way to address it.

Now that we have greater type safety around variables, we can
potentially avoid having to call AddToSymbolTable for DSLVar and
DSLGlobalVar altogether, since we know they are both supposed to end up
in the symbol table, but that isn't something I want to change in this
CL.

Change-Id: I5f390a7384ce0af6a2131d84f97fc5e5b318063f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428576
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-07-15 15:40:06 +00:00
Ethan Nicholas
292a09da2b Added modifier support to DSLFunction
This also includes a couple of fixes to DSLFunction error reporting.

Change-Id: Iab813143511c408df2dba7a4dc8beddea1a8e8d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427736
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-14 14:46:01 +00:00
Chris Dalton
8e2c56e6b4 Disallow DMSAA with DDL
Bug: skia:12201
Change-Id: Ic31a10f0917b3faf31dfc5ec70a2e05e544db572
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427485
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-07-13 19:21:50 +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
Tyler Denniston
f8b7c1ac5f Pass CTM to path effects (experimental)
Add an overload to SkPathEffect that can be used when the CTM is known
at the callsite. GPU callsites are not handled here, that will be
tackled in a separate CL.

Path effects must implement the filterPath virtual that accepts the CTM,
although they are not obligated to use it. If a path effect does
use the CTM, the output geometry must be in the original coordinate
space, not device space.

Bug: skia:11957
Change-Id: I01615985599fe2736de954bb10dac881b0554ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420239
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-13 18:42:55 +00:00
John Stiles
82bbe606ec Add static to global nullopt symbol.
This should hopefully make the code safer in C++14 by not violating
the ODR.

(bungeman@: "I think in C++14 we will in fact get multiple definitions
of this symbol, though in C++17 we won't. Maybe we should mark this as
'static' so each TU gets its own zero byte copy in C++14 but in C++17
the 'static' will also be implicitly 'static inline' and we'll only get
one?)

Change-Id: I3570421fcf2be314e1baccff0783ded4a1078666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427037
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-07-13 14:00:03 +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
John Stiles
2d25d28e51 Fix typo in doc-comments.
There is no "text" parameter. There is one called "tex".

Change-Id: Id8245a8222438c60f6c7bde0638e82bdfda0aa20
Bug: skia:12168
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427338
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-13 13:48:19 +00:00
Mike Reed
63ec43cf55 Hide deprecated filterquality
Change-Id: Ia320f07c3836a077d6feafb4a59a7c89325f9fcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425057
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-13 00:45:12 +00:00
Mike Reed
5643e55f09 Add flag for filterquality in flutter
Change-Id: I8612d58efcfac82b7924c680fd8fa91b6d48614f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426956
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-12 20:09:30 +00:00
John Stiles
526b0b92c9 Use value_or in getBlendMode_or.
Support for `value_or` was recently added to skstd::optional. (Thanks
herb@!)

Change-Id: Ie343f8d06f8a26bcd111af8334757c203944b052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427036
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-12 17:50:40 +00:00
Ethan Nicholas
ebc9fadf35 Fixed some fixups not being applied to DSL code
Change-Id: I11c473a7a683282d6bd4f73d2c90f23de63f8cc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426557
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-07-12 14:25:38 +00:00
Mike Reed
c98dbc6410 Hide deprecated SkPaint::getBlendMode
Callers should use asBlendMode or getBlendMode_or

Bug: skia:12173
Change-Id: I8b62527a2ae11c9bf0c1473c4fffa53b38aa7017
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425756
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-07-11 17:14:21 +00:00
Brian Osman
50f0dadb7f Remove GrSharedEnums.h
Change-Id: I3f2e927001da10652b2965687e31aa8452c9dfc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425997
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-09 15:32:46 +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
Brian Osman
c9145f3402 Remove enum support from SkSL
Bug: skia:11296
Change-Id: I7d41614957d6fa535faadebbeca890b54b6977ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425996
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-09 14:03:15 +00:00