Commit Graph

4493 Commits

Author SHA1 Message Date
Michael Ludwig
89dd4e774d Divide by w for sample matrices
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>
2020-06-03 21:39:10 +00:00
Ethan Nicholas
d3a95c2b66 Fixed sample_matrix_constant GM
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>
2020-06-03 18:04:28 +00:00
Michael Ludwig
49203849a6 Check for deferred saves in SkCanvas::clipShader
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>
2020-06-03 00:43:45 +00:00
Michael Ludwig
5c51f5f05f Add localmatrix w/ perspective GM
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>
2020-06-02 18:20:14 +00:00
Brian Osman
2ad3dfb46b For custom vector/normal/position attrs, let marker ID 0 mean CTM
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>
2020-06-02 18:09:14 +00:00
Brian Salomon
392780277b Remove submit from async read pixels. User must submit.
Bug: chromium:1087118

Change-Id: Iab152ac483787fbdcca448aee0c4b9d2b354a92b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292840
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-06-02 16:55:04 +00:00
Leon Scroggins III
1adcac52d6 Remove transform_scanline from SkWebpEncoder
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>
2020-06-02 15:37:29 +00:00
John Stiles
cbe4e2822c Fix strict-constraint bleed in strict_constraint_[batch_]no_red_allowed.
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>
2020-06-01 15:51:09 +00:00
Mike Reed
b42a327926 hide savelayer's clipmask fields
Bug: skia:9208
Change-Id: Ieff64b3132e7bf4a51ce9d70ea2f1bad492616da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223923
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-31 14:06:42 +00:00
Brian Osman
5d7759e1f4 Minor cleanup in the sample_matrix GMs
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>
2020-05-29 16:11:45 +00:00
Michael Ludwig
7c12e28cf4 Reland "GrClips provided as pointers to GrRTC"
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>
2020-05-29 15:09:54 +00:00
Brian Osman
921cdbb387 Fix dimensions of color_cube_rt slide
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>
2020-05-29 14:59:43 +00:00
Weston Tracey
074414fed5 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>
2020-05-29 12:55:44 +00:00
Brian Osman
2c28bf9fe0 Directly compute normalized coords in the color cube runtime effect
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>
2020-05-28 19:18:43 +00:00
Michael Ludwig
226b689471 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>
2020-05-28 18:55:13 +00:00
Brian Osman
9c3eccd5d7 Runtime effect implementation of color cube filter
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>
2020-05-28 15:45:48 +00:00
Michael Ludwig
81d4172d86 Reland "Simplify GrRTC::clean APIs"
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>
2020-05-27 14:26:16 +00:00
Chris Dalton
b7518a80c5 Don't test GPU configs on hittestpath
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>
2020-05-26 21:48:06 +00:00
John Stiles
d20a134aed Add 'strict_constraint_batch_no_red_allowed' GM image.
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>
2020-05-26 15:14:02 +00:00
Michael Ludwig
4730f29993 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>
2020-05-26 14:37:23 +00:00
Michael Ludwig
6cbd7c2e57 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>
2020-05-26 13:16:12 +00:00
Mike Reed
1f60733fb3 Revert "Revert "move onto new factories for SkMatrix""
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>
2020-05-21 16:58:39 +00:00
Mike Reed
c80ee456ad Revert "move onto new factories for SkMatrix"
This reverts commit 046c2b7d90.

Reason for revert: need to update/guard flutter

Original change's description:
> move onto new factories for SkMatrix
> 
> Just rename, no functional changes expected.
> 
> Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Ic74f177128913374b8c60b4df88f04cf72fbacb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:05:20 +00:00
Mike Reed
046c2b7d90 move onto new factories for SkMatrix
Just rename, no functional changes expected.

Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-21 15:04:09 +00:00
Mike Reed
9ded74e024 use strokeandfill patheffect, and fix it
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>
2020-05-20 21:37:52 +00:00
Brian Salomon
287d5984fb Apply additional clipping in SkGpuBlurUtils.
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>
2020-05-20 15:47:16 +00:00
Mike Reed
3e84312c0f add new patheffect for stroke-and-fill
Change-Id: I2212e547d3d15c65c20f2f8e10fda5f2ef832187
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291041
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-20 15:01:26 +00:00
Mike Reed
d240d76b34 extract original paths at big size to improve precision
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>
2020-05-19 17:27:22 +00:00
Brian Salomon
2a7eff96a8 Avoid MIP mapping in strict_constraint_no_red_allowed
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>
2020-05-19 15:08:42 +00:00
Mike Reed
1963009cd0 stroke-and-fill is deprecated, introduce simpler api
baby step for https://skia-review.googlesource.com/c/skia/+/158020/

Bug: skia:8428
Change-Id: I0411c52a4fb97755e1b06b2aba8cb969776309bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290717
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 13:03:29 +00:00
Brian Salomon
ca76920e78 Split bleed GM into two: one tests kStrict and tests kFast.
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>
2020-05-19 12:53:49 +00:00
Mike Reed
98bc22c689 add fontmetrics to custom typeface
Change-Id: Ib6f468f6fd35b73e590d22a33d1322d3de48edb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290645
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 00:38:29 +00:00
John Stiles
dbcf680f8f Fix rendering of very-thin dashed lines when MSAA is enabled.
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>
2020-05-18 21:26:49 +00:00
Mike Reed
2ddf7f39de extend custom typeface gm
Change-Id: I472e009ed78e4652a56a3987af0c488a238908b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290638
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-18 18:45:38 +00:00
Florin Malita
839e70f17e Identity unichar <-> glyph_id mapping for SkCustomTypeface
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>
2020-05-15 21:10:54 +00:00
Brian Salomon
11ad4ccfd4 Reland "Revert "Revert "Fix tile modes in SkGpuBlurUtils."""
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>
2020-05-15 19:46:43 +00:00
Brian Salomon
6ef29333cb One bleed GM
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>
2020-05-15 15:19:05 +00:00
Brian Osman
28590d54f5 Add 'shader' as an alias for 'fragmentProcessor'
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>
2020-05-15 13:52:15 +00:00
Brian Salomon
364ed37bf1 Reland "Revert "Fix tile modes in SkGpuBlurUtils.""
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>
2020-05-15 00:55:26 +00:00
Florin Malita
340cd9c99e SkCustomTypeface tweaks
- don't require prior glyph count knowledge - grow dynamically

  - no need to store the glyph count explicitly, it's reflected in
    path/advance vector sizes

Change-Id: I3650ba9312db02c99b72bcf7fd3215697ec00b08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289893
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-05-14 21:44:24 +00:00
Greg Daniel
0a2464f51f Update internal skia uses to use flushAndSubmit and submit calls.
Bug: skia:10118
Change-Id: Ieb7c0eece56d3d9df56ecb52e00e76c01f038de8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-05-14 20:26:44 +00:00
Brian Salomon
e5865f6f10 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>
2020-05-14 20:24:44 +00:00
Michael Ludwig
c002d5619e Simplify GrClip::getConservativeBounds() signature
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>
2020-05-13 18:59:13 +00:00
Michael Ludwig
828d341199 Reland "Refactor stencil clip mask generation into helper"
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>
2020-05-12 17:49:47 +00:00
Adlai Holler
00ddb0029d Reland "Support large kernels on GPU in matrix convolution effect"
This reverts commit a117e7b75b.

Reason for revert: Fixed divide-by-0 in the unpremul logic. This was here before but never caused problems (or we ignored them.)

Original change's description:
> Revert "Reland "Support large kernels on GPU in matrix convolution effect""
>
> This reverts commit 76cb9c4d4c.
>
> Reason for revert: Tegra3 & Metal issues
>
> Original change's description:
> > Reland "Support large kernels on GPU in matrix convolution effect"
> >
> > This reverts commit 41e377d1ba.
> >
> > Reason for revert: fixed issues
> >
> > Bug: skia:8449
> > Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com,adlai@google.com
>
> Change-Id: I5c3f04d4d262550a3298b8fd677c8a1661be7ad9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8449
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289076
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Bug: skia:8449
Change-Id: I90b8e9e0eb52bc08308fb472eb216ed0bd4785a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289030
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-05-12 12:47:44 +00:00
Adlai Holler
a117e7b75b Revert "Reland "Support large kernels on GPU in matrix convolution effect""
This reverts commit 76cb9c4d4c.

Reason for revert: Tegra3 & Metal issues

Original change's description:
> Reland "Support large kernels on GPU in matrix convolution effect"
> 
> This reverts commit 41e377d1ba.
> 
> Reason for revert: fixed issues
> 
> Bug: skia:8449
> Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I5c3f04d4d262550a3298b8fd677c8a1661be7ad9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8449
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289076
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-05-11 20:17:26 +00:00
Brian Salomon
518fd4d9d0 Reland "Another fix for dash line thickness."
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>
2020-05-11 18:58:01 +00:00
Adlai Holler
76cb9c4d4c Reland "Support large kernels on GPU in matrix convolution effect"
This reverts commit 41e377d1ba.

Reason for revert: fixed issues

Bug: skia:8449
Change-Id: I0c4389f0efa92c6da69253b2304ad9a072750965
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287817
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-05-11 15:40:09 +00:00
Brian Salomon
d7a5b59b1e Revert "Another fix for dash line thickness."
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>
2020-05-11 12:46:01 +00:00
Brian Salomon
bf1904fd48 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>
2020-05-08 21:32:05 +00:00