Commit Graph

5118 Commits

Author SHA1 Message Date
Michael Ludwig
397fdfdf18 Implement separate crop filter
Right now the crop image filter is hidden in src/ and is only used in
a new GM to test out its functionality. In later CLs the plan will be to
migrate individual filter effects away from the built-in crop rect to
composing themselves with this image filter.

Eventually, the crop filter will be made public as part of the
SkImageFilters factories so there can be independent control on input
and output cropping. Its features will also be expanded to support more
tile modes than just kDecal.

Once all other effects rely on this crop filter, the legacy system can
be deleted and the effects can be more easily updated to the rest of the
new image filter API. This crop filter is actually the first image
filter to be implemented only in terms of the new API (and skif coord
space types). This highlighted a few pain points that still exist in
terms of the API, where I have added comments to capture how they could
be improved. Unfortunately, they aren't addressable until the rest of
the implementations have been migrated.

Bug: skia:9296
Change-Id: I12e96b679c246a9ec4e1e61f640414a11f1b6bb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451597
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-09-24 20:18:36 +00:00
Florin Malita
71cb972518 Scale picture shader (GPU) by input alpha
Bug: skia:12476, skia:11942
Change-Id: Iee94470e117788f88516af9aaa8950434278f662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452559
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-24 19:11:34 +00:00
Michael Ludwig
8c9c185a92 Simplify SkAAClip to use SkClipOp, not SkRegion::Op
Bug: skia:10205
Change-Id: I19039f72db1052db27f5819fafdc5ba8eb8af909
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445618
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-20 20:12:38 +00:00
Mike Reed
b1559f2acd drawPoints with maskfilter fix
Fix: just check for maskfilter, and reject fast-cases if we have one.

New GM: points_maskfilter

before: draw red squares with no blurs, but red circles had blurs

after: both sets have the blur (i.e. the maskfilter)

Bug: skia:12435
Change-Id: I460908818d2edf8c6065db2fe99a9df0e7ffc543
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448266
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-09-13 19:22:35 +00:00
Michael Ludwig
144926d968 Allow subpixel nested rects to have nearly equal x/y half widths
When transforming to device space, equal local-space half widths in X
and Y might end up being fractionally different, which would prevent
optimizing the nested rect path to use the stroke aa rect op. Visually,
these very small differences are not going to be noticeable and the op
can just arbitrarily pick one of the two widths to use for coverage.

Also fixed an issue where if the aa stroke op returned null from
MakeNested(), drawSimplifiedShape() assumed it meant nothing needed to
be drawn. After https://skia-review.googlesource.com/c/skia/+/427976,
this actually isn't the case and it should attempt path rendering for
the unbalanced subpixel nested rects.

In the linked bug's case, the square rects would not transform to
identical x and y half widths depending on the UI scale of the browser
(differing by a negligible amount). This would then return a null op
and skip falling back to the path renderer so nothing would draw.

Bug: chromium:1234194
Change-Id: Ibd4254cb37e0fc01a5da342e06c4d82cb6223fe8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447462
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-10 21:05:27 +00:00
Dominik Röttsches
09961b554d [COLRv1] Fix blending and compositing
An additional layer is required to composite correctly. PaintComposite
blends/composites between source and destination. The result is
then drawn on top of previous paint results. Previously, the source
layer was just drawn atop previous paints, then the destination
layer was composited down with composite mode, which was incorrect.

More details in [1].

Add tests for composite modes, compare [2]

[1] https://github.com/googlefonts/nanoemoji/issues/332
[2] https://github.com/googlefonts/color-fonts/pull/73

Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts,FM-Debian10-Clang-GCE-CPU-AVX2-x86_64-Release-All-MSAN
Bug: skia:12424
Change-Id: I8ff69022ec09758af7021756b0fb26443216fcca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445936
Commit-Queue: Dominik Röttsches <drott@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-09-07 15:09:58 +00:00
Brian Osman
cbfa34a58c Convert internal SkSL to use .eval()
Also update RELEASE_NOTES to describe new syntax.

Change-Id: I2666551b98f80b61ae3a48c92a9e306cdc7242b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 15:54:54 +00:00
Robert Phillips
fbf021492e Move more Ops to skgpu::v1 namespace
GrFillRRectOp
GrFillRectOp

Bug: skia:11837
Change-Id: Icdecc2ccd9def659b0d9402910b2072e02577a66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444817
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-02 13:25:29 +00:00
Chris Dalton
2a26c50a62 Store the correct number of samples in GrProgramInfo
Bug: skia:11396
Change-Id: I9480b89635bd7a6bdff8ab4876c8eeafdbc27c8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442096
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-26 17:24:47 +00:00
Robert Phillips
62bd633b1c Move tessellation ops to skgpu::v1 namespace
Mechanical.

Bug: skia:11837
Change-Id: Ic302ee314ad73ce034c8daac38416a8249a125a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442276
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-26 15:17:52 +00:00
Robert Phillips
24d622d6f9 Move the GrTessellationPathRenderer into the skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ic445e99adbe2d2ada64f98f9f516c198a247ef09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440876
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-25 17:16:28 +00:00
Brian Osman
293497e77f Convert internal sample() calls to shade/filter/blend
Bug: skia:12302
Change-Id: I8cf958acf9214d0de903a4097647afd74f2a659e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441541
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 21:03:44 +00:00
John Stiles
0c4dd7ae3d Add ES3 versions of min/max/mix/clamp to public SkSL.
I've also added a new runtime_intrinsics slide which plots all of the
ES3 section 8.3 intrinsics for testing purposes. We already had SkSL
tests for the ES3 versions of these functions in intrinsics/.

Change-Id: Ie4cec34cacddc26be78dce1e641de8172fcefd99
Bug: skia:12022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441578
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-24 17:14:50 +00:00
John Stiles
6f90c702e6 Improve runtime-intrinsic plotting.
Instead of a series of green dots, we now get a smooth antialiased line.
This is especially useful on high-DPI displays, as previously the green
dots had gaps between them (making the plot appear as a dashed line).

Change-Id: I947e9ec31fafd133a2458bf508102fedd3eaea1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441577
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-24 15:48:17 +00:00
Brian Osman
9f1e06aef9 Reland "Add sRGB 8888 colortype"
This is a reland of 0f7c10ef56

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I5b6bb28c4c1faa6c97fcad7552d12c331535714d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 12:56:32 +00:00
Brian Osman
405eb7b72f Revert "Add sRGB 8888 colortype"
This reverts commit 0f7c10ef56.

Reason for revert: Unhappy rollers

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reed@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ie199535b9b65ec7c7fef3c773452ea06bdbd2d9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441376
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-23 17:38:05 +00:00
Brian Osman
0f7c10ef56 Add sRGB 8888 colortype
A color type that linearizes just after loading, and re-encodes to sRGB
just before storing, mimicking the GPU formats that work the same way.

Notes:
  - No mipmap support
  - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
  - Needs better testing

This is a re-creation of reviews.skia.org/392990

Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-23 15:14:41 +00:00
Robert Phillips
e453fa063d Move some v1-only gpu/tessellate files to gpu/ops
This CL just moves the files and renames them. It doesn't move them into the skgpu::v1 namespace.

Bug: skia:11837
Change-Id: Iab322d0dc5b5d1cfd32436785081539dc85c18d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440776
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-08-19 19:56:46 +00:00
John Stiles
0c12e32fad Reland "Add GM slide for ES3 trig intrinsics."
This reverts commit 282af12ae0.

draw_shader now has a `allowRasterFallback` option and returns an empty
bitmap if no surface can be made.

Original change's description:
> Revert "Add GM slide for ES3 trig intrinsics."
>
> This reverts commit 3cb09c0904.
>
> Reason for revert: Windows ANGLE can fall back to software
>
> Original change's description:
> > Add GM slide for ES3 trig intrinsics.
> >
> > Unlike the other Runtime Effects slides, this only works on GPU, as
> > the ES3 intrinsics aren't implemented in SkVM (today).
> >
> > Change-Id: Icf59e4ed7c1e89aa7b730b43c2fd0fa45d61e71a
> > Bug: skia:12202, skia:12352
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439777
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,johnstiles@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: Ica2f7af9e479e5cf96603583c6803b646b8dcb4b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:12202, skia:12352
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440558
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:12202, skia:12352
Change-Id: I774635a8b1e526af0be3b68f771496f1cedce13a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440559
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-18 21:42:56 +00:00
John Stiles
282af12ae0 Revert "Add GM slide for ES3 trig intrinsics."
This reverts commit 3cb09c0904.

Reason for revert: Windows ANGLE can fall back to software

Original change's description:
> Add GM slide for ES3 trig intrinsics.
>
> Unlike the other Runtime Effects slides, this only works on GPU, as
> the ES3 intrinsics aren't implemented in SkVM (today).
>
> Change-Id: Icf59e4ed7c1e89aa7b730b43c2fd0fa45d61e71a
> Bug: skia:12202, skia:12352
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439777
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,johnstiles@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ica2f7af9e479e5cf96603583c6803b646b8dcb4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12202, skia:12352
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440558
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-18 19:35:19 +00:00
John Stiles
0733d48428 Check for SkSL ES3 capabilities in GrShaderCaps.
This lets us set the minimum bar for SkSL ES3 support in one place,
rather than checking this set of bits in multiple spots.

Change-Id: Icba58d8b6a93626ce2ffbe3c4b846cad4749cab5
Bug: skia:12347
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440518
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-18 17:12:12 +00:00
John Stiles
3cb09c0904 Add GM slide for ES3 trig intrinsics.
Unlike the other Runtime Effects slides, this only works on GPU, as
the ES3 intrinsics aren't implemented in SkVM (today).

Change-Id: Icf59e4ed7c1e89aa7b730b43c2fd0fa45d61e71a
Bug: skia:12202, skia:12352
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439777
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-18 16:22:07 +00:00
Robert Phillips
461c539a04 Move several more PathRenderers to skgpu::v1 namespace
Bug: skia:11837
Change-Id: Ifa1da88aafcaa96e0e885facaeb849cc9963bcfe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-17 22:19:11 +00:00
Greg Daniel
e56d31fd56 Update LazySurfaceDesc to take a GrTextureType.
Bug: skia:12342
Change-Id: Ic57f3f30bc7d0a9d932eb4ac1c28b87b3b544ce4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439282
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-08-16 14:17:58 +00:00
Greg Daniel
0e9d34d33c Reland "Remove GrBackendFormat's textureType use from isFormatTexturable call."
This reverts commit d90777ada3.

Reason for revert: relanding with fix to GrBackendTexture

Original change's description:
> Revert "Remove GrBackendFormat's textureType use from isFormatTexturable call."
>
> This reverts commit 832c817bc8.
>
> Reason for revert: uninitialized value in GrBackendTexture
>
> Original change's description:
> > Remove GrBackendFormat's textureType use from isFormatTexturable call.
> >
> > The goal of this change was to remove the use of GrBackendFormat::textureType()
> > from GrCaps::isFormatTexturable call. Instead we will always pass in a
> > GrTextureType into this call.
> >
> > To do this a lot of plumbing of GrTextureType was added to various call
> > sites. However, this CL halts the plubming up at the proxy level where we
> > get it from the GrBackendFormat still. Future CLs will continue removing
> > these call sites and others that use GrBackendFormat::textureType().
> >
> > Bug: skia:12342
> > Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: I354bbbf00be7a86c480009f3e7b36a8777a6bf3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:12342
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439338
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

# Not skipping CQ checks because this is a reland.

Bug: skia:12342
Change-Id: I151196f149f9e191d2975b8fe81334f4f8720744
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439339
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-08-13 22:37:13 +00:00
Greg Daniel
d90777ada3 Revert "Remove GrBackendFormat's textureType use from isFormatTexturable call."
This reverts commit 832c817bc8.

Reason for revert: uninitialized value in GrBackendTexture

Original change's description:
> Remove GrBackendFormat's textureType use from isFormatTexturable call.
>
> The goal of this change was to remove the use of GrBackendFormat::textureType()
> from GrCaps::isFormatTexturable call. Instead we will always pass in a
> GrTextureType into this call.
>
> To do this a lot of plumbing of GrTextureType was added to various call
> sites. However, this CL halts the plubming up at the proxy level where we
> get it from the GrBackendFormat still. Future CLs will continue removing
> these call sites and others that use GrBackendFormat::textureType().
>
> Bug: skia:12342
> Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I354bbbf00be7a86c480009f3e7b36a8777a6bf3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439338
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-08-13 20:05:32 +00:00
Greg Daniel
832c817bc8 Remove GrBackendFormat's textureType use from isFormatTexturable call.
The goal of this change was to remove the use of GrBackendFormat::textureType()
from GrCaps::isFormatTexturable call. Instead we will always pass in a
GrTextureType into this call.

To do this a lot of plumbing of GrTextureType was added to various call
sites. However, this CL halts the plubming up at the proxy level where we
get it from the GrBackendFormat still. Future CLs will continue removing
these call sites and others that use GrBackendFormat::textureType().

Bug: skia:12342
Change-Id: Ic0f02b9c7f7402405623b8aa31aa32a9a7c22297
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439277
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-13 19:03:21 +00:00
John Stiles
acf7164587 Fix cases of variable shadowing in /gm/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: I905459bf0bbaa205da7dc59e1910e345bed2af51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438538
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-08-13 03:35:15 +00:00
Robert Phillips
06273bcb8a Prepare headers for making all ops V1-only
Basically, ensure all the headers about to become V1-only only appear in contexts that are currently or will soon be V1-only.

This is almost all fallout from retracting some of the moving headers from other headers i.e.:

GrMeshDrawOp.h from GrOpFlushState.h
GrDrawOp.h from GrOpsRenderPass.h
GrDrawOp.h from GrOpsTask.h
GrSimpleMeshDrawOpHelper.h from GrTessellationShader.h


Bug: skia:11837
Change-Id: I939f5c82c3042e9ab00571b5796ab82dbe968085
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438677
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-12 15:09:11 +00:00
John Stiles
b7f2215bbb Fix cases of variable shadowing in test code.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: I571931e01b0b95d85a7b566fc785ac219e8e731f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438697
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-08-11 20:38:09 +00:00
Brian Salomon
4895946078 Move ProgramImpl definitions into Processor subclass headers.
Move ProgramImpl function definitions into Processor subclass cpp files.

Delete separate h/cpp files.

Modify GrGLSLVaryingHandler::addPassThroughAttribute to break #include
cycle. It now takes a ShaderVar rather than a GP::Attribute, making
it slightly more flexible as the input can be any variable defined
in the vertex shader.

Bug: skia:11358
Change-Id: I94ee8cd44d29e194216592ecae5fd28de785c975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 19:45:56 +00:00
Brian Salomon
bab2d11891 Improve consistency of GP::ProgramImpl subclasses
Named "Impl" and nested in GP or makeProgramImpl definition.

Remove unused INHERITED typedefs.

Remove GenKey pattern.

Bug: skia:11358
Change-Id: Icb4d5a0844184f51d92135de6cee6f6e77f57a5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438478
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-11 16:52:09 +00:00
Robert Phillips
643f481b15 Cruft leftover from GrSurfaceContext hierarchy v1/v2 split
Non-substantive changes that didn't fit any earlier CL in the chain.

Bug: skia:11837
Change-Id: Ic9b7c05c014b03ab5b30532098fb8cd2da846d9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428958
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-11 14:17:49 +00:00
Brian Salomon
b25560a1e1 Consistency among GrFP::ProgramImpl subclasses
Remove GL or GLSL from names of subclasses. Make nearly all subclasses
nested either in FP class or its onMakeProgramImpl() function.

Make onSetData private rather than protected.

Remove unused INHERITED typedefs.

Embrace idea that Impl is part of FP private implementation:
direct member access rather than getters and no GenKey pattern.

Other random consistency updates, modernatizations, stylistic changes.

Bug: skia:11358
Change-Id: I0d94e00a146abdd38e094ca550fc3b9608bd433d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438056
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 13:59:46 +00:00
Ben Wagner
8477dd24c8 Fix typeface GMs to draw or skip
Before this change the typeface_styling GM would draw an empty canvas if
the default SkFontMgr could not load a 'ttf' font. Instead of drawing
nothing, attempt to draw an 'A' in the default available font.

Before this change the typeface_rendering GMs would draw an empty canvas
if the default SkFontMgr could not load a 'ttf' font. Instea of drawing
nothing, skip the test instead.

Change-Id: I15b3c5aae7ac0d2e8f0291456a84291768b009a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438276
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-08-10 21:36:55 +00:00
Robert Phillips
53eaa64873 Rename GrSurfaceContext -> skgpu::SurfaceContext
Almost entirely mechanical.

Bug: skia:11837
Change-Id: I984339097fdeeae2eccb6c1d790d510020511961
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438177
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-10 19:24:53 +00:00
Michael Ludwig
b23630c509 Reland "Remove SkTLList"
This reverts commit 14b1d56a2b.

Reason for revert: fix emplace_back() usage

Original change's description:
> Revert "Remove SkTLList"
>
> This reverts commit e1d523d70f.
>
> Reason for revert: breaking old stdlib versions (< c17)
>
> Original change's description:
> > Remove SkTLList
> >
> > Change-Id: I198678b5cb298cf51872fbb8d4fd5d705a6b684e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437339
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> TBR=brianosman@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: I8e02e4cd2f293e7530f842be783de10f69be2ef4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438078
> 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: Ied33ce81a8312963ff0713c4660cdb8541a02180
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438080
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-10 17:57:41 +00:00
Dominik Röttsches
2fa273eecf Reland: [COLRv1] Support retrieving ClipBox.
Reland after MSAN failure, initializing SkRect to empty in
computeColrV1GlyphBoundingBox().

After the discussion in [1] which was filed also in response to feedback
from Ben, the COLRv1 spec moved to not using a bounding box derived from
the `glyf` glyph for a give glyph id, but instead either use a ClipBox
found for a particular glyph id range from a ClipList array in the
COLRv1 table. If such a ClipBox is not found, perform a traversal of the
COLRv1 graph to compute the union of rectangles to compute a bounding
box.

[1] https://github.com/googlefonts/colr-gradients-spec/issues/251

Includes FreeType roll:
47b1a541cb..2c853b38a7

Fixed: skia:12297
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts, luci.skia.skia.primary:FM-Debian10-Clang-GCE-CPU-AVX2-x86_64-Release-All-MSAN
Change-Id: I165fb95c89045c4c7671af2cbe097af38ca65e84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437996
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
2021-08-10 15:13:14 +00:00
Michael Ludwig
14b1d56a2b Revert "Remove SkTLList"
This reverts commit e1d523d70f.

Reason for revert: breaking old stdlib versions (< c17)

Original change's description:
> Remove SkTLList
>
> Change-Id: I198678b5cb298cf51872fbb8d4fd5d705a6b684e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437339
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=brianosman@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I8e02e4cd2f293e7530f842be783de10f69be2ef4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438078
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-10 14:53:52 +00:00
Brian Salomon
f95940bc23 Rename GrGLSLGeometryProcessor to GrGeometryProcessor::ProgramImpl
return from GrGP by unique_ptr, rename factory function to
makeProgramImpl()

Bug: skia:11358

Change-Id: I61dd36f770d2fc0b54de0e0e7b78ac4d3fbd119a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437741
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-10 14:36:40 +00:00
Michael Ludwig
e1d523d70f Remove SkTLList
Change-Id: I198678b5cb298cf51872fbb8d4fd5d705a6b684e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437339
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-10 14:36:07 +00:00
John Stiles
307f8f525a Simplify the boilerplate of cloning a fragment processor.
GrFragmentProcessor now provides an (explicit) copy constructor which
clones all child processors and flags from the passed-in FP. Since we no
longer have flags which propagate up to the root node of the FP tree,
all flags are now safe to copy, since a cloned FP also clones all of its
children.

Change-Id: Ia9f80e0ec540ed1056d25dbb1861a174a1d55f4b
Bug: skia:12299
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437836
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-08-09 20:36:14 +00:00
Michael Ludwig
e1d0040c54 Delete GrClipStackClip and GrReducedClip
Bug: skia:10205
Change-Id: Iafee804751d69e98241a7825664f3be04b20eb14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436566
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-09 18:53:58 +00:00
Robert Phillips
df1ba0395f Revert "[COLRv1] Support retrieving ClipBox."
This reverts commit 4f12b4a599.

Reason for revert: MSAN issue

Original change's description:
> [COLRv1] Support retrieving ClipBox.
>
> After the discussion in [1] which was filed also in response to feedback
> from Ben, the COLRv1 spec moved to not using a bounding box derived from
> the `glyf` glyph for a give glyph id, but instead either use a ClipBox
> found for a particular glyph id range from a ClipList array in the
> COLRv1 table. If such a ClipBox is not found, perform a traversal of the
> COLRv1 graph to compute the union of rectangles to compute a bounding
> box.
>
> [1] https://github.com/googlefonts/colr-gradients-spec/issues/251
>
> Includes FreeType roll:
> 47b1a541cb..2c853b38a7
>
> Fixed: skia:12297
> Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts
> Change-Id: Iac3677cb1207b953876b106a1e0d754760612955
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435116
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Dominik Röttsches <drott@google.com>

TBR=bungeman@google.com,drott@chromium.org,drott@google.com,behdad.esfahbod@gmail.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Id041a270bd2e4d4edcaa114c524981bc2c9e5320
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437738
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-09 17:57:49 +00:00
Brian Salomon
3176e868c4 Rename GrGLSLFragmentProcessor to GrFragmentProcessor::ProgramImpl
Bug: skia:11358

Change-Id: Ic179ddd9d52dca3fc0bd85b61db49097390b7f58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437681
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-09 17:43:59 +00:00
Dominik Röttsches
4f12b4a599 [COLRv1] Support retrieving ClipBox.
After the discussion in [1] which was filed also in response to feedback
from Ben, the COLRv1 spec moved to not using a bounding box derived from
the `glyf` glyph for a give glyph id, but instead either use a ClipBox
found for a particular glyph id range from a ClipList array in the
COLRv1 table. If such a ClipBox is not found, perform a traversal of the
COLRv1 graph to compute the union of rectangles to compute a bounding
box.

[1] https://github.com/googlefonts/colr-gradients-spec/issues/251

Includes FreeType roll:
47b1a541cb..2c853b38a7

Fixed: skia:12297
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Release-All-Android_NativeFonts
Change-Id: Iac3677cb1207b953876b106a1e0d754760612955
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435116
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
2021-08-09 15:57:57 +00:00
Brian Salomon
13b287386a Remove GLSL from name of functions that builds GrProcessor keys.
Bug: skia:11358
Change-Id: Ie70e45b18c12126c8e86700ad1040bc319be385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436998
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-09 14:01:13 +00:00
Brian Salomon
54fd96b5fa Fix Wunused-but-set-variable warnings
Change-Id: I0e093fd35b11e9a765ef9c09f3b6346086ff66bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435983
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-05 21:49:18 +00:00
Mike Reed
35215fb68a Don't assume extended (check perspective)
Related to https://skia-review.googlesource.com/c/skia/+/436476

Change-Id: Ief81b5f1824b5dd7960e09a1a6df55bcf6b6dc45
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436597
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-08-04 21:01:11 +00:00
Tyler Denniston
cc04b6f0bf Revert "Reland "Reland "Omit inner join geometry when possible"""
This reverts commit 40dfc67917.

Reason for revert: same android CTS failures

Original change's description:
> Reland "Reland "Omit inner join geometry when possible""
>
> This reverts commit bdc412f149.
>
> Original change's description:
> > 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>
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: b/165379671, skia:11964
> Change-Id: Icfd420954a291f414fc2cb5cc2fe2756224a5d8d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436518
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

TBR=reed@google.com,tdenniston@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ifbca34b8ff836aee6b517f58cbf05cf0aa38eace
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/165379671, skia:11964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436567
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-08-04 20:29:09 +00:00