Commit Graph

3077 Commits

Author SHA1 Message Date
Herb Derby
fae2cc3b80 use flatten/unflattend Slugs to draw
This CL using GPU draws every TextBlob by converting it to a
Slug, flattening the Slug, unflattening the Slug to a dstSlug,
and then uses the dstSlug to draw the TextBlob.

Since only DirectMask sub runs are working I have disabled some
code to all empty sub runs. This will be restored in the final
version.

This adds a compile-time flag to control this behavior:
SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_SERIALIZE

Bug: chromium:1278340

Change-Id: I7674593b0d6e1f871e1c526af76407a1977a8836
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510419
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-02-18 15:11:22 +00:00
Jim Van Verth
d6245fc4aa Rename GrSwizzle to skgpu::Swizzle
Bug: skia:12845
Change-Id: Ia03293c4efdad4c5381a713c9d7d4857b79530c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509398
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-02-16 13:30:14 +00:00
Herb Derby
2a24e6554b Revert "redo AtlasTextOp caching"
This reverts commit 3530d4d3c3.

Reason for revert: Use after free: context deleted before ops

Original change's description:
> redo AtlasTextOp caching
>
> The fuzzer ash_unittests is passing GrRecordingContext from thread
> to thread. This means that 120 bytes for a AtlasTextOp bytes are
> leaking on the first thread because the ClearCache is never
> called on that thread.
>
> Move the cache to the GrRecordingContext. Use a thread local to
> store a pointer to the GrRecordingContext so that new and delete can
> find the cache.
>
> Add a field to AtlasTextOp to save the recording context so that it can
> populate the thread local just before delete is called.
>
> Bug: chromium:1265033
>
> Change-Id: I9802910428bf091c534c96d4ce729c3b3445c76b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497147
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Bug: chromium:1265033
Change-Id: Ia51ad196cf2966225b177f799d477e1f705187c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498616
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-01-24 15:59:48 +00:00
Herb Derby
3530d4d3c3 redo AtlasTextOp caching
The fuzzer ash_unittests is passing GrRecordingContext from thread
to thread. This means that 120 bytes for a AtlasTextOp bytes are
leaking on the first thread because the ClearCache is never
called on that thread.

Move the cache to the GrRecordingContext. Use a thread local to
store a pointer to the GrRecordingContext so that new and delete can
find the cache.

Add a field to AtlasTextOp to save the recording context so that it can
populate the thread local just before delete is called.

Bug: chromium:1265033

Change-Id: I9802910428bf091c534c96d4ce729c3b3445c76b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497147
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-01-24 15:15:24 +00:00
Zhou Shuangshuang
78cec092bf Enable MSAA for Intel 12th Gen gpus
Bug: skia:12790

Change-Id: If320420809abe090cbcb19c4c7cd9b72cd5daa31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492316
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-01-20 15:09:16 +00:00
Sergey Ulanov
119fb6bb25 Add support for GL_ANGLE_rgbx_internal_format format
Angle/Vulkan added GL_ANGLE_rgbx_internal_format extension for RGBX
texture format. Add support for that format in Skia.

Bug: chromium:1261867, chromium:1269826, angle:6690
Change-Id: I74fc91699dc1eaf2b275b29fbcf3d4060e63c5a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485157
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-01-13 22:47:21 +00:00
Kevin Lubick
96e4053be7 Update Bazel files
- Use latest emscripten toolchain (3.1.0)
 - Autogenerate the atoms and manually fix some of the file lists.
 - Add a known_good_builds target to bazel/Makefile to help
   check the things we expect to work with Bazel.

Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-06 18:10:57 +00:00
Greg Daniel
cdeb092655 [graphite] Move GrProcessorKeyBuilder to generic skgpu::KeyBuilder class.
This also allows the KeyBuilder class to be used in Graphite. In Graphite
I plan to use it for other keys besides building up shaders/processors
so I dropped that from the name. There was nothing special abouts its
implementation that made it specific to Processors anyways.

Bug: skia:12754
Change-Id: I1b25730b061f9342b61e3b2e4ac43328b8074d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-20 20:41:17 +00:00
Herb Derby
5d6e51dbec remove SK_EXPERIMENTAL_ADD_ATLAS_PADDING from Skia
As of the following Chromium CL the flag
SK_EXPERIMENTAL_ADD_ATLAS_PADDING is no longer used.

https://chromium-review.googlesource.com/c/chromium/src/+/3332838

Change-Id: I026b736dc26268fbe888fd3a8b56d056f4127e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483597
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-13 18:52:03 +00:00
Herb Derby
8dc9a337ab rename GrTextBlobCache to GrTextBlobRedrawCoordinator
Change-Id: Ib1ea2936f7a9431bc62c04b1931cf6da2c213b36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483496
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-13 17:38:00 +00:00
Jim Van Verth
db9f95c888 Move ShaderUtils out of Ganesh.
This will allow us to use ShaderUtils in both Ganesh and Graphite.

Change-Id: I78e34c4eb969a0d827c459d7fb945d17fdc22efa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482696
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-12-10 23:10:25 +00:00
Herb Derby
c279e7640b add bilerp atlas support flag
Move the compile-time flag SK_EXPERIMENTAL_ADD_ATLAS_PADDING,
to a runtime flag in GrContextOptions.

Bug: chromium:1275890

Change-Id: I7e051cd4834ac44958b1431976535519e8bdaa3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482416
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-12-10 20:33:57 +00:00
Kevin Lubick
9488e0237d [infra] Experiment generating BUILD.bazel files
This uses the gazelle extension from
https://skia-review.googlesource.com/c/buildbot/+/473357

Review Tips:
 - Ignore any changes to .h or .cpp files. Those have been
   pulled out into their own CLs.
 - Start with bazel/macros.bzl.
 - Read the CL with the generation code, if you haven't already.
 - Look at third_party/file_map_for_bazel.json.
 - See experimental/bazel_test for an idea of how a cc_binary
   would be made.
 - Spot check one or two of the BUILD.bazel files.

This CL generates the "atomic" rules for src/, include/ and
modules/skshaper, as a starting point.

`bazel build --config clang //include/...` works

`bazel build --config clang //src/...` starts compiling,
(which verifies that the BUILD.bazel files are all valid),
but runs into errors because not all third_party deps have
been resolved, and there are some files missing from the
toolchain still (e.g. EGL headers).

Change-Id: Ib7e0fb0efdb9f08655f06cbc56e9bb4cf416294b
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474240
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-23 18:53:16 +00:00
Greg Daniel
2211c2c4bd Store whether or not a VkImage is from a swapchain and return it in drawable info.
This is done for webview which needs to know whether it is drawing
directly into the main window surface or in a layer.

Change-Id: I0a3f6f81bcf65907f9d51651035bae912c3a34ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468616
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-11-16 21:14:59 +00:00
Brian Salomon
384ba65b8d Remove GPU V2
Replaced by Graphite.

Change-Id: Iac0ba212b078904a591677c9ce839a90562d0240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470305
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-11-11 17:11:19 +00:00
Kevin Lubick
1f8c31b101 [infra] Add initial Bazel rules and files
These rules can be used to build our GMs on WASM+WebGL and
libskia.a with just the CPU backend (and most other features
turned off).

This can be done with the following commands:
  - bazel build //modules/canvaskit:gm-bindings-wasm --gpu_backend=gl_backend --with_gl_standard=webgl_standard
  - bazel build :skia-core --config clang

This pivots slightly from http://review.skia.org/463517
by using config_settings [1] instead of platforms for
the optional features that we control. This pivot was
suggested in [2]

We have BUILD.bazel files in many of the subdirectories
that specify filegroups for the appropriate files. In
an effort to make //BUILD.bazel more readable, it is
the responsibility of these subfolders to deal with
conditionally including certain .h or .cpp files.
This is done using select statements and config_settings
or platform constraints as necessary.

For example, src/gpu/BUILD.bazel will different private
filegroups for each of the supported gpu backends [3]
and a more-visible filegroup called "srcs" that has
the right selection of the private files to be used
for compilation.

An effort has been made to avoid using glob() in our
BUILD.bazel files. These file lists were made by using
`ls -1` and some regex to add in quotes. We might want
to make a helper script to assist with that, if necessary.

To specify which options we have, the settings in
//bazel/common_config_settings/BUILD.bazel have been
redesigned. They make use of a macro `string_flag_with_values`
that removes the boilerplate. Patchset 36 shows what the
file looks like w/o the macro.

The top level BUILD.bazel file will still need to use
some logic to handle defines, because local_defines is
a list of strings, not a list of labels [4].

Suggested Review Order:
  - WORKSPACE.bazel to see the new dependencies on the
    emsdk toolchain and bazel_skylib
  - bazel/common_config_settings/* to see the few settings
    defined (we have more to define, see BUILD.gn and
    //gn/skia.gni for ideas)
  - BUILD.bazel to see the "skia-core" cc_library rule.
    See also "gms" and "tests"
  - modules/canvaskit/BUILD.bazel to see the use of
    the emscripten "wasm_cc_binary" rule, which depends
    on the "skia-core", "gms", and "tests" rule. Note that
    it only builds some of the gms as a proof of concept.
  - The other BUILD.bazel files. Some of these are not
    platform or feature dependent (e.g. pathops). Others
    are (e.g. gpu).
  - All other files.

[1] https://docs.bazel.build/versions/4.2.1/skylark/config.html#user-defined-build-settings
[2] https://github.com/emscripten-core/emsdk/pull/920
[3] In this CL, that's just the webgl one.
[4] https://docs.bazel.build/versions/main/be/c-cpp.html#cc_library.local_defines

Change-Id: Ieecf9c106d5e3a6ae97d13d66be06b4b3c207089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458637
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2021-11-09 12:32:25 +00:00
Kevin Lubick
7b426f5f14 Add #ifdefs to GrBackendSemaphore to guard includes and methods
Change-Id: Ia969cda749fe15df645300248e0f17d3e4b77215
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466438
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-11-05 17:58:32 +00:00
Kevin Lubick
afa657d6ab Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
This is a more cautious attempt of https://skia-review.googlesource.com/c/skia/+/464876

GrAlignTo renamed to SkAlignTo and moved to SkTypes.h
(with the rest of our align helpers).

GR_MAKE_BITFIELD_OPS and GR_DECL_BITFIELD_OPS_FRIENDS
renamed to SK_* and moved to private/SkMacros.h

This avoids our public includes using a src header file
and messing with SkUtils.h, which apparently was used
by Android. That should be cleaned up in a separate effort.

Change-Id: I86d5e1fb6a7834034534266a6c340bc7757f9abb
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466176
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-01 17:26:59 +00:00
Greg Daniel
b3ecd560a2 Revert "Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files"
This reverts commit 65a726bb49.

Reason for revert: You cannot include a src file in an include file. This ends up using c++17 features in our includes. Breaks rolls.

Original change's description:
> Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
>
> These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
> because nothing seemed particularly GPU/Ganesh specific to them.
>
> I moved the latter to SkTypes.h because we have other align
> code there and former to src/SkUtils.h because I didn't know
> where else it should go.
>
> The primary motivation was removing the GrTypesPriv.h
> include from src/core/SkBlockAllocator.h. I had attempted
> some amount of #if SK_SUPPORT_GPU, but that's not as clean
> here because both our CPU and GPU backends use the
> SkBlockAllocator (as far as I could tell).
>
> This also moves sk_memset* from SkUtils.h to SkOpts.h, because
> SkOpts.h requires bringing in RasterPipeline, which seemed
> like overkill.
>
> Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
> Bug: skia:12584
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:12584
Change-Id: I1b772bbbc6f150d737bb53fa4e5f45d1581929fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465376
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>
2021-10-29 12:50:09 +00:00
Kevin Lubick
65a726bb49 Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
because nothing seemed particularly GPU/Ganesh specific to them.

I moved the latter to SkTypes.h because we have other align
code there and former to src/SkUtils.h because I didn't know
where else it should go.

The primary motivation was removing the GrTypesPriv.h
include from src/core/SkBlockAllocator.h. I had attempted
some amount of #if SK_SUPPORT_GPU, but that's not as clean
here because both our CPU and GPU backends use the
SkBlockAllocator (as far as I could tell).

This also moves sk_memset* from SkUtils.h to SkOpts.h, because
SkOpts.h requires bringing in RasterPipeline, which seemed
like overkill.

Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-28 18:18:47 +00:00
Greg Daniel
e82c1c11bc Add support for vk drm format modifiers.
On linux we need to support drm format modifiers on vulkan images. When
we have a modifier it can restrict the allowed usages/features of the
VkImage.

The current use case we have for images coming into skia that have
these modifiers are from video decoders. All these images are only used
as sampled images in draws and they have no filtering applied.
Therefore, for now, instead of tracking all format and modifier pairs
to know what is supported, we internally set these images to be external
which already restricts their use to basic in shader sampling.

Additionally in chrome, all these images are coming in ycbcr conversions
already which we treat as external.

Bug: skia:12336
Change-Id: I59a564f937f49a6d906efe954b24cebe5c7470ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441298
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-10-26 18:22:07 +00:00
Greg Daniel
77435597fa Add memoryless attachment support for vulkan dmsaa.
For this initial landing, we actually have the memoryless support
disabled because we need to update Chrome's vk memory allocator to
handle the new lazy flag added in this CL. Otherwise we will fail to
make dmsaa attachments and not draw anything.

I tested this on ARM and the it does look to keep the size of all the
lazy msaa attachments at 0. I test with both 4 and 8 sample counts. To
confirm the size check, I changed the store op on the msaa attachments
from discard to store and the reported memory size did grow.

Bug: skia:11809
Change-Id: I977f337b922cdbdbce16d67945369246e3547c17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451296
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-09-22 19:06:02 +00:00
Greg Daniel
84261653c5 Reland "Add new GrSurfaceInfo class and related backend structs."
This is a reland of 6aac1193a7

Original change's description:
> Add new GrSurfaceInfo class and related backend structs.
>
> Bug: skia:12402
> Change-Id: I45b2f71dcfa5843e2a19a8de7d34196a4d552905
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445176
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:12402
Change-Id: Id540bea408d72ceba43ec4245c3748d630121926
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450277
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-09-20 20:44:53 +00:00
Jim Van Verth
2f7ee02577 Revert "Add new GrSurfaceInfo class and related backend structs."
This reverts commit 6aac1193a7.

Reason for revert: Breaking Mac bots in Chromium roll. Looks like
they depend on getVkImageInfo for an unknown reason, and it's 
hidden behind SK_VULKAN.

Original change's description:
> Add new GrSurfaceInfo class and related backend structs.
>
> Bug: skia:12402
> Change-Id: I45b2f71dcfa5843e2a19a8de7d34196a4d552905
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445176
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:12402
Change-Id: I3c9642354dae8c955bc58d281700536393f84519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450199
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-09-18 16:35:38 +00:00
Greg Daniel
6aac1193a7 Add new GrSurfaceInfo class and related backend structs.
Bug: skia:12402
Change-Id: I45b2f71dcfa5843e2a19a8de7d34196a4d552905
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445176
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-09-18 00:41:07 +00:00
Robert Phillips
de60d7a64d Move more classes to skgpu::v1 namespace
Bug: skia:11837
Change-Id: If0bfb3009693b203b2080a1d43cc3b1865c3ab9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448274
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-15 15:20:24 +00:00
Greg Daniel
0e32aa8a3a Rename some GrD3DTypes* header files.
I want to free up GrD3DTypesPriv to actually be private types that
include real d3d objects.

Change-Id: Id38d6baae4fa68c19301b27d4f9d51eb1d9c5db0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443676
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-31 18:49:46 +00:00
Brian Osman
99ddd2a98d Remove (unused) geometry shader support
Bug: skia:8451 skia:10827
Change-Id: I5b38a1d72cd4558f8e2a92aaf9b12f05efce0923
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442683
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-27 19:41:10 +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
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
Robert Phillips
1c512239ff Make compressedBackendFormat accessible from GrContextThreadSafeProxy
Not having this available on GrContextThreadSafeProxy was an oversight.
This will allow Chrome to correctly prepare the correct type of compressed promise image.

Change-Id: I3002609fef00a130fe409f318ae0f442ef7591d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437016
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-05 21:44:11 +00:00
Robert Phillips
ea3489aa1d Make Gr*ContextPriv class hierarchy parallel Gr*Context class hierarchy
Hopefully this will make it easier to add functionality to the Gr*ContextPriv classes.

This CL is mainly mechanical but did turn up some oddities:

GrDirectContext had a separate 'fShaderErrorHandler' member and a matching GrDirectContextPriv::getShaderErrorHandler method. This now falls back to GrBaseContextPriv::getShaderErrorHandler.

GrDirectContext::resetContextStats was const.

GrRecordingContextPriv's dump and dumpKeyValuePairs methods weren't const.

GrImageContextPriv::abandoned was const. GrImageContext::abandoned is not (bc GrDirectContext can abandon inside abandoned).

Change-Id: I25bb2160031de329d514b30c05752f1bdd1d5339
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435716
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-03 14:59:04 +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
Robert Phillips
a92913e169 Make GrAuditTrail V1-only
This CL has some rough edges since some classes that use it (e.g., GrOpsTask) aren't yet V1-only. That said, the big CL has to be broken up somehow.

Bug: skia:11837
Change-Id: I41ed9982ca4664f893e447ba23c7aec59f42c964
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426416
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-13 13:56:53 +00:00
Robert Phillips
5e1aa8b665 Misc skgpu cleanup
This CL:
  finishes off some renaming I missed earlier
  removes some extraneous #includes from headers

TBR=bsalomon@google.com
Bug: skia:11837
Change-Id: If7163435a44d4067dac041a7f9e68b1ad63432d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426037
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-09 15:06:16 +00:00
Greg Daniel
0b04b6b16f Reland "Fix texture barriers on DMSAA"
This reverts commit 9a2d3d1e19.

Reason for revert: relanding with fix

Original change's description:
> Revert "Fix texture barriers on DMSAA"
>
> This reverts commit 1a3f4ab490.
>
> Reason for revert: breaking dmsaa test on intel hd405, https://ci.chromium.org/raw/build/logs.chromium.org/skia/54538c41f1c1b111/+/annotations
>
> Original change's description:
> > Fix texture barriers on DMSAA
> >
> > Bug: skia:11396
> > Change-Id: Iad74958c05ed086fe85656b9dc5418d5ab4589e7
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419838
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Chris Dalton <csmartdalton@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
>
> Change-Id: I8be8107a98584dfb7f831a296078753fecfcebcf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11396
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421056
> 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:11396
Change-Id: I6c65a3639e87b32a30774f33445bb3174a4fdffa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421058
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-06-25 01:35:42 +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
Greg Daniel
9a2d3d1e19 Revert "Fix texture barriers on DMSAA"
This reverts commit 1a3f4ab490.

Reason for revert: breaking dmsaa test on intel hd405, https://ci.chromium.org/raw/build/logs.chromium.org/skia/54538c41f1c1b111/+/annotations

Original change's description:
> Fix texture barriers on DMSAA
>
> Bug: skia:11396
> Change-Id: Iad74958c05ed086fe85656b9dc5418d5ab4589e7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419838
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I8be8107a98584dfb7f831a296078753fecfcebcf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421056
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-06-23 22:36:20 +00:00
Greg Daniel
1a3f4ab490 Fix texture barriers on DMSAA
Bug: skia:11396
Change-Id: Iad74958c05ed086fe85656b9dc5418d5ab4589e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419838
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-06-23 19:30:38 +00:00
Adlai Holler
4ff6072351 Enable reduceOpsTaskSplitting by default
Chrome does not rely on the default – this option is under a finch trial
named "ReduceOpsTaskSplitting." See crbug.com/1210578.

Android does not rely on the default – the flag is controlled by a
property named "renderthread.skia.reduceopstasksplitting", and enabled
by default. See b/183612348.

Flutter does not rely on the default – they explicitly disable the
option. See https://github.com/flutter/engine/pull/26568.

Our tools do not rely on the default – they enable the flag unless the
user passes --dontReduceOpsTaskSplitting on command line. Our bots
run with the flag enabled except the NUC5PPYH, for the sake of coverage.

The flag has no effect for Adreno 620 and 640, on drivers older than
v571, due to a driver bug.

Bug: skia:10877
Change-Id: Iafc84f3463194f0cf6cf135b2be05ec8eb08e446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419836
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-06-21 16:32:13 +00:00
Kevin Lubick
be03ef1565 Remove ableist language
Change-Id: Ie9ef50a14906c9350adbe16720291dca944ad7fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418738
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-16 21:37:21 +00:00
Peter Kasting
95b00157a4 Fix -Wc++11-narrowing for Skia.
Bug: chromium:1216696
Change-Id: I11221c55e2d64c1b47082e36aa44637c411f426f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417116
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-06-15 17:49:08 +00:00
Robert Phillips
fa0e5bc2d2 Actually make GrContextOptions::fUseNGA GR_TEST_UTILS-only
I accidentally left this out of:

https://skia-review.googlesource.com/c/skia/+/415796 (Add option to switch between OGA and NGA SkGpuDevices)

Bug: skia:11837
Change-Id: I49730b1f338f081512a7fca2d0ca6e1d4cf086be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417536
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-15 12:58:33 +00:00
Michael Ludwig
9d1cc05100 Add scratch-only version of performDeferredCleanup
Change-Id: I5707d1da1b69ab1ffaa77d7a391a187ac3e8eba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417267
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-06-10 18:13:23 +00:00
Brian Salomon
dc03537758 Reland "Limit ANGLE PBO workaround to blocking use of GL_UNPACK_ROW_LENGTH"
This is a reland of 7788b3a62f

Original change's description:
> Limit ANGLE PBO workaround to blocking use of GL_UNPACK_ROW_LENGTH
>
> Previously we blocked all PBO->texture transfers.
>
> Bug: angleproject:5542
>
> Change-Id: I1decfbc9293c03da125716c73e6d635e2ab9cb1d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406997
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: angleproject:5542
Change-Id: Id2474a47bdab368d36ddfbed335a8c58d5567fad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416477
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-06-07 18:23:17 +00:00
Robert Phillips
516405c5b0 Add option to switch between OGA and NGA SkGpuDevices
Bug: skia:11837
Change-Id: Id52f05a055c97cd2644bc70d600e9313766f6730
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415796
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-07 15:23:40 +00:00
Chris Dalton
fc8cf91cee Revert "Limit ANGLE PBO workaround to blocking use of GL_UNPACK_ROW_LENGTH"
This reverts commit 7788b3a62f.

Reason for revert: May be the cause of TransferPixelsToTextureTest failures

Original change's description:
> Limit ANGLE PBO workaround to blocking use of GL_UNPACK_ROW_LENGTH
>
> Previously we blocked all PBO->texture transfers.
>
> Bug: angleproject:5542
>
> Change-Id: I1decfbc9293c03da125716c73e6d635e2ab9cb1d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406997
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: angleproject:5542
Change-Id: I5f1047e110aebe36800a7f807dba832ba27a8b3d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416056
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-06-07 12:49:21 +00:00
Nathaniel Nifong
a306dbf5db Allow reduced shader mode to be enabled outside tests.
Bug: b/187535297

Change-Id: I221319713beebc2fdf67fc7d9d2536563f4ba8a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415760
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2021-06-04 20:50:07 +00:00