Commit Graph

378 Commits

Author SHA1 Message Date
John Stiles
8b2633215e Update single-child RuntimeShader to use string_view.
This change has the potential to break existing clients if they pass
nullptr as the childShaderName, which used to be supported. To fix
this breakage, pass the empty string instead of null.

Change-Id: I984ec0e12be5bb0a82ec5b719fec48ee7d577dc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557898
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-07-12 18:59:43 +00:00
John Stiles
c5c0043a74 Update SkRuntimeEffect::Child to use string_view names.
Change-Id: I294453bb18b9ecd46a84cdfaac831679437a4fe2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-07-12 16:30:58 +00:00
John Stiles
955b73beec Convert SkRuntimeEffect::Uniform to use string_view.
Change-Id: I07c0cb63286cb2c74853a49a44a9ee5ae7b994c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557102
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-07-12 16:07:08 +00:00
Ian Prest
94e34f7a1b Add a way to get 'active' props from SkCanvas
This CL adds two new APIs to SkCanvas: getBaseProps, and getTopProps.

SkCavas::getBaseProps is functionally identical to getProps, but returns
the SkSurfaceProps by value, rather than via an 'out' parameter.
SkCanvas::getProps is now considered deprecated.

SkCanvas::getTopProps returns the 'currently active' SkSurfaceProps,
i.e., it returns the props from the "top device".  This is useful
because the SkSurfaceProps can change when creating new layers.

Bug: skia:13483
Change-Id: Ia1d9a10ffdd929427f1f2c0a7c4ba6965d4bd3c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554736
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Ian Prest <iapres@microsoft.com>
2022-07-12 13:52:36 +00:00
Kevin Lubick
52904d35ab Make copy of skcms checkout in //modules/skcms
This will make our Bazel rules in G3 easier to use.

We will have to clean up a lot of clients (and this still
might require a manual G3 roll to land to account for the
source files).

Eventually, we will be able to delete the old one
//include/third_party/skcms and //third_party/skcms

Bug: skia:12451, b/237076898
Change-Id: I9fd55607cbb7e1196d175aa8f140e99a73505c89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554056
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-06-30 12:05:13 +00:00
Aaron Krajeski
93f5c2b6f0 SkPixmap::getColor4f and SkBitmap::getColor4f
Part of an ongoing effort to move chromium away from SkColor and towards SkColor4f: crbug.com/1308932

Many tests use SkBitmap::getColor to validate pixels, this means that we're now in a state where we draw using float colors but then have to validate the operation with the nearest integer color value. As can be seen in SoftwareRendererTest.SolidColorQuad.

Change-Id: Ic4493e578c8f4066c2439f1e793eef10eb4f4056
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553797
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-06-28 23:54:01 +00:00
Ian Prest
18fdfe83a5 Add SkSurfaceProps parameter to several APIs
In general, SkSurfaceProps is only needed when rendering text.  However,
there are several existing APIs that don't allow SkSurfaceProps to be
passed in by the user.

This change adds new SkSurfaceProps parameters to several public-facing
APIs:
  1. SkRasterHandleAllocator::MakeCanvas
  -- The props are used by the canvas whenever text is rendered.

  2. SkImage::MakeFromPicture and SkImageGenerator::MakeFromPicture
  -- The props are used to render any text in the SkPicture object.

Change-Id: Ic48e8a30bb12b3170415c644de1a007b5eefb818
Bug: skia:13369
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545396
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-06-02 13:12:33 +00:00
Brian Salomon
9676ef7302 Constify the uniform value SkDatas in runtime effects
Bug: skia:12720
Change-Id: I7f74b4f88456bf5ddef1a648d2231d28034ed246
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544237
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-05-31 16:59:10 +00:00
Aaron Krajeski
1a7fb782ae Make float color versions of SkBitmap::clear
Bug: skia:13329
Change-Id: I9992cd5149e50f9a998af712984a82e5d952d58b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541936
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-05-19 23:25:06 +00:00
Brian Salomon
c8ee7b1384 Reland "Reland "Add anisotropic option to SkSamplingOptions.""
This is a reland of commit e6f23f98de

Original change's description:
> Reland "Add anisotropic option to SkSamplingOptions."
>
> This is a reland of commit 9be2d572d4
>
> Original change's description:
> > Add anisotropic option to SkSamplingOptions.
> >
> > Implement on GPU.
> >
> > Bug: skia:13036
> > Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13036
> Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: Icb2513cea6c4ec4cec934f78c66071081c232960
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-29 19:28:52 +00:00
Brian Salomon
022334eaa7 Revert "Reland "Add anisotropic option to SkSamplingOptions.""
This reverts commit e6f23f98de.

Reason for revert: skps busted

Original change's description:
> Reland "Add anisotropic option to SkSamplingOptions."
>
> This is a reland of commit 9be2d572d4
>
> Original change's description:
> > Add anisotropic option to SkSamplingOptions.
> >
> > Implement on GPU.
> >
> > Bug: skia:13036
> > Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13036
> Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: I583704990e4690ddd86923468c8cb742c1a819c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535402
Auto-Submit: Brian Salomon <bsalomon@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-04-29 14:35:04 +00:00
Brian Salomon
e6f23f98de Reland "Add anisotropic option to SkSamplingOptions."
This is a reland of commit 9be2d572d4

Original change's description:
> Add anisotropic option to SkSamplingOptions.
>
> Implement on GPU.
>
> Bug: skia:13036
> Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

Bug: skia:13036
Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-29 14:18:22 +00:00
Michael Ludwig
664e2c8bfa Improve legibility of release note
Bug: skia:13263
Change-Id: I1a1bff427964c9d0899a533ce7add1829e980c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534566
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-04-28 19:52:38 +00:00
Brian Salomon
97381c2ce5 Revert "Add anisotropic option to SkSamplingOptions."
This reverts commit 9be2d572d4.

Reason for revert: need to fixup gm for abandoned context. Maybe other failures?

Original change's description:
> Add anisotropic option to SkSamplingOptions.
>
> Implement on GPU.
>
> Bug: skia:13036
> Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>

Bug: skia:13036
Change-Id: I311d6ac46750ea5705285b964610125129b89582
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534916
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-28 13:14:41 +00:00
Brian Salomon
9be2d572d4 Add anisotropic option to SkSamplingOptions.
Implement on GPU.

Bug: skia:13036
Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2022-04-28 12:53:02 +00:00
Michael Ludwig
a6eaac0595 Disable experimental HW tessellation
This should make it so the HW tessellation path renderers are never
used; it will always select the atlas or direct fixed-count renderers
instead. This CL will give us a good indication of what visual diffs
to expect, layout tests to rebase, and any performance regressions.

If those are acceptable, then we can proceed with the rest of the code
removal.

Bug: skia:13263
Change-Id: I273bb231461932047768c1c7233ae4291483bc95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533810
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-04-27 13:34:09 +00:00
Kevin Lubick
6c78b8d3ae Revert "Move SkCamera.h to client_utils/android"
This reverts commit 8a54d86c78.

Reason for revert: Causing issues with Android CTS

Original change's description:
> Move SkCamera.h to client_utils/android
>
> Android still uses this
> https://developer.android.com/reference/android/graphics/Camera
> but no other client does.
>
> This adds a little adaption layer until Android is updated
> to use the View3D version.
>
> Move SkCamera.h to View3D.h. Change names to android::skia::CLASS
> instead of SkCLASS. (3DView is not a valid class name, so rename it to
> View3D.)
>
> Forward-declare SkMatrix. Do not override SkNoncopyable - just delete
> the copy constructor/operator=. Make fU and fV private in Patch3D.
>
> Make Sk3DView override View3D temporarily until Android can be switched
> over to the new class.
>
> (View3D from http://review.skia.org/291371)
>
> I made Patch3D and Camera3D be private classes as they are
> currently not used by Android and wanted to constrain the
> exposed API as much as possible.
>
> Change-Id: Ibde45478421feeb610e045205c3f20c0e5b1567e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532456
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Change-Id: If6e768524a0e13e14ef886a6f081a09ddc0dc2fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533396
Owners-Override: Kevin Lubick <kjlubick@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-04-25 12:33:01 +00:00
Kevin Lubick
8a54d86c78 Move SkCamera.h to client_utils/android
Android still uses this
https://developer.android.com/reference/android/graphics/Camera
but no other client does.

This adds a little adaption layer until Android is updated
to use the View3D version.

Move SkCamera.h to View3D.h. Change names to android::skia::CLASS
instead of SkCLASS. (3DView is not a valid class name, so rename it to
View3D.)

Forward-declare SkMatrix. Do not override SkNoncopyable - just delete
the copy constructor/operator=. Make fU and fV private in Patch3D.

Make Sk3DView override View3D temporarily until Android can be switched
over to the new class.

(View3D from http://review.skia.org/291371)

I made Patch3D and Camera3D be private classes as they are
currently not used by Android and wanted to constrain the
exposed API as much as possible.

Change-Id: Ibde45478421feeb610e045205c3f20c0e5b1567e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532456
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-04-22 14:20:09 +00:00
Brian Salomon
072e09b26d SkCanvas::kStrict_SrcRectConstraint disables mipmapping.
The implementation is inconsistent across CPU and GPU.

CPU currently always implements kStrict even when kFast is passed.
For mipmapping this means computing a set of levels from the subset,
which is an expensive.

GPU limits the texture sampling coordinates to the subset in the
base level. However, higher level mipmap pixels that map back to
a footprint outside the subset are still sampled. So GPU pays a
higher shader complexity cost without really providing the benefit
of kStrict.

We are adding anisotropic filtering, which will not work well with
kStrict, and thus will also be disabled by kStrict.


Must land after https://chromium-review.googlesource.com/c/chromium/src/+/3571661

Bug: skia:10481
Bug: skia:13078
Bug: skia:13036
Canary-Chromium-CL: 3571661
Change-Id: I011b8698a3f9fafa9b819486873c8ff54df6299e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527284
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-06 17:11:47 +00:00
Brian Salomon
562e02ef4b Remove GrContextOptions::fSharpenMipmappedTextures
It was already a no-op.

Bug: skia:13078
Change-Id: I7c7e1a86650ebdbd79bfcc4c1e739a3901345e76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527836
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-05 21:33:50 +00:00
Brian Salomon
863bc82c62 Reland "Always apply mipmap sharpening on GPU"
This is a reland of commit 1aedd5dc11

Original change's description:
> Always apply mipmap sharpening on GPU
>
> Bug: skia:13078
>
> Change-Id: If459a96eba09fb10e967bc364435f79b83fdc1ec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522099
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13078
Change-Id: Ic05b38fc07566f090d609431f2738d64dfdc8a66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524218
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-04-01 17:53:28 +00:00
Brian Salomon
e679a08f9a Remove GrGLCreateNativeInterface
Bug: skia:13087
Change-Id: Ibaf7b223631a7282393cb670779a0a769bd0f86a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526301
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-31 19:01:34 +00:00
Brian Salomon
8bb0f47c61 Revert "Always apply mipmap sharpening on GPU"
This reverts commit 1aedd5dc11.

Reason for revert: breaking units tests left and right

Original change's description:
> Always apply mipmap sharpening on GPU
>
> Bug: skia:13078
>
> Change-Id: If459a96eba09fb10e967bc364435f79b83fdc1ec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522099
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13078
Change-Id: If24ed4782c922347132bf9fc0dac7e8a266540ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524296
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-24 13:56:27 +00:00
Brian Salomon
1aedd5dc11 Always apply mipmap sharpening on GPU
Bug: skia:13078

Change-Id: If459a96eba09fb10e967bc364435f79b83fdc1ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522099
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-23 19:47:39 +00:00
Brian Salomon
99c2b29cce Reland "Add glGetFloatv and glSamplerParameterf to GrGLInterface."
This is a reland of commit 171450a1a0

Original change's description:
> Add glGetFloatv and glSamplerParameterf to GrGLInterface.
>
>
> Bug: skia:13036
> Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: Id594ea5fd68c76703ff61d8414c203facbf28801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522359
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-21 16:34:43 +00:00
Leon Scroggins
74e0cf216e Revert "Add glGetFloatv and glSamplerParameterf to GrGLInterface."
This reverts commit 171450a1a0.

Reason for revert: Breaking Google3

Original change's description:
> Add glGetFloatv and glSamplerParameterf to GrGLInterface.
>
>
> Bug: skia:13036
> Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: I49fd1701b54d2144454b8e6a7ff948b85808409f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522357
Auto-Submit: Leon Scroggins <scroggo@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-18 19:13:37 +00:00
Brian Salomon
171450a1a0 Add glGetFloatv and glSamplerParameterf to GrGLInterface.
Bug: skia:13036
Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-18 15:23:11 +00:00
Kevin Lubick
27be14f2ca [includes] Prepare to remove SkColor<->SkImageInfo
This breaks out the SkAlphaType and SkColorType enums into
their own files, which lets us break the dependency between
SkColor and SkImageInfo.

It does not yet sever the link, but we plan to land this
so as to migrate clients to the new enum files if necessary.

This is estimated to save Chrome 230 MB of build size [1]
(about 0.1%) http://screen/4dMqPC9rvAyCk6y

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/chrome_includes_2022-03-08_182556.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkColor%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkColor%5C.h%24&included=&limit=1000

Change-Id: I331d414fe2996632ab11825c1092060ff5fe2ebd
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517678
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-09 18:40:44 +00:00
Robert Phillips
d6d3cabb49 Add maxSurfaceSampleCountForColorType to GrContextThreadSafeProxy
Change-Id: I7d98b2dff9fbb29bb9709c72679551473078fe0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513877
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-01 15:13:40 +00:00
Kevin Lubick
953c92880b Add SkRSXform to SK_API
Change-Id: I9ee142f949e644dcd06f359bb6838b5b4f04ec21
Bug: skia:12990
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513736
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-28 14:07:10 +00:00
Dominik Röttsches
01be94d7f1 Support font palette overrides through SkFontArguments
Co-authored with Ben Wagner, bungeman@google.com.

Similar to how we allow configuration of variable font configurations,
provide additional SkFontArguments to select a base palette and a set
of potentially sparse color overrides.

This is required for implementing CSS font-palette.

Modify the more_samples-glyf_colr_1.ttf to have two additional palettes,
and two additional test glyphs, one that draws with COLRv0 logic, one
that draws with COLRv1 logic and has a foreground palette index dot
in the middle. See [1] & [2] for the additions to the test font.

Add a GM which tests this on the SkFontMgr_custom using makeClone() and
makeFromStreamArgs(). The test displays the two glyphs in default
palette on the left, then with palette overrides (as in the title of the
test) on the right. The first row uses a typeface created with
makeFromStreamArgs(), the second uses one created with makeClone().

[1] https://github.com/googlefonts/color-fonts/pull/91
[2] https://github.com/googlefonts/color-fonts/pull/92

Bug: skia:12730, chromium:1170794
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_NativeFonts,Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts
Change-Id: Ia1334f069240edc78fd4791969914e8a6f4fbaf9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479616
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-17 13:19:53 +00:00
Brian Osman
40d7426345 Remove isOpaque from SkRuntimeEffect::makeShader signature
Bug: skia:12643
Change-Id: Id5eecb3445082e747def8c87f99a16552857af3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506462
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-11 16:05:01 +00:00
Leon Scroggins
37a7a19d50 Revert "Change default of skia_use_wuffs to true"
This reverts commit 281126dff3.

Reason for revert: Various bot failures

Original change's description:
> Change default of skia_use_wuffs to true
>
> Bug: skia:12921
>
> Skia is switching over completely to Wuffs. All known clients are
> already using Wuffs, so switch our development builds to Wuffs.
>
> Fix a clang warning building SkWuffsCodec.
>
> Change-Id: I24d676bcb514ff4c6657bedacc76c86898b9170c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505676
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Auto-Submit: Leon Scroggins <scroggo@google.com>

Bug: skia:12921
Change-Id: I5ba30ef07f5b2e194baee8808cbba68d5f04104c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505938
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2022-02-08 22:39:58 +00:00
Leon Scroggins III
281126dff3 Change default of skia_use_wuffs to true
Bug: skia:12921

Skia is switching over completely to Wuffs. All known clients are
already using Wuffs, so switch our development builds to Wuffs.

Fix a clang warning building SkWuffsCodec.

Change-Id: I24d676bcb514ff4c6657bedacc76c86898b9170c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505676
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2022-02-08 22:10:12 +00:00
John Stiles
7c1dafe51e Remove references to skstd::optional in Skia.
In this CL, Skia has been updated to use std::optional throughout.
skstd::optional continues to exist as a synonym for std::optional so
that Flutter does not break. The typedef will be removed in a few days,
once Flutter rolls into google3 have landed.

Original change's description:
> Revert "Reland "Remove skstd::optional entirely.""
>
> This reverts commit d161e2f6ec.
>
> Reason for revert: Need to wait for Flutter fix to roll into Google3.
>
> Original change's description:
> > Reland "Remove skstd::optional entirely."
> >
> > This reverts commit 98e51006b9.
> >
> > Flutter fix: https://github.com/flutter/engine/pull/31193
> >
> > Original change's description:
> > > Revert "Remove skstd::optional entirely."
> > >
> > > This reverts commit 17d0fc087c.
> > >
> > > Reason for revert: flutter still uses the skstd class
> > >
> > > Original change's description:
> > > > Remove skstd::optional entirely.
> > > >
> > > > Skia now uses C++17's std::optional.
> > > >
> > > > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > > Auto-Submit: John Stiles <johnstiles@google.com>
> > >
> > > Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> > > Auto-Submit: John Stiles <johnstiles@google.com>
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Brian Osman <brianosman@google.com>
> >
> > Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
>
> Change-Id: I8f89412292ba5dfe955c3f44c403c3c232cdad2b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503336
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Change-Id: I28ef3f543bf74de72645485698affb54921a50f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504176
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-04 15:03:16 +00:00
Greg Daniel
2a4a0b7f1f Reland "Add SkSurface resolve function."
This is a reland of d921f21fbc

Original change's description:
> Add SkSurface resolve function.
>
> This will insert a resolve msaa call into the stream of commands for
> the SkSurface. This is mostly useful for cases when a client wraps the
> resolve texture but has Skia draw with MSAA, and the client wants to
> make sure Skia resolves to their wrapped texture.
>
> Bug: chromium:1292418
> Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: chromium:1292418
Change-Id: I810b5618092c560f5bba900024b3b8c0c88baea9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503717
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-02-03 20:13:16 +00:00
Greg Daniel
27303250dd Revert "Add SkSurface resolve function."
This reverts commit d921f21fbc.

Reason for revert: New test breaking GL android bots

Original change's description:
> Add SkSurface resolve function.
>
> This will insert a resolve msaa call into the stream of commands for
> the SkSurface. This is mostly useful for cases when a client wraps the
> resolve texture but has Skia draw with MSAA, and the client wants to
> make sure Skia resolves to their wrapped texture.
>
> Bug: chromium:1292418
> Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: chromium:1292418
Change-Id: I86e5f82f0e2a0921906c0caba964929750500965
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503350
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-02 21:26:13 +00:00
Greg Daniel
d921f21fbc Add SkSurface resolve function.
This will insert a resolve msaa call into the stream of commands for
the SkSurface. This is mostly useful for cases when a client wraps the
resolve texture but has Skia draw with MSAA, and the client wants to
make sure Skia resolves to their wrapped texture.

Bug: chromium:1292418
Change-Id: I6eddae967136716b9215fcd96e7d77a2457efdf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-02-02 19:55:40 +00:00
Brian Osman
73262111f5 Revert "Reland "Remove skstd::optional entirely.""
This reverts commit d161e2f6ec.

Reason for revert: Need to wait for Flutter fix to roll into Google3.

Original change's description:
> Reland "Remove skstd::optional entirely."
>
> This reverts commit 98e51006b9.
>
> Flutter fix: https://github.com/flutter/engine/pull/31193
>
> Original change's description:
> > Revert "Remove skstd::optional entirely."
> >
> > This reverts commit 17d0fc087c.
> >
> > Reason for revert: flutter still uses the skstd class
> >
> > Original change's description:
> > > Remove skstd::optional entirely.
> > >
> > > Skia now uses C++17's std::optional.
> > >
> > > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > Auto-Submit: John Stiles <johnstiles@google.com>
> >
> > Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
>
> Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I8f89412292ba5dfe955c3f44c403c3c232cdad2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503336
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-02 16:49:05 +00:00
Evgenii Kliuchnikov
0dae2e870d Add MVP implementation of JPEGXL decoder.
Change-Id: I90140348eeb87c849a857a12008c201efc9e328d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482596
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-02 15:17:14 +00:00
John Stiles
d161e2f6ec Reland "Remove skstd::optional entirely."
This reverts commit 98e51006b9.

Flutter fix: https://github.com/flutter/engine/pull/31193

Original change's description:
> Revert "Remove skstd::optional entirely."
>
> This reverts commit 17d0fc087c.
>
> Reason for revert: flutter still uses the skstd class
>
> Original change's description:
> > Remove skstd::optional entirely.
> >
> > Skia now uses C++17's std::optional.
> >
> > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> Auto-Submit: John Stiles <johnstiles@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-02 14:59:45 +00:00
John Stiles
074a016b89 Remove skstd::string_view entirely.
We now use std::string_view throughout. SkStringView.h has been moved to
include/private/ and is only used for our C++20/23 compatibility methods
(starts_with/ends_with/contains).

Change-Id: I961842c6778256a03868e7602d48add34f420763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502306
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-01 21:16:41 +00:00
John Stiles
2cf4863add Upgrade from C++14 to C++17.
Change-Id: Ib11a528f41a4a1d5d8eb4c11ff95d88a50f019ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500898
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-27 15:58:10 +00:00
Brian Osman
576de89810 Add support for multiple child nodes to SkImageFilters::RuntimeShader
Bug: skia:12766
Change-Id: I9dfe07a71961ab952c1593b9cc68c61191fbc13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489536
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-05 20:07:00 +00:00
Brian Osman
2f2977e19d SkSL: Add color transform intrinsics
These convert a color between the working color space and a known,
useful space (linear TF, sRGB gamut).

Bug: skia:10479
Change-Id: I3308e691beeaca5120ed0c2e30cf08661caa3684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481416
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-28 14:05:49 +00:00
Brian Osman
ca916f705f Remove canvas marker stack, marked matrices, etc...
This entire API existed, but was unused (no longer connected to
drawVertices or runtime effects).

In theory, we could further simplify some of the matrix providers, but
more importantly - I have serious doubts about the correctness of
localToDeviceHitsPixelsCenters for most of them.

Change-Id: If5af182015dd96e5ed3353a117223e8dbbe17097
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481683
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-09 16:22:16 +00:00
Brian Osman
386ddd2ec7 Add SkImage::makeRawShader to RELEASE_NOTES
Change-Id: I34063f4d84472ddae57b244ab424d859dd3bcf00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480418
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2021-12-06 19:23:51 +00:00
Derek Sollenberger
0612b52174 Reland "Add public API support for SkImageFilters::RuntimeShader"
This new image filter constructor enables SkRuntimeEffects to be
used as shaders within the ImageFilter DAG. The shader is created
lazily using the SkRuntimeShaderBuilder enabling the resulting
shader to consume the previous stage of the ImageFilter graph.

This relands commit ad9d774c1f after
fixing the threading issue found by the TSAN bot.

Change-Id: I06dc4cf6a304b14804c55531a5bc3f2afa34e219
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477156
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-29 22:23:26 +00:00
Leandro Lovisolo
5f4055d03d Revert "Add public API support for SkImageFilters::RuntimeShader"
This reverts commit ad9d774c1f.

Reason for revert: Task Test-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-DDL3_TSAN has been failing since this CL landed.

Original change's description:
> Add public API support for SkImageFilters::RuntimeShader
>
> This new image filter constructor enables SkRuntimeEffects to be
> used as shaders within the ImageFilter DAG. The shader is created
> lazily using the SkRuntimeShaderBuilder enabling the resulting
> shader to consume the previous stage of the ImageFilter graph.
>
> Change-Id: I5d6917e34a8e5fdd053399f15a1e2cc7409e686f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470459
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

Change-Id: I0367a5c480df109c6116eb168792fe3c2fc58807
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475644
Auto-Submit: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
2021-11-23 20:58:15 +00:00
Derek Sollenberger
ad9d774c1f Add public API support for SkImageFilters::RuntimeShader
This new image filter constructor enables SkRuntimeEffects to be
used as shaders within the ImageFilter DAG. The shader is created
lazily using the SkRuntimeShaderBuilder enabling the resulting
shader to consume the previous stage of the ImageFilter graph.

Change-Id: I5d6917e34a8e5fdd053399f15a1e2cc7409e686f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470459
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2021-11-23 15:08:42 +00:00