This reverts commit 2cde3a1320.
Reason for revert: breaking the Chrome roll
Original change's description:
> Complete rewrite of the SkSL interpreter
>
> Change-Id: Idf4037b04c22f8ace5c1ef16c7a28d8c3df92e91
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250817
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com,ethannicholas@google.com
Change-Id: If0fbc78118173e0cacbe1e01cabe3331e35aa49e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265516
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Idf4037b04c22f8ace5c1ef16c7a28d8c3df92e91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250817
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
There is no change to the code (yet).
Change-Id: I1997d7ac070691a3384441028503f6dc8565bbf8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261182
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
- The raster pipeline JIT was an experiment that never really panned
out (except for also introducing the interpreter, which survives).
The removal should be pretty thorough, including undoing some changes
to SkRasterPipeline itself. For reference, I basically undid most of
https://skia-review.googlesource.com/c/skia/+/112204/
- With runtime shaders, always convert to Program using kPipelineStage
This makes the first-pass compile consistent with runtime color filter,
and with GrSkSLFP.
- Remove sksl_mixer.inc, which hasn't been used in a while.
- In sksl_pipeline.inc, all of the math symbols are already declared
in sksl_gpu.inc, which forms the base symbol table when this include
is parsed.
sk_x and sk_y appear to never be used? Those builtin IDs are the IDs
of the x and y params to main, but that logic still works without
these declarations.
sk_OutColor only makes sense in FP files (it's still declared in
sksl_fp.inc).
Change-Id: Ie8dd68d2c4687745d46f96804a76695bce8c1ba2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246017
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously this clamping was inserted by the program builder.
Adds GrSaturateProcessor to handle saturating in the fragment shader.
Clamp the GrPaint color rather than using a fp when possible.
Has to be plumbed through GrTextureOp because that skips SkPaint
conversion.
Removes a usage of GrPixelConfig.
Bug: skia:6718
Change-Id: Ifa6544496d34677f17e797433e6ef3a97be5c2b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242558
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I16073008ac852f1864bd1d2bd38087a5b661d05a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232581
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This reverts commit 90507286cc.
Reason for revert: Seems to be breaking some builds
Original change's description:
> Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU
>
> Change-Id: I7236a30040ab532086e68d6e9de2898dd7acaa32
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221098
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,kjlubick@google.com,brianosman@google.com,ethannicholas@google.com,reed@google.com
Change-Id: Ie230315a72ebcfae32bc9ce7bafec1f87106cff2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221536
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I7236a30040ab532086e68d6e9de2898dd7acaa32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221098
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Change-Id: Ie4c8e8c5df8f3d37ea49d0c0f7e432e6999b7f0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221243
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Slightly sharper, but far easier to hold:
- Remove Value union from interface, everything is a 32-bit
value type, or a collection thereof.
- Collapse to one version of Run (that takes count), and make
it a member on ByteCode.
- Similarly, move disassemble to ByteCodeFunction.
Change-Id: I07c85e65991178b3f52e20e815c25f36bc9c4257
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220753
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I83e3a094d26085fc4d586e5d2581e0d61c55634e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/145080
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Also adds flexibility to unpremul the input, clamp the output, premul the
output or not.
Also fixes SkMatrix44 as a ctype.
The intent is to reuse this for rgb->yuv conversion in async rescale and
read.
Bug: skia:3962
Change-Id: I470d1cfebdbd79d8541b633c1747d510a5549ac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217128
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Implemented for image shaders, image draws, and gradient shaders.
Reimplement GrFragmentProcessor::OverrideInput as GrOverrideInputFragmentProcessor.fp.
It allows specification of whether the replacement input color should be
a literal in the shader code or a uniform. For above use case use with literal white.
Make key in variables in fp files work for 4f colors.
Fix issue in CPP code gen from .fp where when + key vars that pushed multiple values
into the shader key only skipped the first key value when the when condition is not
true.
Bug: skia:7722
Change-Id: Id7c865132d620e8cdea8b00f2a627103eef171ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201985
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Not quite feature complete yet, but at a point where it's worth checking
in.
Bug: skia:
Change-Id: I21141d30e8582a79e94450d84e56bacc067249e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201685
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 222e275b0a.
Reason for revert: perf regression
Original change's description:
> converted AARectEffect to new FP system
>
> Bug: skia:
> Change-Id: I0e4141c7f547bab92c65a6abff120ed04d5c2c66
> Reviewed-on: https://skia-review.googlesource.com/c/153550
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I3d7036a78d8582d6790c77b20a60e6e5257d1881
Reviewed-on: https://skia-review.googlesource.com/c/162283
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This makes GL & Vulkan render the wacky_yuv_formats GM correctly (transparency and all).
Bug: skia:7903
Change-Id: I09cf872beae3fd0fc1c5109b03ca1714ed51ae85
Reviewed-on: https://skia-review.googlesource.com/c/160162
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of f065907ccc
3rd time's the charm:
The new analytic gradient shader was sporadically triggering violations of the coverage as alpha
compatibility optimization. Unfortunately, even when using the same device and random seed for the
test, the bots did not always reproduce the error. However, we identified the likely cause of the
violation.
The test requires that all output channels are less than the input alpha, which it uses to validate
whether or not the shader is modulating its values by the input alpha. This test does not pass if
the RGB values are greater than 1. The original version of the analytic gradient shader used half4s
for its scale and bias values. Given the threshold limit for hardstops of 0.00024 (SkNearlyZero),
a very small interval that is not treated as a hardstop can create a scale or bias of over 4000.
This moves into the very imprecise region of 16-bit floats, making it plausible that the gradient
outputs colors greater than 1, due to rounding. The kicker is that the random test generation for
stop locations does not use a uniform distribution, but is instead biased towards the remaining
interval, which increases the likelihood of generating a small interval that is not treated as a
hard stop. We are keeping this behavior since ill-conditioned gradients are useful in testing.
Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit 9461dcf130.
>
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
>
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: I2d050624781c77cdd160291cadbadac602b48bde
Reviewed-on: https://skia-review.googlesource.com/c/157569
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I911ee066ce4d0175cee3ee3868a86955d486687c
Reviewed-on: https://skia-review.googlesource.com/159060
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
This reverts commit f065907ccc.
Reason for revert: Processor test failing (inconsistently) on several bots.
Original change's description:
> Reland "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit 9461dcf130.
>
> Reason for revert: Fixes for ANGLE's incorrect shader behavior
>
> Original change's description:
> > Revert "Implement an explicit binary search-based analytic gradient colorizer"
> >
> > This reverts commit dcc85fc610.
> >
> > Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
> >
> > Original change's description:
> > > Implement an explicit binary search-based analytic gradient colorizer
> > >
> > > Provides a reasonably flexible fragment processor that defines another
> > > colorizer implementation for gradients. It can support up to 8
> > > interpolation intervals (which is 16 colors if every stop is a hard stop
> > > or 9 colors if every stop is a smooth transition). It
> > > supports mixtures of hard and smooth stops. It is conditionally compiled
> > > into versions specific to the interval count (so it can produce up to
> > > 8 shader variants).
> > >
> > > The GrGradientShader controller does not remove the single and dual
> > > interval colorizers, which are useful specializations of this explicit
> > > binary search colorizer. Similarly, since it can only handle up to 8
> > > intervals, the texture colorizer is still used as a fallback.
> > >
> > > Currently it does not employ capabilities detection to determine if the
> > > hardware can support the number of required uniforms, which can become
> > > substantial for the larger gradient configurations.
> > >
> > > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > > Reviewed-on: https://skia-review.googlesource.com/155080
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> >
> > TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
> >
> > Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Reviewed-on: https://skia-review.googlesource.com/156541
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156542
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: Icd925d568d8cdffdc3020c07a9c50a4aa9cf0bb9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/157429
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 9461dcf130.
Reason for revert: Fixes for ANGLE's incorrect shader behavior
Original change's description:
> Revert "Implement an explicit binary search-based analytic gradient colorizer"
>
> This reverts commit dcc85fc610.
>
> Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
>
> Original change's description:
> > Implement an explicit binary search-based analytic gradient colorizer
> >
> > Provides a reasonably flexible fragment processor that defines another
> > colorizer implementation for gradients. It can support up to 8
> > interpolation intervals (which is 16 colors if every stop is a hard stop
> > or 9 colors if every stop is a smooth transition). It
> > supports mixtures of hard and smooth stops. It is conditionally compiled
> > into versions specific to the interval count (so it can produce up to
> > 8 shader variants).
> >
> > The GrGradientShader controller does not remove the single and dual
> > interval colorizers, which are useful specializations of this explicit
> > binary search colorizer. Similarly, since it can only handle up to 8
> > intervals, the texture colorizer is still used as a fallback.
> >
> > Currently it does not employ capabilities detection to determine if the
> > hardware can support the number of required uniforms, which can become
> > substantial for the larger gradient configurations.
> >
> > Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> > Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> > Reviewed-on: https://skia-review.googlesource.com/155080
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
>
> Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Reviewed-on: https://skia-review.googlesource.com/156541
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: I2aca36307d88c26905d860ec29417ec68c6037cc
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156542
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit dcc85fc610.
Reason for revert: ANGLE is frequently corrupted, particularly radial_gradient4 and mixershader
Original change's description:
> Implement an explicit binary search-based analytic gradient colorizer
>
> Provides a reasonably flexible fragment processor that defines another
> colorizer implementation for gradients. It can support up to 8
> interpolation intervals (which is 16 colors if every stop is a hard stop
> or 9 colors if every stop is a smooth transition). It
> supports mixtures of hard and smooth stops. It is conditionally compiled
> into versions specific to the interval count (so it can produce up to
> 8 shader variants).
>
> The GrGradientShader controller does not remove the single and dual
> interval colorizers, which are useful specializations of this explicit
> binary search colorizer. Similarly, since it can only handle up to 8
> intervals, the texture colorizer is still used as a fallback.
>
> Currently it does not employ capabilities detection to determine if the
> hardware can support the number of required uniforms, which can become
> substantial for the larger gradient configurations.
>
> Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
> Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
> Reviewed-on: https://skia-review.googlesource.com/155080
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,michaelludwig@google.com
Change-Id: I351a387f0528e4c2db2d47ab2e5d6b336991fb98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Reviewed-on: https://skia-review.googlesource.com/156541
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Provides a reasonably flexible fragment processor that defines another
colorizer implementation for gradients. It can support up to 8
interpolation intervals (which is 16 colors if every stop is a hard stop
or 9 colors if every stop is a smooth transition). It
supports mixtures of hard and smooth stops. It is conditionally compiled
into versions specific to the interval count (so it can produce up to
8 shader variants).
The GrGradientShader controller does not remove the single and dual
interval colorizers, which are useful specializations of this explicit
binary search colorizer. Similarly, since it can only handle up to 8
intervals, the texture colorizer is still used as a fallback.
Currently it does not employ capabilities detection to determine if the
hardware can support the number of required uniforms, which can become
substantial for the larger gradient configurations.
Bug: chromium:796479, chromium:729727, chromium:696603, chromium:543625, chromium:414254
Change-Id: Ia1f735a5019766ae4796cc22964b2913db34b95b
Reviewed-on: https://skia-review.googlesource.com/155080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Also clones SkGradientBitmapCache into GrGradientBitmapCache in the
gpu/gradients folder. But after cleaning up the old gradient code,
SkGradientBitmapCache will go away and SkGradientShader will have no
reference to the bitmap cache or support for building bitmaps.
The "new" GrGradientBitmapCache has been updated to hide the thread
safety responsibilities and gradient bitmap generation code that had
originally been a part of SkGradientShader.
Bug: skia:
Change-Id: Ida134c6437c866439fac44fa453d09a6a11549e7
Reviewed-on: https://skia-review.googlesource.com/150917
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds a new colorizer implementation that supports gradients with two
interpolation intervals. The two intervals can share a middle color
to represent the usual 3-color gradient, or can have different colors
to represent a hard stop at an arbitrary point.
Bug: skia:
Change-Id: I8c73705e83b99e28ad5c834230ced4e3b7b9d1c4
Reviewed-on: https://skia-review.googlesource.com/150700
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Add an FP that provides the two-point conical gradient effect. The
majority of the new FP's shader code is a straight forward port from
SkTwoPointConicalGradient_gpu.cpp. This FP is bulkier because of the
extensive calculations that go on in its overridden Make function.
To support 2-pt conical gradient's behavior of writing transparent
black in invalid areas of the conical interpolation, the contract of
gradient layout FPs has been updated to provide a flag in the y
component as to whether or not the fragment should be rejected.
A separate channel was used since negative values and large values are
perfectly reasonable for the untiled gradient layout to return (before
the value is then constrained into [0, 1]). It also seemed better to
avoid returning a problematic value like infinity or NaN.
Bug: skia:
Change-Id: I37373bb5aebd89cac8905602e699ad19f0f5ac82
Reviewed-on: https://skia-review.googlesource.com/148988
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Add an FP that implements the sweep gradient effect and updates
SkSweepGradient to use the new system if possible.
Bug: skia:
Change-Id: I3f65da01afafae54c45848a6a78fd758f65eb4a6
Reviewed-on: https://skia-review.googlesource.com/148806
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds a radial gradient FP in the same vein as the prior linear gradient
FP. It updates SkRadialGradient to try and use the new system before
falling back to the original GPU gradient code.
Bug: skia:
Change-Id: I0739832beeae18d0a7178ada44014d7885478031
Reviewed-on: https://skia-review.googlesource.com/148803
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 1ea5656a28.
Reason for revert: Fixed google3 build failure
Original change's description:
> Revert "Base Gradient FP Refactor"
>
> This reverts commit 10f7a1e075.
>
> Reason for revert: broke google3 roll
> Original change's description:
> > Base Gradient FP Refactor
> >
> > --
> >
> > Redefines how gradients will be written in the GPU back-end:
> >
> > They are split into three fragment processor components: master, layout, and colorizer.
> > The layout FP is responsible for converting the fragment position into an interpolant value, t.
> > Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
> > The colorizer FP is responsible for converting t into a color.
> > The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
> > GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
> > This pattern is documented in gpu/gradients/README.md.
> >
> > Goals for current CL
> > ====================
> >
> > Outline the FP components by providing .fp implementations for the simplest gradients.
> > Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
> > A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
> > SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
> >
> > Future CLs
> > ==========
> >
> > To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
> > A CL for each layout will be defined.
> > CLs for the different analytic colorizer cases and the textured gradient case will be defined.
> > Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
> > After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
> >
> > Bug: skia:
> > Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
> > Reviewed-on: https://skia-review.googlesource.com/148120
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,michaelludwig@google.com
>
> Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/153600
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>
TBR=bsalomon@google.com,caryclark@google.com,michaelludwig@google.com
Change-Id: Ibf6ffbcb1af0dfbdac7317151aeb08f18f84c7fd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153887
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit 10f7a1e075.
Reason for revert: broke google3 roll
Original change's description:
> Base Gradient FP Refactor
>
> --
>
> Redefines how gradients will be written in the GPU back-end:
>
> They are split into three fragment processor components: master, layout, and colorizer.
> The layout FP is responsible for converting the fragment position into an interpolant value, t.
> Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
> The colorizer FP is responsible for converting t into a color.
> The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
> GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
> This pattern is documented in gpu/gradients/README.md.
>
> Goals for current CL
> ====================
>
> Outline the FP components by providing .fp implementations for the simplest gradients.
> Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
> A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
> SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
>
> Future CLs
> ==========
>
> To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
> A CL for each layout will be defined.
> CLs for the different analytic colorizer cases and the textured gradient case will be defined.
> Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
> After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
>
> Bug: skia:
> Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
> Reviewed-on: https://skia-review.googlesource.com/148120
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
Change-Id: Ib735e323795ac8874cb00b007a915786b50517a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153600
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
--
Redefines how gradients will be written in the GPU back-end:
They are split into three fragment processor components: master, layout, and colorizer.
The layout FP is responsible for converting the fragment position into an interpolant value, t.
Each high-level gradient--such as linear, radial, etc.--are implemented solely in a layout FP.
The colorizer FP is responsible for converting t into a color.
The master FP invokes the layout, clamps t into the proper domain, and then invokes the colorizer.
GrGradientShader provides factory functions to create FP graphs from SkGradientShader instances.
This pattern is documented in gpu/gradients/README.md.
Goals for current CL
====================
Outline the FP components by providing .fp implementations for the simplest gradients.
Defines a two-color single interval colorizer and a linear gradient layout, and the master effect.
A MakeLinear() factory function is provided that can convert SkGradientShaders that fit these constraints.
SkLinearGradient first attempts to use the new system, falling back to the original GrGradientEffect.
Future CLs
==========
To keep the CL reviews manageable, additional dependent CLs will be added that gradually replace past functionality.
A CL for each layout will be defined.
CLs for the different analytic colorizer cases and the textured gradient case will be defined.
Once the new system supports all current layouts and colorizer capabilities, all old GPU gradient code will be removed.
After this clean-up, analytic colorization can hopefully be expanded to reduce the usage of textured gradients.
Bug: skia:
Change-Id: Iafe7b8b4071491a71c473babcd7bedda659150c1
Reviewed-on: https://skia-review.googlesource.com/148120
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Easily supports mapping ctypes to sksl types with templates that
specify how to send data to the GPU and how to track state changes.
The template logic and type mappings are defined in
SkSLCPPUniformCTypes.* while SkSLCPPCodeGenerator is updated to
utilize it.
It also updates the supported ctypes to properly generate code for
SkPoint, SkIPoint, SkIRect, and GrColor4f. The code generated for
'in uniforms' now also correctly supports conditional uniforms.
Bug: skia:
Change-Id: Ib7c0a873bdd68a966b6a00871f33102dfa2c432d
Reviewed-on: https://skia-review.googlesource.com/150129
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:
Change-Id: Iad4c89fbde8bc1f6c3d022af9aec2ec5faa8a4ef
Reviewed-on: https://skia-review.googlesource.com/142583
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>