This is a reland of 9716414e93
Original change's description:
> Simplify GrClip API
>
> Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
> Replaces these three functions with preApply() that conservatively
> determines the clip effect up to a single rrect intersection. The major
> motivation for this is the new GrClipStack implementation. preApply()
> and apply() will be able to reuse much more code compared to separating
> the preApply functionality across the older three functions that were
> removed. Additionally, preApply is able to convey more information for
> less work, since it can usually determine being skipped or unclipped while
> determining if the clip is a single rrect.
>
> As part of using this API, the attemptQuadOptimiziation and the equivalent
> rrect optimization are overhauled. Hopefully legibility is improved, and
> the rrect case is now applied outside of the android framework (but with
> tighter AA requirements).
>
> Bug: skia:10205
> Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:10205, 10456
Change-Id: I500eeda36ea50e95eb8cb658b36aa2373d5166c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298823
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This also adds back default flush() calls which simply do a flush
without any submit.
Change-Id: Ia8c92bbdecd515d871abfa6364592f502e98656b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298818
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This change relies on the Xfermode updates in the prior CL
(http://review.skia.org/299703) to render properly, and requires
slightly different blending behavior in the compose FP which
necessitated a new ComposeBehavior enum.
Eventually we would like to settle on a universal ComposeBehavior which
works well for all call sites, but that will be its own fairly
disruptive change. This work will be tracked at skia:10457.
Change-Id: I3cc0ea5e016fbef82bc63d653d60d0505efaa66f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298821
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previously, we had separate "ComposeOne" and "ComposeTwo" fragment
processors. These performed extremely similar roles, but varied in
the number of child FPs used, and treatment of the input color's alpha
channel.
This CL combines these two FPs into a single unified "Compose" fragment
processor. To avoid breaking many existing GMs, the semantics of the
prior FPs have been preserved as closely as possible. (Specifically, the
FP treads very carefully to ensure that the alpha channel handling
matches the old code, as dozens of GMs fail otherwise.)
Change-Id: I7ab453f3313e70ae25e5e70f86373a64ff02072f
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299703
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Most of this CL is just noise (i.e., all the header changes) due to the
signature change. The 'discard' GM has some substantive changes but
that's about it.
Change-Id: I72011a442c149b5db93cf8decade6779be4f63d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296704
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Previously, we'd declare a new temporary variable using the matrix
expression. For GrSkSLFP in particular, that would happen *before*
any other code had been emitted, so if the expression referred to
local variables, it would produce SkSL that used a not-yet-defined
variable, and not compile.
Change-Id: I1cdd8920b0c659b905809c126d10c01b996e6a55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299778
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
At this point, every created instance of GrCoordTransform is an identity
so can be removed. Adding it manually using addCoordTransforms() is no
different than relying on the (current) implicitly returned coord
transform if the FP calls setUsesSampleCoordsDirectly().
Removing the addCoordTransform() lets us enforce that this remains the
case and this CL also deletes all of those members that were previously
used to provide access to the sample coordinates.
As part of this, GrFragmentProcessor.h and many other files no longer
need to include GrCoordTransform.h. This exposed a surprising popularity on
SkMatrixPriv.h so I updated those files to include that header directly.
Technically, a .fp file can still have an @coordTransform section and
the sksl generator will try and call addCoordTransform, which will then
fail to build. A follow up CL removes that support in .fp generation.
Bug: skia:10416
Change-Id: I5e4d2bb49ee6d7e56ac75ca00be5631106fec20b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299291
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Although not necessary this, at least, demonstrates how we expect these callbacks to be used.
Change-Id: I67c81e5cf882fbf2511729ede29f6ae9af389d52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297862
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit 1caf3789f8.
Makes the image GMs detect an abandoned context just like the surface
GMs.
Bug: skia:10431
Change-Id: I56a3631a75e6b0383f96a73f461cfa314ee29afa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299379
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 7ac9b5fdb6.
Reason for revert: abandon context bots breaking
Original change's description:
> Add async rescale and read APIs to SkImage.
>
> These function the same as the already existing
> SkSurface APIs.
>
> Bug: skia:10431
>
> Change-Id: I4f1e842d8d4b72ee27bae5f8a85e499e130d420c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299281
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: I351795274245fc9f553cd210d82178f497f22660
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10431
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Added sksl_sample_chaining, which draws identically to
fp_sample_chaining, but uses runtime effects that implement each
strategy.
Change-Id: Ib54fbe4fc6d98b4a8e91cf0e3ae6b7e19283ad37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299076
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
These function the same as the already existing
SkSurface APIs.
Bug: skia:10431
Change-Id: I4f1e842d8d4b72ee27bae5f8a85e499e130d420c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299281
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This should be final batch before we can enable the *ooprddl configs on the bots.
Change-Id: I9a7a619f7bcf0d5acea0e008cefbbb146d4c5244
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298746
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Since gpuSetup can preempt draw's execution it needs to draw the error message too.
This is pulled out of the gpuSetup refactoring.
Change-Id: Iafe06d924fc1b694c59aa3100e9fbe95c4773222
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299140
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Expose a android framework-only function to reset the saved clip geometry
a device-space pixel rect (e.g. the device clip restriction). Using a
regular intersect clip operation after this call should match the
behavior of the legacy replace operation with a clip restriction.
This is a step to removing the separate device clip
restriction API and the deprecated expanding clip ops, as part of the
plan described here: https://docs.google.com/document/d/1ddIk74A1rL5Kj5kGcnInOYKVAXs3J2IsSgU5BLit0Ng/edit?usp=sharing
Bug: skia:10207
Bug: skia:10209
Change-Id: I57d3bcc7b5b257935eb2bf2099d472f2ef354d5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298824
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The existing two-argument `asFragmentProcessor` method has been
supplanted by a new three-argument API that also takes an input FP and
returns a GrFragmentProcessor::MakeResult. A helper method
`colorFilterAcceptsInputFP` has also been added; SkColorFilters
that have been updated to absorb an input FP must also override this
method to return `true`.
Calling the "wrong" `asFragmentProcessor` method is supported. If you
invoke the newer, input-FP-consuming method on an older ColorFilter,
we detect this, and RunInSeries is used to emulate this support. If you
invoke the no-input-FP method on a newer ColorFilter, nullptr is
automatically passed in for the input FP. All of these assistance
features are transitional only, and will be removed once we have
completed the migration to the new API.
This CL also migrates SkLumaColorFilter and SkColorFilter_Matrix to the
new API to exercise the new functionality.
Change-Id: I49f9d962c8c0003a5e27a9675150f6783d631141
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298507
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This call will bookend gpuSetup calls. Any GM that implements onGpuSetup should also implement onGpuTeardown.
This is pulled out of the gpuSetup refactoring.
Change-Id: If55599dc26370f589c5cafd20a7ccb9019b424cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299138
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is pulled out of the gpuSetup refactoring in an attempt to break it into simpler bits.
Change-Id: I01e1717b7f046ad4b87a3f38ac201347a51041ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299077
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: If07ded029ddfe4c1d3cc1a6f206f9aca75fbb8bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295568
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This removes the kMixed type of SkSL::SampleMatrix. All analysis of FP
sampling due to parent-child relationships is tracked in flags on
GrFragmentProcessor now.
The sample strategy is tracked as follows:
- An FP marks itself as using the local coordinate builtin directly (automatically done for .fp code based on reference to sk_TransformedCoords2D[0]).
- This state propagates up the parent towards the root, marking FPs as using coordinates indirectly. We stop the propagation when we hit a parent FP that explicitly samples the child because it becomes the source of the child's coordinates.
- If that parent references its local coordinates directly, that kicks off its own upwards propagation.
- Being sampled explicitly propagates down to all children, and effectively disables vertex-shader evaluation of transforms.
- A variable matrix automatically marks this flag as well, since it's essentially a shortcut to (matrix expression) * coords.
- The matrix type also propagates down, but right now that's only for whether or not there's perspective.
- This doesn't affect FS coord evaluation since each FP applies its action independently.
- But for VS-promoted transforms, the child's varying may inherit perspective (or other more general matrix types) from the parent and switch from a float2 to a float3.
- A SampleMatrix no longer tracks a base or owner, GrFragmentProcessor exposes its parent FP. An FP's sample matrix is always owned by its immediate parent.
- This means that you can have a hierarchy from root to leaf like: [uniform, none, none, uses local coords], and that leaf will have a SampleMatrix of kNone type. However, because of parent tracking, the coordinate generation can walk up to the root and detect the proper transform expression it needs to produce, and automatically de-duplicate across children.
Currently, all FP's that are explicitly sampled have a signature of (color, float2 coord). FP's that don't use local coords, or whose coords are promoted to a varying have a signature of (color).
- In this case, the shader builder either updates args.fLocalCoords to point to the varying directly, or adds a float2 local to the function body that includes the perspective divide.
GrFragmentProcessor automatically pretends it has an identity coord transform if the FP is marked as referencing the local coord builtin. This allows these FPs to still be processed as part of GrGLSLGeometryProcessor::collectTransforms, but removes the need for FP implementations to declare an identity GrCoordTransform.
- To test this theory, GrTextureEffect and GrSkSLFP no longer have coord transforms explicitly.
- Later CLs can trivially remove them from a lot of the other effects.
- The coord generation should not change because it detects in both cases that the coord transform matrices were identity.
GrGLSLGeometryProcessor's collectTransforms and emitTransformCode has been completely overhauled to recurse up an FP's parent pointers and collect the expressions that affect the result. It de-duplicates expressions between siblings, and is able to produce a single varying for the base local coord (either when there are no intervening transforms, or the root FP needs an explicit coordinate to start off with).
This also adds the fp_sample_chaining GM from Brian, with a few more configurations to fill out the cells.
Bug: skia:10396
Change-Id: I86acc0c34c9f29d6371b34370bee9a18c2acf1c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297868
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:10207
Change-Id: Ie87d78b12874fb87697fe22856b4a83b9f28dda8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287818
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 9716414e93.
Reason for revert: clipRRect elision seems to trigger precision issues on Nexus5x, see https://chrome-gpu-gold.skia.org/search?fdiffmax=-1&fref=false&frgbamax=255&frgbamin=0&head=true&include=false&issue=2264837&limit=50&master=false&match=name&metric=combined&neg=false&offset=0&pos=false&query=source_type%3Dchrome-gpu&sort=desc&unt=true
Original change's description:
> Simplify GrClip API
>
> Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
> Replaces these three functions with preApply() that conservatively
> determines the clip effect up to a single rrect intersection. The major
> motivation for this is the new GrClipStack implementation. preApply()
> and apply() will be able to reuse much more code compared to separating
> the preApply functionality across the older three functions that were
> removed. Additionally, preApply is able to convey more information for
> less work, since it can usually determine being skipped or unclipped while
> determining if the clip is a single rrect.
>
> As part of using this API, the attemptQuadOptimiziation and the equivalent
> rrect optimization are overhauled. Hopefully legibility is improved, and
> the rrect case is now applied outside of the android framework (but with
> tighter AA requirements).
>
> Bug: skia:10205
> Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I850cbf92eea9cf5f2db5528a93251f02dbd6fee2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298753
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Removes quickContains(SkRect), quickContains(SkRRect), and isRRect().
Replaces these three functions with preApply() that conservatively
determines the clip effect up to a single rrect intersection. The major
motivation for this is the new GrClipStack implementation. preApply()
and apply() will be able to reuse much more code compared to separating
the preApply functionality across the older three functions that were
removed. Additionally, preApply is able to convey more information for
less work, since it can usually determine being skipped or unclipped while
determining if the clip is a single rrect.
As part of using this API, the attemptQuadOptimiziation and the equivalent
rrect optimization are overhauled. Hopefully legibility is improved, and
the rrect case is now applied outside of the android framework (but with
tighter AA requirements).
Bug: skia:10205
Change-Id: I33249dd75a28a611495f87b211cb7ec74ebb7ba4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298506
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:10396
Change-Id: I0c117ab4d95737b76dec5bce16103b9058218fb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297065
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This is a reland of 4e37751693
Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
>
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
>
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
>
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ibf6921c97278c9f0f71c46883cfbaa04f229affa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297865
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 4e37751693.
Reason for revert: breaking some mac test bots
Original change's description:
> Make it easier to test rectangle textures by using createBackendTexture.
>
> Also allows internal creation of rectangle textures, only used by unit
> tests currently.
>
> Previously GrContext::createBackendTexture() would ignore the request
> for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
> supported and always fails for EXTERNAL.
>
> Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ia14c60ae996757369f1711ec0851e199cbbd4157
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297812
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Also allows internal creation of rectangle textures, only used by unit
tests currently.
Previously GrContext::createBackendTexture() would ignore the request
for RECTANGLE or EXTERNAL and always make 2D. Now it makes RECTANGLE if
supported and always fails for EXTERNAL.
Change-Id: Iafbb3f5acddb37bfb8d39740f2590177a07dae78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297472
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
In OOPR/DDL mode, images wrapping backend textures must be able to exist past the end of the GM - residing in the DDL.
Change-Id: Icc78e407b45f91d3d47eebde2c316ff6bd962afb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297380
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is enough to get the colorcube GM working on the CPU backend.
(It's not blazingly fast, but it works!)
Change-Id: Ic069861bab162ed49f876fd03af2cbaaec2da628
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297718
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The flippity GM doesn't create backend textures but it does perform some custom proxy creation (i.e., using MakeTextureProxyFromData to set the origin) that requires a direct context. This work must be done in onGpuSetup but doesn't entail any fancy lifetime management.
TBR=egdaniel@google.com
Change-Id: I258c0cb66746ca6853a4e228e10407671d7d55d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297697
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit ddca6ab54a.
Reason for revert: breaking abandoned context bot
Original change's description:
> Fix flippity GM for *ooprddl configs
>
> The flippity GM doesn't create backend textures but it does perform some custom proxy creation (i.e., using MakeTextureProxyFromData to set the origin) that requires a direct context. This work must be done in onGpuSetup but doesn't entail any fancy lifetime management.
>
> Change-Id: Ica4f4f7476778cdf934c3be9ef8c9a28d0d4ba2e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297445
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: Ie66a4187a5ff2efee21f60bb9c0d00e2aab3d1e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297696
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
The flippity GM doesn't create backend textures but it does perform some custom proxy creation (i.e., using MakeTextureProxyFromData to set the origin) that requires a direct context. This work must be done in onGpuSetup but doesn't entail any fancy lifetime management.
Change-Id: Ica4f4f7476778cdf934c3be9ef8c9a28d0d4ba2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297445
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Mostly plumbing and misc instructions to draw threshold_rt.
Backends differ in what we return when sampling alpha-only
images, so I've switched threshold_rt to use the .a channel,
which everyone agrees on.
I'm pretty confused about what CTM and local matrix to pass
to the child program() calls, so I've just passed no-ops.
Change-Id: I004b428b4e5e27f3963a27dea0ef44e1f57bc3e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297384
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Change-Id: If5abcd2347871c62e03c8708705ec1041572465a
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296838
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
GrQuadEffect and GrConicEffect were the only FPs that supported the
HairlineAA clip-edge type. These FPs have been updated to implicitly
always use HairlineAA, and other FPs no longer need to consider the
HairlineAA case.
This CL also updates the bezier-effects GM images to remove the non-
hairline test columns.
Change-Id: Ice942106344cf48480e972da4aab1c6055f9911e
Bug: skia:10393
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297019
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This tests the case where the stroke has butt caps and its width
significantly larger than the path itself. There seems to be some
uncertainty over what should actually be drawn in some of these cases,
as evidenced by the variable results from different path renderers
here.
Change-Id: I5b62ec446bfbba73d09ddb4eac710e338bedfc6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296114
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I1c9cd865c3fd37b5d4c911790713d9ca2283aeee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296724
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
In order to emulate OOP-R's behavior, GM needs to pass GPU-backed resources to a DDL recorder.
This change allows GMs to create GPU resources first (in onGpuSetup w/ a direct context) and then use them in onDraw (with only a GrRecordingContext).
Change-Id: Ifa3002af73eb9926f653fb4c4bf4542c0749d658
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This arrangement allows the backend texture to outlive the YCbCr SkImage.
Change-Id: I34939d05bf1091c8efcacb687dc1900729d4cbe5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296478
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: I813a4e4a5b4b0dc4f8ea59056d125386e6049ab4
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296516
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
In the "ignore input" mode, the input FP contributes nothing and is
never sampled. In the "modulate input" cases, the input FP is sampled
as one would expect.
Change-Id: I96717d63d8e3d7ef6aa4eaaf88154c6e5ce47e55
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296299
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I44f64a8c98c019a8f4878b0b6f6d82489aa8252c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296179
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This new api will eventually replace the version that takes an
SkSurface::BackendAccess.
Change-Id: I48cd013725e14027f386b0b111223459944ac44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295567
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Clang doesn't like it when operator| is applied to two different enum
types.
Additionally, fixed some nearby line wrapping.
Change-Id: I77190c9bc91b53ebc38d184d73a6a244b8f34ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295795
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
If GrClips know their dimensions then getConservativeBounds() does not
need any arguments and isRRect() can remove its rtBounds argument.
I also updated GrFixedClip to report the render target bounds as a
degenerate rrect in its isRRect implementation if it was wide open. Its
apply() function was also simplified to take advantage of the prior
GrScissorState work where the rectangle was always valid to access and
contained within the render target bounds.
Change-Id: I627b97976cb176b1c80627462027034b06ad2cb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290957
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This CL is not fully comprehensive; for instance, it does not contain
fixes for backends that don't compile on Mac. But it does resolve the
vast majority of cases that trigger -Wimplicit-fallthrough.
A few minor bugs were found and fixed, but none that were likely to
affect normal operation.
Change-Id: I43487602b0d56200ce8b42702e04f66390d82f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295916
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit fb5ede576d.
Reason for revert: major performance regression due to constant shader recompilation
Original change's description:
> fixed sample(..., matrix) with runtime effects
>
> Change-Id: Id5b7f1b5e992c587be000e112706bedfe00c90fd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294697
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ica8322e0eab8f00bfc1d4f6d33778eb6493b278f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295835
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This will also expose the Vulkan precompilation path to immutable samplers.
Change-Id: Ida31bd70455299fbcc8f4d728aa15179f7685311
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295799
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This version computes X and Y in parallel and without branching.
Change-Id: I08dd7339f75c6cdd5b4130bf363cac1f527bf6ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295572
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This also adds a GM based on Jim's fiddle: https://fiddle.skia.org/c/781234e35c208ee03f79b90613117b91
I confirmed that it never flickers when animating in viewer.
Patchset 1 shows the GM being blank (with the computeFastBounds fix
disabled). Patchset 3 shows that with the fix enabled, the GM is not
blank.
Bug: skia:9282
Change-Id: I206f7150c395b0a35ecf0455e4905f72ae057e6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295558
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
1) If two sample matrices had the same kind and expression (eg, an
identical literal matrix), we'd skip applying the second one because we
didn't examine fOwner in operator==, and decided it was irrelevant.
2) If three constant sample matrices were in a chain, the outer-most
would call trigger a recursive call to setSampleMatrix, which would
update the inner-most fBase pointer a second time, causing us to skip
over the middle transform entirely.
Change-Id: I5671c6f49b627e38571a37db2bf78be9e43d0224
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295579
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Id5b7f1b5e992c587be000e112706bedfe00c90fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294697
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I295855b6a1dbce583920bfef63b2890e7794b8c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290827
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Change-Id: I0af800900a7fbd9d16af0058ee0754358ebc3875
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293562
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 4926b07217.
Reason for revert: fix wip
Original change's description:
> Revert "Improve scissor state tracking in GrRTC"
>
> This reverts commit 3b923a880b.
>
> Reason for revert: GrAppliedHardClip isn't tracking scissor state properly
>
> Original change's description:
> > Improve scissor state tracking in GrRTC
> >
> > At a low level, this changes GrScissorState from a rect+bool to a rect+size.
> > The scissor test is considered enablebd if the rect does not fill the
> > device bounds rect specified by the size. This has a number of benefits:
> >
> > 1. We can always access the scissor rect and know that it will be
> > restricted to the render target dimensions.
> > 2. It helps consolidate code that previously had to test the scissor rect
> > and render target bounds separately.
> > 3. The clear operations can now match the proper backing store dimensions
> > of the render target.
> > 4. It makes it easier to reason about scissors applying to the logical
> > dimensions of the render target vs. its backing store dimensions.
> >
> > Originally, I was going to have the extra scissor guards for the logical
> > dimensions be added in a separate CL (with the cleanup for
> > attemptQuadOptimization). However, it became difficult to ensure correct
> > behavior respecting the vulkan render pass bounds without applying this
> > new logic at the same time.
> >
> > So now, with this CL, GrAppliedClips are sized to the backing store
> > dimensions of the render target. GrOpsTasks also clip bounds to the
> > backing store dimensions instead of the logical dimensions (which seems
> > more correct since that's where the auto-clipping happens). Then when
> > we convert a GrClip to a GrAppliedClip, the GrRTC automatically enforces
> > the logical dimensions scissor if we have stencil settings (to ensure
> > the padded pixels don't get corrupted). It also may remove the scissor
> > if the draw was just a color buffer update.
> >
> > Change-Id: I75671c9cc921f4696b1dd5231e02486090aa4282
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290654
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: Ie98d084158e3a537604ab0fecee69bde3e744d1b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294340
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: I2116e52146890ee4b7ea007f3c3d5c3e532e4bdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294257
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 3b923a880b.
Reason for revert: GrAppliedHardClip isn't tracking scissor state properly
Original change's description:
> Improve scissor state tracking in GrRTC
>
> At a low level, this changes GrScissorState from a rect+bool to a rect+size.
> The scissor test is considered enablebd if the rect does not fill the
> device bounds rect specified by the size. This has a number of benefits:
>
> 1. We can always access the scissor rect and know that it will be
> restricted to the render target dimensions.
> 2. It helps consolidate code that previously had to test the scissor rect
> and render target bounds separately.
> 3. The clear operations can now match the proper backing store dimensions
> of the render target.
> 4. It makes it easier to reason about scissors applying to the logical
> dimensions of the render target vs. its backing store dimensions.
>
> Originally, I was going to have the extra scissor guards for the logical
> dimensions be added in a separate CL (with the cleanup for
> attemptQuadOptimization). However, it became difficult to ensure correct
> behavior respecting the vulkan render pass bounds without applying this
> new logic at the same time.
>
> So now, with this CL, GrAppliedClips are sized to the backing store
> dimensions of the render target. GrOpsTasks also clip bounds to the
> backing store dimensions instead of the logical dimensions (which seems
> more correct since that's where the auto-clipping happens). Then when
> we convert a GrClip to a GrAppliedClip, the GrRTC automatically enforces
> the logical dimensions scissor if we have stencil settings (to ensure
> the padded pixels don't get corrupted). It also may remove the scissor
> if the draw was just a color buffer update.
>
> Change-Id: I75671c9cc921f4696b1dd5231e02486090aa4282
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290654
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: Ie98d084158e3a537604ab0fecee69bde3e744d1b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294340
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
At a low level, this changes GrScissorState from a rect+bool to a rect+size.
The scissor test is considered enablebd if the rect does not fill the
device bounds rect specified by the size. This has a number of benefits:
1. We can always access the scissor rect and know that it will be
restricted to the render target dimensions.
2. It helps consolidate code that previously had to test the scissor rect
and render target bounds separately.
3. The clear operations can now match the proper backing store dimensions
of the render target.
4. It makes it easier to reason about scissors applying to the logical
dimensions of the render target vs. its backing store dimensions.
Originally, I was going to have the extra scissor guards for the logical
dimensions be added in a separate CL (with the cleanup for
attemptQuadOptimization). However, it became difficult to ensure correct
behavior respecting the vulkan render pass bounds without applying this
new logic at the same time.
So now, with this CL, GrAppliedClips are sized to the backing store
dimensions of the render target. GrOpsTasks also clip bounds to the
backing store dimensions instead of the logical dimensions (which seems
more correct since that's where the auto-clipping happens). Then when
we convert a GrClip to a GrAppliedClip, the GrRTC automatically enforces
the logical dimensions scissor if we have stencil settings (to ensure
the padded pixels don't get corrupted). It also may remove the scissor
if the draw was just a color buffer update.
Change-Id: I75671c9cc921f4696b1dd5231e02486090aa4282
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290654
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We are updating FPs to receive their input via a child FP where
possible, instead of relying on the input color.
This CL also adds a GM test for SwizzleOutput, since this did not appear
to be covered by existing unit tests.
Change-Id: I3d8176395bb42eab7ff471c9137597402b5b3a69
Bug: skia:10217
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293884
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
I can find no references to SkAtlasTextTarget in AOSP or in Chromium.
With google3 CL/314226466 there are no more uses in Google3.
Change-Id: I60b5f06fc17c0e4f8d008886c96645475e3d48e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293839
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:10206
Change-Id: Iad24cb1134e8f501bce6434ea8511b21039abea2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293565
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
This is a conservative, partial fix for perspective-having local matrices.
For some cases, we could probably detect the type of matrix and switch to
a shader that skipped the divide (possibly switching to a 2x3 matrix even)
This doesn't fix the perspective interpolation in localmatrixshader_persp
since it doesn't address the matrix type detection for samples that get
promoted to the vertex stage.
Bug: skia:10314
Change-Id: I87b254aa516b36d5558c2e344096fd38280846ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293573
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This GM was not actually doing what the name implied, and when
switched over to use a constant matrix, turned out to not work.
This fixes it so constant matrices properly affect child processors.
Change-Id: I1f6b271dbf43c18515c0c72701bf8bbf60eb4c59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293716
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Before, in the new clip_shader_nested GM, without the
checkForDeferredSaves() call, the first clipShader() would end up
associated with the original save record, but the intervening scale()
call checked for deferred saves. This meant the second clipShader() was
associated with the new save record and would be removed during the
restore (although the first shader remained).
Change-Id: I62f33b821de810c68f62069201ae3429f520be8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293690
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:10314
Change-Id: I073c8be1d0bd4d3f2f678d8963bd05ec396cd163
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293564
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Updated GM to draw a row of cases using CTM transform. For positions,
the resulting points are in absolute coordinates, so use a special
shader that takes that into account during the visualization.
Change-Id: I6985f7f451175a8d0d5116974edcaa5372560bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290437
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10178
These functions can be performed generically using SkRasterPipeline
or skcms. Further, the reason we used a function pointer anyway was
so that we could call the same function on each row separately. But
libwebp's API doesn't let us do a single row at a time anyway.
Simplify this method by using readPixels when necessary and
skipping conversion entirely when possible.
Add support for encoding from unpremul 4444. It is simpler to support
it, and it's not obvious why we didn't support it before.
Keep the behavior of not supporting A8, and apply the same to the
other alpha-only formats. Note that we could support encoding such an
image to alpha, r=0, g=0, b=0, but I'd rather leave adding that
feature to a separate change, which enables it for all encoders (and
accounts for the internal use of PNGs as a round-trip for
kAlpha_8_SkColorType).
Add GMs to test the newly supported SkColorTypes.
Change-Id: I4d86c5621792fb6dc3cb68b736a1eb35d577e3a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292962
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
GrTextureOp was attempting to detect subset-rectangles that wouldn't
affect the rendering output and could be ignored. Unfortunately, this
optimization attempt had various flaws--small, one-pixel cracks on
the edge of the border when AA was off, and highly-visible red fuzz on
the edges of textures when MSAA was enabled. This CL limits the
optimization to cases where the source and destination quads are
axis-aligned rectangles, or cases where the inset is more than a half-
pixel deep.
This fix was made for both the single-image and batch drawing path, and
generalized as much as possible to allow the code to be shared.
This CL also cleans up the test code slightly.
Bug: skia:10263, skia:10277
Change-Id: I200aaab47737b5ba0f559182ef4d0dfe0b719d50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291197
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
While trying to debug matrix sampling, I wanted to make these
easier to work with.
Change-Id: I24889277e7bf0dbdabf012028248c32641c98232
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292838
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 074414fed5.
Reason for revert: updated to guard against nullptr before calling
quickContains(rrect).
Original change's description:
> Revert "GrClips provided as pointers to GrRTC"
>
> This reverts commit 226b689471.
>
> Reason for revert: Breaks Android roller
>
> Original change's description:
> > GrClips provided as pointers to GrRTC
> >
> > A null clip represents no high-level clipping is necessary (the implicit
> > clip to the render target's logical dimensions is fine).
> >
> > This also removes GrNoClip and GrFixedClip::Disabled() since they are
> > replaced with just nullptr.
> >
> > By allowing nullptr to represent no intended clipping, it makes it easier
> > to require GrClip and GrAppliedClip objects to know about the dimensions
> > of the device. If we required a non-null clip object to represent no
> > clipping, we'd have to have an instance for each device based on its
> > size and that just became cumbersome.
> >
> > Bug: skia:10205
> > Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
> Reviewed-by: Weston Tracey <westont@google.com>
> Commit-Queue: Weston Tracey <westont@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com,westont@google.com
# Not skipping CQ checks because this is a reland.
Bug: skia:10205
Change-Id: I5715a4de3b7c8847b73020dc4937d3816d879803
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292876
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: Ic6d26b1e3126298ac0de3e88468e3598b3de3d49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292836
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 226b689471.
Reason for revert: Breaks Android roller
Original change's description:
> GrClips provided as pointers to GrRTC
>
> A null clip represents no high-level clipping is necessary (the implicit
> clip to the render target's logical dimensions is fine).
>
> This also removes GrNoClip and GrFixedClip::Disabled() since they are
> replaced with just nullptr.
>
> By allowing nullptr to represent no intended clipping, it makes it easier
> to require GrClip and GrAppliedClip objects to know about the dimensions
> of the device. If we required a non-null clip object to represent no
> clipping, we'd have to have an instance for each device based on its
> size and that just became cumbersome.
>
> Bug: skia:10205
> Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I42c4828bcf016ee3d30d5c20b771be96e125817b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292856
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Weston Tracey <westont@google.com>
We can compute these directly, and avoid a whole extra matrix uniform
and multiply to get the same effect.
Change-Id: I25146932fd577f64567abee8df2c001a830ef78f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292574
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
A null clip represents no high-level clipping is necessary (the implicit
clip to the render target's logical dimensions is fine).
This also removes GrNoClip and GrFixedClip::Disabled() since they are
replaced with just nullptr.
By allowing nullptr to represent no intended clipping, it makes it easier
to require GrClip and GrAppliedClip objects to know about the dimensions
of the device. If we required a non-null clip object to represent no
clipping, we'd have to have an instance for each device based on its
size and that just became cumbersome.
Bug: skia:10205
Change-Id: Ie30cc71820b92d99356d393a4c98c8677082e761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290539
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:10274
Change-Id: Ifb2ef8bf031e74d9d5c8183efe5aff4e6f3d2e7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292562
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 4730f29993.
Reason for revert: Fix WIP
Original change's description:
> Revert "Simplify GrRTC::clean APIs"
>
> This reverts commit 6cbd7c2e57.
>
> Reason for revert: mac/generated files failures
>
> Original change's description:
> > Simplify GrRTC::clean APIs
> >
> > The CanClearFullscreen enum type is removed. Most usages of clear() had
> > kYes because a null scissor rect was provided, or had kNo because the
> > scissor was really critical to the behavior. A few places did provide a
> > scissor and kYes (e.g. for initializing the target).
> >
> > To simplify this, the public GrRTC has two variants of clear(). One with
> > only a color (for fullscreen clears), and one with a rect for partial
> > clears. The private API also adds a clearAtLeast() function that replaces
> > the several cases where we'd have a scissor but could expand to fullscreen.
> >
> > I find the current control flow in internalClear() to be hard to
> > follow (albeit I was the one to make it that way...), but later CLs
> > will improve it.
> >
> > Bug: skia:10205
> > Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I7131df6f5323f4f9c120cbcfd9bc57e627e2eb65
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291842
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
# Not skipping CQ checks because this is a reland.
Bug: skia:10205
Change-Id: Id5db153d7c2500279cca8478818b66f67a53e143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291844
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I0574edbc1014d58d2f4836e98e35a78575b084a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291957
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a variation of the 'strict_constraint_batch_no_red_allowed' test
that renders using 'experimental_DrawEdgeAAImageSet' instead of
'drawImageRect'.
In practice this GM shows slightly different errors compared to the
original strict test.
Change-Id: Ibdd3f80d99a49529205bdb9462103a637c51cef3
Bug: skia:10277, skia:10278
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291462
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 6cbd7c2e57.
Reason for revert: mac/generated files failures
Original change's description:
> Simplify GrRTC::clean APIs
>
> The CanClearFullscreen enum type is removed. Most usages of clear() had
> kYes because a null scissor rect was provided, or had kNo because the
> scissor was really critical to the behavior. A few places did provide a
> scissor and kYes (e.g. for initializing the target).
>
> To simplify this, the public GrRTC has two variants of clear(). One with
> only a color (for fullscreen clears), and one with a rect for partial
> clears. The private API also adds a clearAtLeast() function that replaces
> the several cases where we'd have a scissor but could expand to fullscreen.
>
> I find the current control flow in internalClear() to be hard to
> follow (albeit I was the one to make it that way...), but later CLs
> will improve it.
>
> Bug: skia:10205
> Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
Change-Id: I7131df6f5323f4f9c120cbcfd9bc57e627e2eb65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10205
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291842
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The CanClearFullscreen enum type is removed. Most usages of clear() had
kYes because a null scissor rect was provided, or had kNo because the
scissor was really critical to the behavior. A few places did provide a
scissor and kYes (e.g. for initializing the target).
To simplify this, the public GrRTC has two variants of clear(). One with
only a color (for fullscreen clears), and one with a rect for partial
clears. The private API also adds a clearAtLeast() function that replaces
the several cases where we'd have a scissor but could expand to fullscreen.
I find the current control flow in internalClear() to be hard to
follow (albeit I was the one to make it that way...), but later CLs
will improve it.
Bug: skia:10205
Change-Id: I87cf8d688c58fbe58ee854fbc4ffe22482d969c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290256
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit c80ee456ad.
fix: update flutter's gn file to add guard
Change-Id: Iac5171c8475d9a862d06255dab1c6f38f10de2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Similar to our stroker, I try to detect when to reverse the fill.
Change-Id: I3099f009dd78dc6e4ffd295e13183c85e0990761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291179
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Clip the input src bounds to reduce the amount of rescaling work
Avoid creating redundant columns in the y-pass of two pass blur.
Change-Id: Ib1a07334dce8ca941cce0be74657eda150591b63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290823
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
As part of this, start introducing more consistent factories (matching classes like SkM44)
Change-Id: I453f1856c0427b008faaed9dbba5263e53a48ce4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290766
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: Ia5fa3b7c61fb26abb9bcd2f21e1b9f01e77eb08e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290762
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This should make triaging easier since it should be more obvious whether
red pixels or just (filtered) black/white checkerboard is acceptable.
And make that plainly obvious in the GM name.
Change-Id: Ie56dd518f43f01bf6d671eddffcf41c06a039f02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290639
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
The previous code would increase the rendered stroke width to 1px (in
screen-space) to ensure proper subpixel coverage when the dashed line to
render was very thin. However, the MSAA path relies on hardware MSAA for
subpixel coverage. The stroke width is now left as-is when MSAA is on.
Additionally, this CL includes some minor polish to coverage-related
code that I made while hunting for the root cause of the bug.
Bug: skia:10240
Change-Id: I28df59a4e1da3661778acc7766cc8f75b15bc915
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290643
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Would be neat to support explicit mappings, but this is sufficient for
what I'm looking at now (allows passing custom tf + "strings" through
the existing shaping pipeline).
Change-Id: I62a8a0c90cc9f6bf3ede82932a8b6a2a933521c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290197
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This is a reland of e5865f6f10
Original change's description:
> Revert "Revert "Fix tile modes in SkGpuBlurUtils.""
>
> This reverts commit 88d04cb51a.
>
> Change-Id: I3ca403bb9631a273b5cbe2304c6c3ff9dd01fa89
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289625
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I93a0c1f635487f47b6bd13082ea456f025eac700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290121
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
The alpha versions are impossible to triage (the bleed is barely
perceptible). Image and bitmap no longer go through separate code
paths in SkGpuDevice so we don't need bitmap variants. Alpha image/
shader interaction is orthogonal to the rest of what's being tested
here and makes triaging even harder.
Change-Id: I85dffa01de0f4f06cb9cbe04fb1d039a8b61416a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290118
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: I2d95c63de18125e6258709b48b03abd7904b7537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278596
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit e5865f6f10.
Reason for revert: some async GMs on some configs look like they are
reading from edges of approx textures.
Original change's description:
> Revert "Revert "Fix tile modes in SkGpuBlurUtils.""
>
> This reverts commit 88d04cb51a.
>
> Change-Id: I3ca403bb9631a273b5cbe2304c6c3ff9dd01fa89
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289625
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: If6f5917982b8c865161e7f4a566df49cb772989b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290036
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 88d04cb51a.
Change-Id: I3ca403bb9631a273b5cbe2304c6c3ff9dd01fa89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289625
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It turns out no one was using the intersection of rect functionality on
GrClip, and this helps simplify what the new clip stack needs to define.
Bug: skia:10205
Change-Id: If85a0c744dd68a8ad2f380b54a539ac74850e4ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289440
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit de228e53fe.
Reason for revert: GrReducedClip now assumes context isn't abandoned,
windowrectangles GM abuses GrReducedClip and has to be abandon-aware.
Original change's description:
> Revert "Refactor stencil clip mask generation into helper"
>
> This reverts commit 8b3a8a5238.
>
> Reason for revert: GM assert failure
>
> Original change's description:
> > Refactor stencil clip mask generation into helper
> >
> > Change-Id: If3dc80efde3b44e87ba8e7af3a258896ec5e78e6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288977
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,csmartdalton@google.com,michaelludwig@google.com
>
> Change-Id: I16559f791601145f57d147cdae345c200af313f1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289237
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
# Not skipping CQ checks because this is a reland.
Change-Id: I6a9372edecd0bdc1a38464ab85f7b7f3ca85e5ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289239
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This is a reland of bf1904fd48
Fix for case of scaling matrix and update GM to use a scaling
matrix.
Original change's description:
> Another fix for dash line thickness.
>
> Use the device space offset from the dash centerline for
> antialiasing in y direction.
>
> Bug: chromium:1049028
>
> Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:1049028
Change-Id: I6d2b04f9cf5de302c41045c2e2494cee43092d9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit bf1904fd48.
Reason for revert: layout test needs update
Original change's description:
> Another fix for dash line thickness.
>
> Use the device space offset from the dash centerline for
> antialiasing in y direction.
>
> Bug: chromium:1049028
>
> Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: chromium:1049028
Change-Id: Id2a9e737a757734af4e3e7db679eab0293a620b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288898
Reviewed-by: Brian Salomon <bsalomon@google.com>
Use the device space offset from the dash centerline for
antialiasing in y direction.
Bug: chromium:1049028
Change-Id: Ib6363579680d05cbf1fe34795695422baeca7065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288764
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
It looks like a bug slipped in quite a while back here:
https://codereview.chromium.org/1092793006/diff/30002/src/gpu/effects/GrDashingEffect.cpp
where a width snapping that was supposed to apply to non-AA lines was
changed to apply to AA lines.
Adds GM that tests < 1 pixel wide dashed horiz/vertical lines.
The lines look better with the change but are still a little too thick,
depending on the subpixel offset.
BUG: chromium:1049028
Change-Id: I45734f5ef55548b62c188d9f55d3150c00059eed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288628
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Fix: const auto [...] --> auto [...]
This reverts commit 0066adefa9.
Change-Id: I5d2df8bcc2bc681259a55b2b851d53fb18599287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288550
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 61642b3366.
Reason for revert: ../../src/utils/SkCustomTypeface.cpp(179,20): error: cannot decompose this type; 'std::tuple_size<const SkPoint>::value' is not a valid integral constant expression
Original change's description:
> Revert "Revert "custom typeface""
>
> Fix: implement onComputeBounds() and generateFontMetrics()
>
> This reverts commit 0066adefa9.
>
> Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
TBR=bungeman@google.com,reed@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: I6845bb96a00a0c9ee54704a4c299556cc32e6438
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288557
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 3a79f33eca.
Reason for revert: MSAN issues
Uninitialized value was stored to memory at
#0 0x2cd74de in SkFontPriv::GetFontBounds(SkFont const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkFont.cpp:400:34
#1 0x31115ad in SkTextBlobBuilder::ConservativeRunBounds(SkTextBlob::RunRecord const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:307:31
#2 0x31104d2 in SkTextBlobBuilder::updateDeferredBounds() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:374:47
#3 0x31104d2 in SkTextBlobBuilder::make() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:605:11
#4 0x31175c1 in SkTextBlob::MakeFromText(void const*, unsigned long, SkFont const&, SkTextEncoding) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:782:20
#5 0x1920415 in UserFontGM::onOnceBeforeDraw() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/gm/userfont.cpp:65:17
Original change's description:
> custom typeface
>
> - only paths implemented at the moment
>
> Seems if we want to serialize/deserialize these, we will need to
> register a factory with skia, so it can sniff the beginning of the
> font "file", to know how to recreate it.
>
> Lots of follow-on things to explore:
> - do we need to even store/know advance widths?
> - should we also (optionally) support a CMAP? names? others?
>
> Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=bungeman@google.com,fmalita@chromium.org,reed@google.com
Change-Id: Iee93db8d0f94d706f0b97566d2d15e2ad2407601
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288463
Reviewed-by: Mike Reed <reed@google.com>
- only paths implemented at the moment
Seems if we want to serialize/deserialize these, we will need to
register a factory with skia, so it can sniff the beginning of the
font "file", to know how to recreate it.
Lots of follow-on things to explore:
- do we need to even store/know advance widths?
- should we also (optionally) support a CMAP? names? others?
Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 9c4fa1e9cd.
Reason for revert: breaking things, maybe?
Original change's description:
> Fix tile modes in SkGpuBlurUtils.
>
> Expand direct GM testing of SkGpuBlurUtils.
>
> Decimate in SkGpuBlurUtils using GrSurfaceContext::rescale.
> GrSurfaceContext::rescale() works on recording context and
> uses approximate textures (to avoid memory issues for blurs
> of many different sizes).
>
> Don't preserve contents to the top/left of the source bounds
> in the rescaled image.
>
> GrGaussianConvolutionFragmentProcessor applies wrap mode to
> both axes.
>
> Rely on GrTextureEffect to omit subset enforcement in shader
> by providing a domain rect rather than turning off tiling in
> caller.
>
> Change-Id: I73e09b4fcbcbed590dd3599091c38d5de65f48c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285099
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
Change-Id: Ifdbfd9bdc67a082bf99e62371a7037e9544cf12a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288269
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Expand direct GM testing of SkGpuBlurUtils.
Decimate in SkGpuBlurUtils using GrSurfaceContext::rescale.
GrSurfaceContext::rescale() works on recording context and
uses approximate textures (to avoid memory issues for blurs
of many different sizes).
Don't preserve contents to the top/left of the source bounds
in the rescaled image.
GrGaussianConvolutionFragmentProcessor applies wrap mode to
both axes.
Rely on GrTextureEffect to omit subset enforcement in shader
by providing a domain rect rather than turning off tiling in
caller.
Change-Id: I73e09b4fcbcbed590dd3599091c38d5de65f48c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285099
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is in response to some Win7 vs Win10 font selection diffs on the compositor_quads_filter GM.
Change-Id: I9564d8a305b0bf773ddb31597b29878e0bc3323d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287796
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 1ed4391fe7.
Reason for revert: Looks like some bad images showed up at gold.skia.org and that the ProcessorCloneTest is crashing on Windows bots:
https://logs.chromium.org/logs/skia/4bfabe0bad476911/+/steps/dm/0/stdout
Original change's description:
> Support large kernels on GPU in matrix convolution effect
>
> Currently matrix convolution falls back to CPU execution for large kernels, due to the argument limit for fragment shaders.
>
> Now for large kernels, we store them in a texture and sample them in a shader to sidestep the limit.
>
> Change-Id: Icc069a701ea8e9cd0adf75f4bfd149fd22e31afd
> Bug: skia:8449
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263495
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>
TBR=robertphillips@google.com,michaelludwig@google.com,adlai@google.com
Change-Id: Iaf4858131046a343481bcf0fd9cc3919d9fc2bda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8449
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Currently matrix convolution falls back to CPU execution for large kernels, due to the argument limit for fragment shaders.
Now for large kernels, we store them in a texture and sample them in a shader to sidestep the limit.
Change-Id: Icc069a701ea8e9cd0adf75f4bfd149fd22e31afd
Bug: skia:8449
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263495
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Change-Id: Ic9d9200a7c1346d0e6bd70029331f9213db5e374
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287380
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
In XPS if a glyph is out of range, ignore it. Also resolve the default
font in the new way, removing the last user of SkTypefacePriv.
In PDF handle fonts with zero glyphs correctly.
Rewrite SkBitSet to keep track of its size, move properly, and make it
more obvious when certain checks are actually made instead of relying on
undefined behavior.
Add a test in a GM to ensure we don't draw anything when a glyph is
out of range on all backends.
Fix the DirectWrite SkScalerContext to pass this new test for
consistency.
Bug: chromium:1071311
Change-Id: I2583970bf1425f59d0d64e3dd7d28109991f9ea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286776
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Will use this in Chrome to support LCDText in saveLayer/restore with
opacity.
This partly reverts https://skia-review.googlesource.com/c/skia/+/181841.
Bug: 1076019
Change-Id: Id870fb1dcc95c9b319797e936725b4447a97d1d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285956
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org>
For 3 and 4 channel float uniforms, this states that the data supplied
is unpremul sRGB, and transforms that data to the destination color
space (still unpremul) automatically.
Change-Id: I1b420d2fd10640963fa8e6736af3747cfc6e7d5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
- add length() as a special intrinsic
- style refactoring I wrote to help debug the CL
- impl dup2,3,4 in program_fn
- (better) fix dup2,3,4 in byte code interpreter
Change-Id: I7cd94a4bc03efc6af2053e9e6ae18b4da94363ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286896
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
- add atan, fract, dividef, subtractf
Also wants mix(), but I'm still learning how to handle 2 args
functions (e.g. how to support atan(y,x) as well)
Change-Id: Ib9f233cd1c4266110cfea68a7d444f834f875f1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286276
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:10188
Change-Id: I29a8efe448532fecc2f7424622cd33afeee3287b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285876
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This reverts commit 44fc53b7f5.
Reason for revert: Test to see if this is causing the linux-rel MediaColorTest.Yuv420pHighBitDepth failure on the Chrome roll
Original change's description:
> Add BGR_10A2 support to Ganesh
>
> Bug: 1068416
> Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,robertphillips@google.com
Change-Id: I0ad0197ebd8de9b8761f84ba808c9f90891b9238
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1068416
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285958
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 36a3e014e1.
Change-Id: I2bb432ec423a85478adddc6845d5d7aa59d4055b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284918
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: 1068416
Change-Id: I40aa84b7f3f770ba550b7bea44c10173ae9a7ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285356
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
They are hashed to uint32_t at the API boundary (SkCanvas, SkVertices),
but making them functionally strings will make the SkSL interaction much
nicer.
Change-Id: I0979871bf3d21373812129eb7e994987b3030e00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285664
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
When trying to chop a quadratic along the right edge of a clip,
the computed t value was so close to 1.0 that our chopper method
returns false (we would have needed doubles to detect this).
To handle this, pin the X values to the right edge, so that we at least
maintain the contract that we are clipped.
Bug: 1070835
Change-Id: Ifdc59f97c7f5c32b321647f6739b37b33ce801c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285576
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This is a reland of 553deb66e4
Original change's description:
> fix crbug 1073670
>
> When drawing a path with effects, the deviceMatrix must not be modified.
>
> * added GM for regression checking
>
> Bug: chromium:1073670
>
> Change-Id: Id75d6f00aa50d891ec807f10be72c0068ec80356
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285387
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
Bug: chromium:1073670
Change-Id: I518497997f09e37d13fc05499b68135ebd4e0a96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285497
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 553deb66e4.
Reason for revert: Breaking ChromeBook builds, such as Build-Debian9-Clang-x86_64-Release-Chromebook_GLES_Docker
Original change's description:
> fix crbug 1073670
>
> When drawing a path with effects, the deviceMatrix must not be modified.
>
> * added GM for regression checking
>
> Bug: chromium:1073670
>
> Change-Id: Id75d6f00aa50d891ec807f10be72c0068ec80356
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285387
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=herb@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: Ibe2243e435fd5b49b49bb55d909d7eb9cf4ca255
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1073670
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285496
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
When drawing a path with effects, the deviceMatrix must not be modified.
* added GM for regression checking
Bug: chromium:1073670
Change-Id: Id75d6f00aa50d891ec807f10be72c0068ec80356
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285387
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We don't have a way to erase with a non-sRGB color.
Update the P3 gm to test this, removing the SkBitmap erase case where
there's no option for even an SkColor4f, let alone non-sRGB. I'm not
sure it's really important to have one when we've got this on pixmap.
Updated release notes.
Change-Id: Ie98270d3f83e041593b4c6b2da8e325b36d4ff18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285341
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:10139
Change-Id: I20cd95fcf5f11832366c32e48ed4d442c82b0719
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284082
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Renames the provider to SkMatrixProvider, which is now also able to
provide the local-to-device matrix. Everywhere that does paint
conversion and FP generation now has access to the entire matrix
provider, instead of just the CTM.
This will allow the SkSL FP (and others) to fetch other matrix state.
Change-Id: Iffb00bae0d438da0e8de3eebe75183ed6d440fd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284040
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 4ab84eda53.
Reason for revert: Breaking some GMs.
Original change's description:
> Converted texture and runtime effects to use GrMatrixEffect
>
> Change-Id: I6e769d52291dd29c2d06983dae5013b6058864cb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283780
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com
Change-Id: Idb2c782ae619689744e868bf38111cc4eaf0b40a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284233
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: I6e769d52291dd29c2d06983dae5013b6058864cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283780
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:10145
Change-Id: I2b4a531a357dab3493169c63f5ec103e7756ae6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283939
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:9984
Change-Id: Ie799ffa19304978e2076f9ba790e8a34c1b03adf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283225
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This allows fragment processors to sample their children with their
local coordinate system transformed by a matrix.
Change-Id: Ifa848bbd85b939bbc5751fec5cf8f89ee904bf39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282590
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
W/o this change VS 2019 has an internal compiler error on the std::initialize_list<>::begin method.
Change-Id: I3be014e124fcdb29c96c7f71a43ea7e7f039758d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282849
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We no longer need a color type to make a wrapped proxy.
Update image_from_yuv_textures GM to make single channel textures.
Make Image factories that infer SkColorChannel values for YUVAIndices
be smarter about picking the channel for single channel textures.
Bug: skia:10078
Change-Id: I84eeaae5c9197dec96c856ce4263b6bd674e7111
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282623
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Speculative fix for MSAN failure.
Change-Id: I8c71186f40ddfa60418e917bd7b248a33883669c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282844
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Branch-free code translates to SkVM more easily than the branchy.
Caveat: the GM is not actually JITing with home-grown JIT today because
that JIT can't gather8, i.e. it can't sample from A8 images yet. But it
works with SkVM interpreter and JITs with LLVM.
Change-Id: I41a6e1d6dda3a6d89a1150bfc7cbc63fe609d4e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282612
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Always treated as unpremul, RGB(A) sRGB colors. Automatically
transformed to destination color space, and premuled.
Bug: skia:9984
Change-Id: I78fdb16482f70714a8a8b64a9552e8874d7966fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This stopped being relevant when color management was no longer tied to
linear blending.
Change-Id: I2171c5c74d75cf2f78c1ff9fac62584a305c71ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282158
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Change-Id: Ib1c0570d747bf9f46be3486f37eba3af53ed1e3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281642
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Having GrAtlasManager.h in GrContextPriv.h was needlessly propagating dependence on that header.
Change-Id: Idf5836f1e217ecd2da91f751b488a63a884c02ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281739
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This is a prerequisite change for the upcoming sample(child, matrix)
function. By itself, this CL doesn't really change anything; it just
adds an ownership tracking feature which sample(child, matrix) depends
on.
Change-Id: I98b12e5fb062a2535af367931e7a932ea9c63a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281337
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
saveCamera() is no longer experimental
In a separate CL, will stage changes to concat virtual to take M44.
Change-Id: Iaf37ce2f24ab1223c54aeb1e79eaebf18f87fece
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I7d12c81b195144de217c928f5537665cae21c644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281580
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:10078
Change-Id: I3ce0d97f8ada55403cc3f88bb16659085449ea29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281207
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Otherwise if any draw flattens the image all subsequent draws of
the image use the flattened texture.
Change-Id: Id1aa58e33f2ec5a13cf1ff75d15f6137aafd556e
Bug: skia:9570
Change-Id: I3a45c4e2b9fead3a5a2500bf5f738ab5d1fbfc17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281336
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:9984
Change-Id: Ib79cf2509f5f92672cbb0b6060b8b33f99e9ac28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281162
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Adds structure to the per-vertex (now custom) data.
Attributes currently just have a type, but the next
step is to augment that with semantic flags to handle
transformation logic in the vertex shader.
Added unit tests and GMs that exercise attributes of
varying float counts, as well as normalized bytes.
Bug: skia:9984
Change-Id: I02402d40b66a6e15b39f71125004efb98bc06295
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280338
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
It is also used for writes to surfaces other than fragment shader
output. e.g. clears.
Change-Id: Id1eb79be6d1a8aed936456bffa59dee32661cec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280344
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Rather than two separate (partially overlapping) ways of accessing the
private portions of SkVertices, use a single privileged helper class
(similar to GrContextPriv).
Change-Id: I76b14b63088658ed8726719cce126577e5a52078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280601
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I60a3569b47b599b710c0f3a9522241748f15360d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280409
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
It was too easy to get into circular include chains. Added static
asserts to ensure we keep our quad AA flags in sync. Also, IWYU.
Change-Id: I01aefa264aa56420ab5a46a8ecd9e63c021c79ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280405
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
iMac Pro bench:
- RP: 167
- VM exp: 195
- VM quartics: 135
Change-Id: Ie8deb38f246b9ae7bbd35e59c3e7e66fc7c42de5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279918
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Remove as many setters as possible, make the constructors less
ambiguous, make it movable, remove USE_UNIFORM_FLOAT_ARRAYS.
Change-Id: I71397d04b5b5d6deb792d77cb98d629d42785f06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279218
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Need to expand the size of highcontrastcolorfilter gm, to show all cases.
Also enlarge labels so they can be read.
Change-Id: I8f9278e7ce2f06a9a6921d70f1f38dc18f9023d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Actually don't snap the other coordinate.
This reverts commit 5575e3c4ea.
Change-Id: I7ef5c16ecbccf5131da595d2396243fbdefb4ddf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279140
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:10080
Change-Id: I936d6d696c86c50d5b51dc84894127c38ad753d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279048
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Updates the vertices_data GM to work on the GPU backend, too. For now,
it still works on the CPU via the original hack.
Bug: skia:9984
Change-Id: I2e11bd01e3cc953d2837ecd6ca8b2305b060e5fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278857
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Fixes:
Workaround GL_ALPHA texture issue in GM.
Don't crash in GM on null image.
Snap both coords in 1D bicubic (restores old behavior).
This reverts commit 97c98f9596.
Change-Id: I14bf0f8c6acf87cac0a13b9166fac73a2f3520b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278862
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
With fix for dumb coord mistake.
This reverts commit 6cb8168c2b.
Change-Id: If5385d16339c2b2b03eeff4ddd65c601e672d3dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278783
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit ecd58077b2.
Reason for revert: red
Original change's description:
> Drawing YUVA images does not flatten for bicubic.
>
> Simplifies bicubic relationship with child FP. Does not propagate coord
> transform up. It does not need a uniform to control offsetting and
> normalization.
>
> Modifies imagefromyuvtextures GM to test all filter qualities with
> drawImage, drawImageRect, and image shader for YUVA and pre-flattened
> image for comparison.
>
> Change-Id: Ic07cfdaac8a0fd1968314afe151dc218db862705
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278472
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com,michaelludwig@google.com
Change-Id: I237c7965af00dece40d0d7ef3f3e93db7b2b3c02
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Simplifies bicubic relationship with child FP. Does not propagate coord
transform up. It does not need a uniform to control offsetting and
normalization.
Modifies imagefromyuvtextures GM to test all filter qualities with
drawImage, drawImageRect, and image shader for YUVA and pre-flattened
image for comparison.
Change-Id: Ic07cfdaac8a0fd1968314afe151dc218db862705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278472
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Adds a 'varying' modifier to the SkSL frontend. Only valid
for pipeline stage (runtime effect) SkSL programs, and only
on variables that are float, or float[2-4].
Runtime effect SkSL can declare varyings. The effect gathers
and reflects them. The GPU backend uses SkShader_Base's new
asRuntimeEffect() to get this data.
GrDrawVerticesOp and its GP get the shader's effect, if any.
They use this to add vertex attributes, varyings, and global
variables (in the fragment shader) of the appropriate width.
The globals have procedurally generated names, based on
their index in the list ("_vtx_attr_%d"). The GP's fragment
code copies the varyings to the globals.
When PipelineStageCodeGenerator sees a varying reference,
it just replaces that with the procedurally generated name
that matches the logic in the op.
Change-Id: I0effbc4f3425d452cb7d62e51e268f3b48fa3c74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275962
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit bc0fe058f8.
Reason for revert: red
Original change's description:
> Make TessellationTestOp and GrPipelineDynamicStateTestOp surface their programInfos at record time
>
> These aren't high priority but it would be nice to have all the ops go through the same system.
>
> Bug: skia:9455
> Change-Id: Idbd8b0829faf12703c82f5a016f5b0e7c3efb762
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277757
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: I579ad16f144d17afaec9ee1b9000eaaa5c04228c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278508
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
These aren't high priority but it would be nice to have all the ops go through the same system.
Bug: skia:9455
Change-Id: Idbd8b0829faf12703c82f5a016f5b0e7c3efb762
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277757
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Note: the results (esp. Saturation) don't exactly match the reference
images in the W3 spec. However, if I tell viewer to be in P3 colorspace,
then the gm looks (nearly) identical to florin's codepen (when viewed
on a P3 iMac).
Change-Id: Iecf21b3078f079eb30af59d697b97b64091c585c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278416
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Bug: skia:10069
Change-Id: I08814be483a630b0583347793e96ac628fe77bc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278316
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Updated to use sentinel GL context even when GL backend is not built.
This reverts commit 1171d314ef.
Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I22ce21a7d217c6929cd3a3de6525290fafa91f55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277816
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This makes onPrePrepare match onPrepare & onExecute. Most of the new method bodies will-have-to/should be filled in anyway.
Change-Id: Ifc897feaeb2d8fe6eec3ac3a8e91f99393ad6758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277542
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Also strengthens/adds some guarantees about this function:
* Always returns the same image if the original is texture-backed and
compatible with GrMipMapped (WRT HW MIP support)
* If a new texture backed image is returned it is always an uncached
texture that is not shared with another image or owned by an image
generator.
Adds a GrImageTexGenPolicy that allows control through image/bitmap
GrTextureProducers of whether a new texture must be made and whether
that texture should be budgeted or not.
Increases unit test coverage of this API.
Bug: skia:8669
Change-Id: Ifc0681856114a08fc8cfc57ca83d22efb1c1f166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274938
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>