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>
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>
Change-Id: I2de7d90504c2030f9d2ce2694899d350362ebb5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419056
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>
Like SkColorFilter, SkShader, etc., this has a public-facing component
(SkBlender) and a private subclass (SkBlenderBase) which can be
obtained via a helper function (as_BB). At present there are no public-
facing methods, but the type needs to be exposed to be usable by the
outside world.
These classes exist for SkRuntimeEffect to subclass. The blender base
provides a `program` method with the parameters that blending will use.
Change-Id: I75c772fd4108a9c21fbda84201a8b23d3750a0df
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416916
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I17c624e9145d7152f65695ca3ce4592a11bb09a2
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418637
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
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>
Runtime Blend effects always take two input colors--source and
destination--instead of one. This CL adds a new ProgramKind for blend
effects, a new program module (empty for now), and adds a test to
confirm that the signature for blend functions is checked. Currently
these are only accessible via skslc; there's no Runtime Effect API to
create one and the dest color isn't hooked up to anything.
Change-Id: I5272a811d2d76b878cfdf3429efa78c9c8b3fd97
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416798
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Instead of having an enum that says how to sample the dst in the shader
(or lack of dst sampling), we now rely on whether or not we have a valid
proxy in the GrDstProxyView to know whether we are sampling the dst at
all. Then if so we additionally have GrDstSampleFlags to say whether we
need to use a texture barrier and whether we are sampling from an input
attachment.
Change-Id: Id0390a8ad57ec52674922807f6c050d59b7e75a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416416
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: Id02ed33b4fe60663327cc50d79db2bf876ad6df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415458
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This adds copy constructors / assignment operator, reset(), value(), and
has_value() to SkTOptional.
Change-Id: I564552a75a4c612685cdaa8e80e4359b394b64a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414338
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This is needed by the upcoming DSLParser.
Change-Id: I54a0714e55feeb78894df766b14c795970f2c2d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411308
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Previously we would completely disable hardware tessellation for a path
if there was any chance of a curve requiring more segments than
supported by the hardware. This CL updates the tessellators to simply
chop paths until they fit in patches, allowing us to finally draw any
path using hardware tessellation.
Bug: skia:10419
Change-Id: I5c9f78cda3e30b8810aff3cb908235965706f2d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410977
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Other than GMs, there is exactly one use of matrix-sampling
(GrMatrixEffect). It is always uniform (not literal or an
expression containing a uniform). The uniform always has the
same name. Bake these simplifications in, which also shrinks
SampleUsage quite a bit.
Change-Id: I0d5e32069d710af475ccc1030e2988c5fc965a98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411296
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
- Remove ctypes that were entirely unused
- Remove explicit selection of default ctypes
- After that, only two ctype tokens are needed (SkPMColor4f and SkV4)
... remove all of the others from the parser
Change-Id: I2322aab73a19127b3b26850aefdad6140ea0f7e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410057
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This was only used in the context of sk_SampleMask, which was removed
recently.
Change-Id: Id70d7af8b3a100ff157c2984bad4131f1b92f317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410056
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: I6019418526def09c6c9f4b22567a2c76542d043c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409876
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Want to also use this to use this for texture formats so remove
"ColorType" from name.
Also class rather than struct.
Bug: chromium:1113801
Change-Id: Ieb08a3d81c465b92b956d9bc04b39c5783715ea8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409476
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Both SkColorData.h and SkNx_sse.h are in include/private, but not
(currently) included by any public headers. Adding them to a public
header reveals warnings about implicit conversion changing signedness
(-Wsign-conversion), enforced in our public headers warnings check.
Bug: skia:11995
Change-Id: Iee44b24a6df031431113e2d25e42f0a8dd55a5c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408056
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This layout qualifier is not actually used anywhere.
Change-Id: I817c9affdd00e492c70f251eb52680644b7ff3f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406141
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
SkSpan is a convenient type to use on API boundaries - callers can have
their collection in a stack-allocated array, or any contiguous container
(std::vector, etc). Those will all implicitly convert to SkSpan, making
call-sites easy to read/write.
Before making it part of Skia's public API, this CL removes parts of the
API that aren't present in std::span -- when Skia moves to C++20, this
should allow us to use std::span instead, and remove SkSpan entirely.
The most disruptive change is the removal of `int count()`. That's
replaced by a new free function `SkCount` that works on any container,
and incorporates the overflow check from SkTo<int>.
Change-Id: I86cdfad1700f341da3b81a965b396ca9d8b79df9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405816
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Add an assert in SkTHashTable::uncheckedSet that each added key is equal
to itself. This is an implied precondition which is easy to get wrong if
the key contains floating point values which may become NaN.
Motivated by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30314
which would have been much easier to track down with this assert, since
the issue would have been discovered at insertion instead of much later
on removal.
Change-Id: I4eabb6892d2bff1e7bc33c04fd6b297b189a3b02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405695
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
All internal usage has migrated to MakeFor..., this removes the old
program kind, and updates some tests.
Bug: skia:11813
Change-Id: I56733b071270e1ae3fab5d851e23acf6c02e3361
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402536
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Simplifies SampleUsage quite a bit (no need to track multiple kinds of
sampling, variable matrices don't exist any more, etc...).
Change-Id: I58b8de7218d00c4d882d2650672e5fe01892a062
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402177
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
They're only used for the legacy implementation of sk_float_rsqrt,
which is going away.
SkFloatingPoint.h is part of ca 10,000 translation units when building
Chrome, and include graph analysis shows that including xmmintrin.h
adds a total of 3.5 GB to the build.
Avoiding these includes shaves ca 7 CPU-minutes off a local Chrome
build.
Bug: skia:11861 chromium:242216
Change-Id: Ib0fd53c4fb3ae254814fb6ae5afbb298efb0eb83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400437
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
The instructions used to implement it don't deliever
the same results across processors, even on the same
architecture.
Minor diffs on lighting image filter GMs;
this will likely require staged rollout.
Bug: skia:11861
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I4c0b0eab221a051f863f4949051f50652466651e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396723
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
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>
This is another strange, experimental feature that clutters the
implementation and isn't used by anyone (to my knowledge).
Change-Id: I538b7eca0cd28aab32f4739b23459731ade9105e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398226
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This was an experimental feature. It worked (but only the GPU backend).
It was never adopted or used by anyone, to my knowledge. It's a large
amount of code, and a strange corner of SkSL for users to stumble into.
Bug: skia:10680
Change-Id: I0dda0364bce7dbffa58c32de4c7801ec2a6bc42e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398222
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
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>
The instructions used to implement it don't deliever
the same results across processors, even on the same
architecture.
Bug: skia:11861
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I7831640fa6c0f01540619fce3f509c8969aaaaff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396722
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The instructions used to implement it don't deliever
the same results across processors, even on the same
architecture.
Bug: skia:11861
Change-Id: Ifb87fc04a4ec866f84d7c2f2472c7f4b65661d28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396721
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:11803
Change-Id: If4c2280585e192eec1b1588dfe022149543584bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391917
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Prevents introduction of a bug when modifying a type that is used
with one of these containers in such way that makes the use
unsafe.
Change-Id: I959e6f3bfbc9664a6b0ced636f5ae6cbe72eee1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390676
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
std::result_of is deprecated and removed in C++20, std::invoke_result is
in C++17 the library so not ready yet.
In the case of SkMakeArray there is no need for the full power of
std::invoke_result as SFINAE is not needed, nor is calling a method
supported. As a result a simple decltype is sufficient.
Bug: skia:11811
Change-Id: I6c07c380970cc2a991ab8bd457997320ba634e6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390476
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 8b6788079f.
Reason for revert: Fixed variable type for chrome & flutter
Basically, you can't use objc_externally_retained with `auto` type
variables because the compiler isn't smart enough to deduce the type
before checking that it's compatible with the attribute.
Original change's description:
> Revert "Use objc_externally_retained to cut down retain/release in Metal"
>
> This reverts commit 78381ee5e0.
>
> Reason for revert: breaking chromium and flutter mac builds
>
> Original change's description:
> > Use objc_externally_retained to cut down retain/release in Metal
> >
> > Until we get off of ARC, these extra retains and releases can really
> > add up in previous profiling of Metal, especially on iOS.
> >
> > Change-Id: Ib3aaa0b863c4469bdb6ad930395a170719c0293d
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381110
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=jvanverth@google.com,bsalomon@google.com,adlai@google.com
>
> Change-Id: I36aff7698a70052a42b91a910b92fd512b3eecd4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388717
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I5cad02fc9d8c7f21e22021858b2e6e9b038a3de6
Cq-Include-Trybots: luci.skia.skia.primary:Canary-Flutter
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389157
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This reverts commit 78381ee5e0.
Reason for revert: breaking chromium and flutter mac builds
Original change's description:
> Use objc_externally_retained to cut down retain/release in Metal
>
> Until we get off of ARC, these extra retains and releases can really
> add up in previous profiling of Metal, especially on iOS.
>
> Change-Id: Ib3aaa0b863c4469bdb6ad930395a170719c0293d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381110
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,adlai@google.com
Change-Id: I36aff7698a70052a42b91a910b92fd512b3eecd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388717
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Until we get off of ARC, these extra retains and releases can really
add up in previous profiling of Metal, especially on iOS.
Change-Id: Ib3aaa0b863c4469bdb6ad930395a170719c0293d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381110
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Using the dedicated function is slightly faster than calling snprintf
and is documented to behave the same.
Change-Id: I9bc64066b55cf74d2369c531283c68e05bcc402c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386676
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:11760
Change-Id: I1baaec529b47954018d000856912f121b4f1454a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386597
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
As you might expect, a function tagged with `noinline` will never be
considered as a candidate for inlining.
Change-Id: Ia098f8974e6de251d78bb2a76cd71db8a86bc19c
Bug: skia:11362
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/382337
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
It turned out that everywhere we were using or testing DSL code either
directly or indirectly imported big chunks of the SkSL library. These
imports turned out to be necessary; code written using just DSL.h would
fail with various template instantiation errors.
Change-Id: Iae72d15b0d6ef14614ac1a4ff08c36bc1876cd4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381638
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
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>
All layout(key) fields include the field name meta-data, and use as few
bits as possible.
Bug: skia:11372
Change-Id: Ie12b3e0d01148457e5ea078cbf7d0a4bff35302e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378596
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>