Commit Graph

5060 Commits

Author SHA1 Message Date
Robert Phillips
a3f206e0b8 Non-substantive changes for making v1::SurfaceDrawContext V1-only
Bug: skia:11837
Change-Id: I60112e370c95e6f9d9bc12cb9b05d40dd2220bc9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435279
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-02 19:22:58 +00:00
John Stiles
a212b95413 Fix cases of variable shadowing in gm/.
These were reviewed last year at http://review.skia.org/312480 but never
landed. Splitting into small chunks to land individually.

If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: Ie6a262328315a5726265ef4afede7e0e66337752
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435718
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-08-02 19:02:56 +00:00
Robert Phillips
33bf2b56f9 Pipe all SDC creation through the recording context
In the new GrSurfaceContext class hierarchy we can get either a v1 or v2 SFC/SDC depending on the context options setting.

Bug: skia:11837
Change-Id: Ia25bc10b58bbbaf65a484b323d9d0eee471bb7ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435276
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-02 16:04:52 +00:00
Mike Reed
464703f514 Add gm exercising strokeandfill
Bug: skia:8428
Change-Id: I82cd1d5774f03f5d746a5290d4d030406f932cd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435436
Reviewed-by: Mike Reed <reed@google.com>
2021-07-31 19:23:47 +00:00
John Stiles
68c9325263 Create test case to repro skia:12212.
Change-Id: I2dde12b262f51b00a95eb26f87b85c3f5a19b45b
Bug: skia:12212
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428961
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-30 17:41:13 +00:00
John Stiles
ab7ff17156 Guard TopDeviceSurfaceFillContext calls for null return values.
TopDeviceSurfaceFillContext can return null if there is a paint filter
on the canvas.

Change-Id: I4aa5db63278a561dabea3390b0975bf072e1f679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434918
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-07-30 15:36:45 +00:00
John Stiles
5b3aff4d39 Rename DestColor FP to SurfaceColor.
This is meant to help disambiguate the FP from `args.fDestColor`.

Change-Id: I59a4527e64970811a6798a635191016c645587ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/434679
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-29 22:13:46 +00:00
Dominik Röttsches
58920bbdca [COLRv1] Spec update for degree specifications, fix PaintSkew
Multiply degree values by 180 as FreeType returns them just as in the
font format. Add more tests for skew and transform, and a sweep
test. Update the test font to follow changes from a work in progress
FontTools branch which implements the new format.

Roll FreeType to include parsing changes
d3dc2da9b2..47b1a541cb

Bug: skia:12272
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts
Change-Id: Iaaf3a53dbf40828b908202c19de91319cc68b0b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432976
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-29 14:55:45 +00:00
Robert Phillips
4dca83162b Rename GrSurfaceDrawContext to skgpu::v1::SurfaceDrawContext
This CL is mostly mechanical. It:

replaces "src/gpu/GrSurfaceDrawContext.h" #includes with
         "src/gpu/v1/SurfaceDrawContext_v1.h" and reorders

replaces "class GrSurfaceDrawContext;" with
         "namespace skgpu { namespace v1 { class SurfaceDrawContext; }}"

replaces "GrSurfaceDrawContext*" with "auto" where possible
replaces "rtc" with "sdc"
replaces "surfaceDrawContext" with "sdc"
replaces GrSurfaceDrawContext with skgpu::v1::SurfaceDrawContext
reflows parameters as needed

This CL does not try to:

make skgpu::v1::SurfaceDrawContext V1-only
minimize the skgpu and/or skgpu::v1 prefixes

Those two tasks will be accomplished in follow up CLs. This CL is just trying to get the bulk of the mechanical changes comprehensibly landed.

Bug: skia:11837
Change-Id: I6fe59080249d585df8f5d27c6b67569cdc35842f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-28 20:12:10 +00:00
Mike Reed
a2a85e473c Generalize composing imagefilters and shaders to blenders
The preexisting enum versions now are just shallow factories for
the new blender versions, though internally we've kept the
specializations on impl.

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

TBR=brianosman@google.com
Bug: skia:11837
Change-Id: Ib96f3619e3a50091516f81ae48f956fe83c05aff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431384
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-07-26 18:28:04 +00:00
Dominik Röttsches
613ca2b916 Fix PaintScale and add testing
Define separate GMs for scaling and gradient repeat modes. Migrate more
test glyphs to script generated test font from [1].

Follow-up to [2] and [3].

[1] https://github.com/googlefonts/color-fonts
[2] https://skia-review.googlesource.com/c/skia/+/424096
[3] https://skia-review.googlesource.com/c/skia/+/423396

Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts
Change-Id: Ie4ac33967333e6218526889c4d762c5cc378e0d9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431956
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-26 14:38:59 +00:00
Chris Dalton
c3176002bc Lift the tessellation atlas into its own path renderer
Creates a new path renderer, GrAtlasPathRenderer, that handles all the
atlasing. Managing the atlas in its own path renderer gives us more
control over when atlasing happens in the chain, will allow us to more
easily use the atlas in kCoverage mode, and makes the clipping code
cleaner.

Bug: skia:12258
Change-Id: Ie0b669974936c23895c8ab794e2d97206ed140f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431896
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-23 23:02:58 +00:00
Michael Ludwig
cfd204a785 Rename/simplify SkCanvas::resetClip() and make recordable
AndroidFramework uses both their own custom display list (which could
handle resetClip with android-side changes) AND conventional picture
recording. In order for replace op emulation to work when they have
been recorded into a picture, we need to make it virtual and supported
in SkPicture.

This also renames the API to ResetClip() from ReplaceClip() and does not
have any additional arguments. Based on AF's usage pattern, it only n
needs to reset the clip to the surface bounds or the device clip
restriction, it seems best to reduce the API as much as possible before
it's adopted.

Bug: skia:10209
Change-Id: I37adb097c84a642f4254b8c0f9d4c7fea8d9abdf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430897
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-07-23 19:05:42 +00:00
Robert Phillips
7a0d3c3f12 Revise GM infrastructure to not rely on GrSurfaceDrawContext
The SDC will soon be V1-only. Remove it from the generic testing infrastructure and require each V1-specific GM to explicitly retrieve it.

Bug: skia:11837
Change-Id: I4c904b7e333333382062bde4b17a1f9f81bee6a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430425
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-21 20:59:37 +00:00
Robert Phillips
259b46894d Reduce GrOnFlushResourceProvider's functionality
The main goal of this CL was to remove GrOnFlushResourceProvider::makeSurfaceDrawContext (which was only being used in the OnFlushCallbackTest) to allow simpler modifications to GrSurfaceDrawContext. It looks like there was a lot more unused stuff here though.

Bug: skia:11837
Change-Id: Idbc4001c58a4e8456bffcf1bac32150f2452fb56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430043
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-20 20:47:34 +00:00
Mike Reed
1f261da41e Stop using filterquality
Change-Id: I0fd8ace529cde3b36df72dd4d80bba18c1388b20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429497
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-18 15:48:36 +00:00
Mike Reed
c82ab0839f Stop using filterquality
Change-Id: I67d1a464618f1a54f4e3bd4e1409b1d91a90e66a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429336
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-17 03:11:32 +00:00
Mike Reed
2bdf6ed96f Stop using SkFilterQuality
Change-Id: Ief80d125eacb5922b95ab16ebc8d6b483469ada7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429097
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-17 01:55:42 +00:00
Jim Van Verth
94fda947eb Reland "Fix directional shadows."
This is a reland of 6789b82401

Original change's description:
> Fix directional shadows.
>
> The xy offset calculation for drawShadow was not quite correct. Rather
> than normalizing the light vector and using the xy values of that as the
> base offset value, we should scale the light vector by 1/z.
>
> See https://github.com/flutter/engine/pull/27124#issuecomment-880182653
> for more detail.
>
> Bug: skia:10781
> Change-Id: Ib69a313cb96a532f8d89644e3d69f666a184e897
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428880
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

Bug: skia:10781
Change-Id: Ib58d374aa03d0144512e5ded6ccd572c74783607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428978
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-07-16 16:49:52 +00:00
Ethan Nicholas
a2d22b2e08 Broke DSLVar into separate subclasses
Previously, DSLVar represented local, global, and parameter variables.
This splits it into three separate subclasses.

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

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

Change-Id: I5f390a7384ce0af6a2131d84f97fc5e5b318063f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428576
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-07-15 15:40:06 +00:00
Chris Dalton
6aaf00fa7e Add a "usesMSAASurface" arg to GrMeshDrawOp::onCreateProgramInfo
onCreateProgramInfo needs to know if DMSAA will be rendering to a
separate MSAA target in order to properly set up its pipeline and
shaders. This CL mostly just plumbs this unformation through, but also
cleans up FillRRectOp now that this information is available.

Bug: skia:12201
Change-Id: I7300d2725da72484a12bd0c9d3ad298ae81bff90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427577
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-13 20:22:31 +00:00
Tyler Denniston
f8b7c1ac5f Pass CTM to path effects (experimental)
Add an overload to SkPathEffect that can be used when the CTM is known
at the callsite. GPU callsites are not handled here, that will be
tackled in a separate CL.

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

Bug: skia:11957
Change-Id: I01615985599fe2736de954bb10dac881b0554ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420239
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-13 18:42:55 +00:00
Michael Ludwig
575c921357 Account for hairline mode in rect op bounds for clipping
Disables the preApply() clip check for rects that are subpixel since the
bounds will not be correct, and avoids pre-applying clips to rects if
the result would turn into a subpixel draw.

Also disables hairline mode for rects that are not fully anti-aliased,
which showed up in the fast_constraint GMs where we'd tile an image and
the bottom/right edges were actually subpixel. Since the objective of
per-edge AA is for tiling, we don't want those subpixel edges to be
outset more than the original geometry would have been in a non-tiling
case.

Bug: skia:12164, chromium:1210170
Change-Id: I3bca4fc3e63b6f86f1da1ea7a5e5873d221755f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426437
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-13 17:33:13 +00:00
Chris Dalton
ea46ef3a9c Move clip optimizations into GrFillRRectOp
Adds a new clipToShape() virtual on GrDrawOp and implements it with
GrFillRRectOp. GrClipStack now calls this method before attempting to
clip by any other means.

Since clips are often round rects, and a round rect/round rect
intersection can itself be round rect, this allows GrFillRRectOp to
bypass clipping entirely in many cases.

Bug: chromium:928984
Change-Id: Ic19b3f481ee489e3ca85817ba11d132172089a11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426297
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-12 21:58:21 +00:00
Brian Salomon
4b6e2f0d88 Remove GrBlendFragmentProcessor::BlendBehavior.
There is only one value for the enum.

Bug: skia:10457
Change-Id: I46edd905c3a65ab5b398964ccd4f978b9b9737f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425461
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-07-09 20:31:30 +00:00
John Stiles
9191e813a0 Enforce consistency in swizzle domains.
GLSL disallows mixing swizzle domains within a single swizzle:
http://screen/93eHNQDbx35hMdk
SkSL now disallows it as well.

Change-Id: Ied2e11ee04285b143a864e28cac30335f01aad0e
Bug: skia:10621
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426458
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-09 20:30:22 +00:00
Chris Dalton
fa5a8b8a36 Add a gradient to the rrect_clip tests
This helps ensure local coords get handled correctly during clip
optimizations.

Bug: chromium:928984
Change-Id: I762077bc7a412ee62703a0221d74138920ecbde0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426296
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-09 19:21:27 +00:00
Brian Osman
50f0dadb7f Remove GrSharedEnums.h
Change-Id: I3f2e927001da10652b2965687e31aa8452c9dfc6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425997
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-07-09 15:32:46 +00:00
Tyler Denniston
bdc412f149 Revert "Reland "Omit inner join geometry when possible""
This reverts commit 44edd1952a.

Reason for revert: problematic gold diffs (e.g. paths-data-10-t) and androit CTS failures

Original change's description:
> Reland "Omit inner join geometry when possible"
>
> This is a reland of 1b0a95e0ee
>
> Original change's description:
> > Omit inner join geometry when possible
> >
> > There is some relatively cheap math we can do to determine easy cases
> > when the inner join geometry can be skipped. This CL is not
> > comprehensive in that there may be other cases where we can skip the
> > geometry.
> >
> > Only handling miter joins in this CL - the other join types can likely
> > have similar logic, but will require a bit more computation to compute
> > the inner (reflected) miter point.
> >
> > Misc notes:
> > - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
> >   the old behavior.
> > - Modified stroker to track "previous previous" point, which is the
> >   start point of the previous line segment.
> >
> > Bug: b/165379671, skia:11964
> > Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Tyler Denniston <tdenniston@google.com>
>
> Bug: b/165379671, skia:11964
> Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

TBR=reed@google.com,tdenniston@google.com

Change-Id: I5a2dfd402269db6c788f0e0625f67e9bf3b1f5cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426059
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-07-08 22:14:00 +00:00
Mike Reed
26ea975e6c Arithmetic blender
... to aid in removing special ArithmeticImageFilter.

Can we use something like this to reimpl the ArithmeticImageFilter
--> BlenderImageFilter?

I see some special checking in filterBounds for ArithIF -- is that
required? Is that generalizable for any BlenderImageFilter?
If we can generalize blend[er]imagefilter, let's just move this
logic into Chrome -- no need for Arithmetic to appear in Skia
in any form!

Re: https://skia-review.googlesource.com/c/skia/+/424436

Change-Id: Ifa0ff2fa25de6385f6f60505e73ecc28463a80b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424417
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-08 17:06:17 +00:00
Robert Phillips
ba70138477 Retract GrFillRectOp from GMs and tests
Bug: skia:11837
Change-Id: I150d9b3debd3ebc7885720a5a287a89bf0e3f0de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425019
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-08 15:22:57 +00:00
Brian Osman
07bf3881e7 Convert binary unrolled gradient colorizer to GrSkSLFP
Change-Id: I28eb4479476a531a7b45fbef0ce9da72a4d29dc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423997
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-08 13:48:05 +00:00
Tyler Denniston
44edd1952a Reland "Omit inner join geometry when possible"
This is a reland of 1b0a95e0ee

Original change's description:
> Omit inner join geometry when possible
>
> There is some relatively cheap math we can do to determine easy cases
> when the inner join geometry can be skipped. This CL is not
> comprehensive in that there may be other cases where we can skip the
> geometry.
>
> Only handling miter joins in this CL - the other join types can likely
> have similar logic, but will require a bit more computation to compute
> the inner (reflected) miter point.
>
> Misc notes:
> - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
>   the old behavior.
> - Modified stroker to track "previous previous" point, which is the
>   start point of the previous line segment.
>
> Bug: b/165379671, skia:11964
> Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

Bug: b/165379671, skia:11964
Change-Id: If8bf183db9379d0a98a6f88e70f871a559692a60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423821
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-07-08 13:14:32 +00:00
Brian Salomon
a2d6890c5b Remove GrBlendFragmentProcessor::BlendBehavior::kDefault
Always explicitly pass one of the other behaviors.

Bug: skia:10457
Change-Id: I573161b3de0476a398d71fcaab71e2d68fa13d02
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-07-08 12:57:15 +00:00
Robert Phillips
550de7f872 Depower GrPipeline.h
This is mainly to get GrTextureEffect.h out of this header. Its distribution keeps gumming up efforts to make more classes V1-only.

Bug: skia:11837
Change-Id: I6d5aae20bb20cfe3fb4d93c526efe8cf7e5e0c52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425017
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-07 13:56:23 +00:00
Robert Phillips
cc44feb654 Start using skgpu::v1 and skgpu::v2 namespaces
Bug: skia:11837
Change-Id: I042775dae34c99c20048d6d70aa6f06b2a6a268b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424117
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-06 18:28:54 +00:00
Robert Phillips
7cef6789fd Change architecture #defines to be SK_GPU_V1 and SK_GPU_V2
A strictly mechanical CL

Bug: skia:11837
Change-Id: Id794d1fefe261d685b19e5d4d599cdab5e021cf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424038
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-01 18:42:53 +00:00
Tyler Denniston
1700f865c5 Revert "Omit inner join geometry when possible"
This reverts commit 1b0a95e0ee.

Reason for revert: breaking g3, other downstream expectations

Original change's description:
> Omit inner join geometry when possible
>
> There is some relatively cheap math we can do to determine easy cases
> when the inner join geometry can be skipped. This CL is not
> comprehensive in that there may be other cases where we can skip the
> geometry.
>
> Only handling miter joins in this CL - the other join types can likely
> have similar logic, but will require a bit more computation to compute
> the inner (reflected) miter point.
>
> Misc notes:
> - Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
>   the old behavior.
> - Modified stroker to track "previous previous" point, which is the
>   start point of the previous line segment.
>
> Bug: b/165379671, skia:11964
> Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

TBR=reed@google.com,tdenniston@google.com

Change-Id: I812b39a327606b094cd22fb04b8765afc60ac722
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423583
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-30 21:29:19 +00:00
Tyler Denniston
1b0a95e0ee Omit inner join geometry when possible
There is some relatively cheap math we can do to determine easy cases
when the inner join geometry can be skipped. This CL is not
comprehensive in that there may be other cases where we can skip the
geometry.

Only handling miter joins in this CL - the other join types can likely
have similar logic, but will require a bit more computation to compute
the inner (reflected) miter point.

Misc notes:
- Added SK_LEGACY_INNER_JOINS ifdef in the event that clients depend on
  the old behavior.
- Modified stroker to track "previous previous" point, which is the
  start point of the previous line segment.

Bug: b/165379671, skia:11964
Change-Id: I56789e85a2b4627c32f2a30fe60e47d448e9adf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404717
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-30 19:52:42 +00:00
Chris Dalton
061aa81252 Handle the empty case in GrDrawingManager::insertTaskBeforeLast
Change-Id: I3c0f042b28cc39cc6df2f63b52a0f431cee6bda4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421826
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-25 20:38:09 +00:00
Brian Osman
b384eb204c Convert shape-clipping FPs to GrSkSLFP
Change-Id: Ic574939fd37dd9ded9868d3ffa9ac962140fb66c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421537
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-06-25 17:08:39 +00:00
Chris Dalton
83420eb817 Rewrite tessellation atlases as normal render tasks
Rewrites tessellation atlases as normal render tasks instead of
"onFlush" tasks. These tasks get inserted into the DAG upfront, lay
out their atlases as dependent tasks get built and reference them, and
finally add their ops to render themselves during onMakeClosed. Doing it
this way allows us to pause the flush and re-render the atlas whenever
it runs out of room.

Bug: b/188794626
Bug: chromium:928984
Change-Id: Id59a5527924c63d5ff7c5bce46a88368e79fc3ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420556
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2021-06-24 01:44:19 +00:00
Chris Dalton
b1e8f85fb8 Add an 'opBeingClipped' param to GrClip::apply
The tessellation atlas needs this to call visitProxies.

Bug: b/188794626
Bug: chromium:928984
Change-Id: I5bfb2559abcaf5c7602393e96adb846bcfbce971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-06-23 20:41:39 +00:00
Ethan Nicholas
b4f8b7a9f2 Cleaned up DSL error handling
This unifies various chunks of error handling code and makes the DSL
more gracefully handle failed object construction.

Change-Id: I4edc581c9eba276ce2ee2a17125ea7bd6057134a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420237
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-06-23 15:22:35 +00:00
Brian Osman
be545c9554 Verify that most runtime color filters support filtering a single color
When writing runtime FPs, this lets us confirm that we're going to get
the constant output for constant input optimization.

Change-Id: I358507585423e5b15c92a0b2e9278b16f8727fe8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419798
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-21 20:14:07 +00:00
Brian Osman
6290555808 Replace GrDeviceSpaceEffect with a runtime FP
Change-Id: Ic0876160c936132c53b55ac9d27e0e422e1ccd26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420217
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-21 19:31:06 +00:00
Chris Dalton
685e09b31a Reland "Purge ccpr"
This is a reland of 7bf6bc0d06

Original change's description:
> Purge ccpr
>
> Now that the clip atlas has been successfully migrated to
> tessellation, we don't need this code anymore!
>
> Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Change-Id: If0be86902e7cc4755eba91a89be1ec1a6a4b54b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419720
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-19 18:42:38 +00:00
Brian Osman
fe83ab6706 Revert "Purge ccpr"
This reverts commit 7bf6bc0d06.

Reason for revert: Android build references kCoverageCounting

Original change's description:
> Purge ccpr
>
> Now that the clip atlas has been successfully migrated to
> tessellation, we don't need this code anymore!
>
> Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I01d99287978f848eb8bf900c07cba90ceb3b6edc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419898
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-06-19 15:13:19 +00:00
Chris Dalton
7bf6bc0d06 Purge ccpr
Now that the clip atlas has been successfully migrated to
tessellation, we don't need this code anymore!

Change-Id: Ic97f50cff7c4ee59f4476f8410f0b30a32df4e90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419857
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-18 21:46:36 +00:00