Commit Graph

11834 Commits

Author SHA1 Message Date
Peter Boström
cd938c5b0f Fix some prevent_unsafe_narrowing warnings
These changes reduce failing targets for skia_unittest when adding
"//build/config/compiler:prevent_unsafe_narrowing" to component("skia")
from 588 to 484 on my local Mac build.

Bug: chromium:1292951
Change-Id: Ice8210e1a2f038feb84184c88e6a34f52168952f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552376
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2022-07-14 17:31:01 +00:00
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
Kevin Lubick
372a39c91d [canvaskit] Expose more ImageFilters
Notes to reviewer:
 - modules/canvaskit/npm_build/types/canvaskit-wasm-tests.ts
   is not actual test code that is executed. It is parsed with
   our types (index.d.ts) only, as a way to make sure the
   declared types match up with how one would write code.
 - MakeDisplacementMap looked a bit strange when I tried to
   use it. It might be easiest to debug if we land as is,
   so we can use jsfiddle to test dynamic parameters.
 - modules/canvaskit/package-lock.json was updated by running
   npm audit fix.
 - There are two copies of the test cases, one for the old
   way, and one for Bazel. Getting Bazel on the CI is currently
   blocked (http://review.skia.org/547576)
 - I am adding all the image filters in by default for now,
   we can measure code size and adjust them if needed later.

Change-Id: I2f4eae71de7ee5d53f0c74147d0662f156522d18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555596
Owners-Override: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2022-07-12 17:36:52 +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
Benoît Lizé
916351bd6e [core] Allow SkArenaAlloc to query malloc() for usable size
When allocating memory with malloc(), allocators can provide a larger
size than requested. SkArenaAlloc tries to guess what jemalloc would
return, and align its allocation requests on the to-be-provided
size. Some platforms (e.g. glibc or bionic with malloc_usable_size(),
macOS with malloc_size()) can provide the actual value.

This CL adds support to skia's malloc() wrappers to get this data, and
to SkArenaAlloc to use it. Note that as is, this is a no-op in skia
proper. Indeed, clients can (and do, for instance Chromium does)
override sk_malloc() (and friends), so Skia cannot assume that
sk_malloc() memory comes from malloc().

To implement this, a client needs to override sk_malloc_usable_size() to
return the actual value.

Bug: chromium:1335342
Change-Id: Id8ea177e9adccc9c4446fe379b6f05e726ea07ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549516
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2022-07-12 16:08:14 +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
John Stiles
1f617a6716 Replace enforceES2Restrictions with a max-version setting.
SkSL versioning was originally based on a binary "strict ES2" versus
"everything else" split, but now we have an SkSL::Version enum which
gives us more fine-grained control.

Change-Id: Ic7e26381cc3c4c1868bd6ee48d4f44d704dae119
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557378
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-07-12 14:25:21 +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
John Stiles
bd472a01ed Move runtime-effect dictionary into Graphite ResourceProvider.
Putting the dictionary in the Recorder itself was not very useful; the
recorder is inaccessible throughout the call chain of pipeline setup.
The ResourceProvider, on the other hand, is accessible everywhere we
need it, hangs directly off the Recorder, and has the right lifetime
for our purposes.

Change-Id: I0f494e5890845d73343a71359900598d63b66764
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556917
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-07-08 20:29:38 +00:00
John Stiles
ca7657b093 Remove RuntimeShader built-in snippet ID.
This has been replaced by findOrCreateRuntimeEffectSnippet.

Change-Id: I26e1f85c74071b14b75ab86410e4cc30a81bf873
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552716
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-07-08 14:18:19 +00:00
Aditya Kushwah
cb44bf6246 Label external texture.
Pass an optional label parameter to GrBackendTexture and pass
it to MakeWrapped of GrGLTexture because almost all textures
that are coming clients are things where the client owns the
gl texture and passes it into Skia as a wrapped texture via a
GrBackendTexture.

Bug: chromium:1164111
Change-Id: I4bfddda956c72b53d0070595ef3268ee1a2b747f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555597
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-07-07 19:20:59 +00:00
Kevin Lubick
68d6ff9222 [includes] Reduce IWYU exports from SkTypes.h
SkTypes.h was found exporting <stddef.h> and <stdint.h>.
Thus if a Skia file includes SkTypes.h, it did not need
to include either of those files to use things like
size_t or uint8_t respectively. [1]

This also resulted in strange IWYU warnings like:
warning: size_t is defined in "include/core/SkTypes.h", which isn't directly #included.

Thus, this CL removes those additional exports, and as a result,
adds many more includes of <cstddef> and <cstdint>.

The second change this CL is to not use the default IWYU
mappings which are hard-coded into IWYU [2]. These defaults
are valid, but make suggestions for the C version of
headers and not the C++ ones (i.e. <stddef.h> over <cstddef>).

To make these recommendations align better with our preferred
style (the C++ ones), we use IWYU with --no_default_mappings
and then have to expand our existing mappings to better deal
with how IWYU would resolve some of these headers.

[1] https://codereview.chromium.org/1207893002/#msg49
[2] 4c0f396159/iwyu_include_picker.cc (L1221-L1234)

Change-Id: Iafebe190f8f3e86f252147b9f538c182bcc34af4
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555516
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-07-06 14:52:55 +00:00
Brian Salomon
b2e4416a6b Update SkMesh buffer API to take const void* instead of SkData
Also expose a size() function on the public IB and VB types.

Bug: skia:12720
Change-Id: Ibeccf6d2d6ba411e9e77be582d0cb1622bc76ccd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/555005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-07-01 20:07:57 +00:00
Michael Ludwig
9d82f9e4b8 [graphite] Add more utility and SkM44/SkMatrix interop to Transform class
Change-Id: I028bd133778d14edcb22ccef0c35c5a8e3d7d552
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554516
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-07-01 15:00:22 +00:00
Peng Huang
1b075ff14e Add StrikePinner::assertValid() to diagnose cache missing problem
Bug: chromium:1316352
Change-Id: I54e50592fe5fc97a83e1ed7e40c92b98834bf331
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554337
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-07-01 13:01:21 +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
Greg Daniel
bf65800589 [Graphite] Store Task Graph on Recording.
Bug: skia:13357
Change-Id: Ib2566e9c38f667368b20f18ed2b1851615602cad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548480
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-29 20:42:49 +00:00
Robert Phillips
c0cd71d4fd [graphite] Add compile guards to precompile system (take 2)
Bug: skia:13430
Change-Id: I64d6049fec8cc942a8f7c56c01ba292cc8f3835c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554378
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-29 19:37:15 +00:00
Ethan Nicholas
4d378b4b9f Added threadgroup modifier to compute shaders
Change-Id: I3a244bcd25994217d5107de98c24c144f2dabdf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543076
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-06-29 18:06:28 +00:00
Herb Derby
eabb1067e9 Replace SK_ARRAY_COUNT with std::size() for skia/src/gpu
Change-Id: I9451a06f43de66727b9562a29eea7b838175712b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554336
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-06-29 15:57:58 +00:00
Kevin Lubick
187340c89e Revert "[graphite] Add compile guards to precompile system"
This reverts commit 1da712adda.

Reason for revert: Breaking G3

Original change's description:
> [graphite] Add compile guards to precompile system
>
> Bug: skia:13430
> Change-Id: I6c577b459bc3a699e6c660d21d2b119643fe1f88
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553877
> Reviewed-by: Eric Boren <borenet@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

Bug: skia:13430
Change-Id: I2fd518c9b7950e362e8c27cc74811f840887c7fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554377
Owners-Override: Kevin Lubick <kjlubick@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-06-29 14:58:21 +00:00
Robert Phillips
1da712adda [graphite] Add compile guards to precompile system
Bug: skia:13430
Change-Id: I6c577b459bc3a699e6c660d21d2b119643fe1f88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553877
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-06-29 13:48:45 +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
John Stiles
2b7f32a725 Add map from code-snippet ID to runtime-effect in Recorder.
This will keep the runtime effect alive and findable until we are ready
to paint it.

Change-Id: If047dfa8be1376a7a2a092211e0cbbdedfd2faf0
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553579
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-06-28 21:13:29 +00:00
John Stiles
4db16d754e Remove unchecked_bit_puns.
We are on C++17 now and already use `if constexpr` where necessary.

Change-Id: Icc780b6e4db7ae6ccc648ea333a172f11bf0581c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553584
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-06-28 19:24:19 +00:00
Greg Daniel
8133080b5c [Graphite] Add a ResourceProvider onto the Context.
The Context is going to have to be able to make some Resources when we
insert a recording onto it. Some examples of this will be discardable
MSAA and Stencil attachments that are shared by all Recordings.

Bug: skia:13357
Change-Id: I9d49f640404176d38416372fd208b591b032d599
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553581
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-28 19:16:55 +00:00
Greg Daniel
ab286e8531 [Graphite] Add QueueManager Class.
This CL is mostly moving the queue/command buffer systems off of Gpu and
Context and moving them to the QueueManagerClass.

Bug: skia:13357
Change-Id: I0ee5096c84b1210082745fafd2d38791fd9be52e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549557
Reviewed-by: James Godfrey-Kittle <jamesgk@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-28 19:10:19 +00:00
John Stiles
27e5eb1281 Add SkRuntimeEffect flag indicating half-precision uniforms.
Graphite's uniforms (SkUniform) distinguish between "Float" and "Half"
as separate types, so we now preserve this information in a Uniform
flag. We didn't have any tests verifying the behavior of Uniform flags
in SkRuntimeEffect at all, so I added a test here.

Change-Id: If6323ce26eeca2ef7da6c7424ad7350c6a0b7362
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553594
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-06-28 17:11:31 +00:00
Herb Derby
cdf338247b Update SkSpan docs and check for bad initializer_list
Change-Id: I539ecd32ecb61d4be6b89c52065f55269937aa32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553580
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-27 21:26:45 +00:00
Jim Van Verth
45a6f2c986 [graphite] Set up ContextOptions for text
Bug: skia:13118
Change-Id: I90aee8cff625ad822fa9d62f803a8badbe51925e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552676
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-27 16:57:43 +00:00
Kevin Lubick
86678ed625 [bazel] Add option for SkSVGCanvas (and expat third_party DEP)
Our SVG code depends on our XML code which depends on expat.

See also cl/457481999

Change-Id: I83b61f5d73570d0aa7e851a01ccd019b4b1019e4
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553376
Reviewed-by: Florin Malita <fmalita@google.com>
2022-06-27 15:56:55 +00:00
Herb Derby
f9329d7b87 Deprecate SK_ARRAY_COUNT and docuemnt the old and new methods
Change-Id: Id58bf93098fa62f621614937a2d1524790f73f58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551708
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2022-06-21 18:01:49 +00:00
Dominik Röttsches
2feabbf1fc Pass-through of variable COLRv1 RuntimeEnabled Blink feature flag
Enable passing in a feature-test function that returns a Boolean
with the intention of being able to use it in FreeType library
initialisation.

See also:
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/168

Bug: skia:13448
Change-Id: I6c985201552b54f2fa99e911265b7303ff8b2897
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551637
Commit-Queue: Dominik Röttsches <drott@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2022-06-21 16:00:33 +00:00
Herb Derby
1aea903381 Reland "Move SkSubRun to src/text"
Added changes for public.bzl

This is a reland of commit 4a375fe213

Original change's description:
> Move SkSubRun to src/text
>
> Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I86e342a416a3c97bf972c496b93b37e35cd09c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-18 17:20:42 +00:00
John Stiles
40e3b3c605 Assert when creating nullptr spans with a nonzero length.
According to https://en.cppreference.com/w/cpp/container/span/span (2),
it  is undefined behavior if [first, first + count) is not a valid
range, so it is standards-conforming to assert on this span.

This caught one case in GlyphRun where we were creating an invalid
span (which was apparently harmless in practice).

Change-Id: Ia0661b3bd13c2c5773492960eea11b1a294072d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550499
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-06-17 14:07:15 +00:00
Brian Salomon
00bead8e63 Add glCopyBufferSubData to GrGLInterface
Will be used in SkMesh buffer update API and likely for unit testing of changes related to Issue 13427.

Bug: skia:13427
Bug: skia:12720

Change-Id: I487ee512d4b8bb61c533c7047bdbffcde9779885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549570
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-16 18:12:23 +00:00
John Stiles
87f9e464bf Add SkPaintParamsKey::Header structure.
This was originally done with the intent of adding a third field
(number of pointers in the data) but we may be able to get away with
keeping the two-byte Header after all. Having the data in an actual
struct does make refactoring a lot easier, at any rate.

Change-Id: I25a4e46b45f3f9c93eb16bc4d51b6624d7e319ba
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550183
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-06-16 17:51:10 +00:00
Robert Phillips
47a67a7f4f [graphite] Use CombinationBuilder to create SkPaintParamsKeys directly
Bug: skia:12701
Change-Id: I53bbabb2aba44e3bfc215df81dae1ae59d149263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544319
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-06-16 17:16:30 +00:00
John Stiles
a444743005 Remove SK_MAYBE_UNUSED.
[[maybe_unused]] is built in to C++17.

Change-Id: I5e49d0801878fd9fbca62ab28080aa856e33ca79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550500
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-06-16 16:52:53 +00:00
John Stiles
9644e7d675 Add 'packed' to description of SK_BEGIN_REQUIRE_DENSE.
Spent 10 minutes searching for this macro because I expected it to have
"pack" in the name, like __attribute__((packed)) or #pragma pack.
Adding a little lifeline for future me.

Change-Id: I8c4f8cbd4febdea6bcd5698d267a2673246295e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550184
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-06-15 22:59:43 +00:00
John Stiles
008d60e58c Revert "Move SkSubRun to src/text"
This reverts commit 4a375fe213.

Reason for revert: breaks google3, probably needs public.bzl fix

Original change's description:
> Move SkSubRun to src/text
>
> Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Ic6f3ecd81e2bfd03320f820bb5301b0d1c5d6c9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550181
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-06-15 22:33:12 +00:00
Herb Derby
4a375fe213 Move SkSubRun to src/text
Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-15 20:37:16 +00:00
Ethan Nicholas
4144b8abb4 Added preliminary SkSL Metal compute shader support
This adds mostly-functional compute shader output to SkSL. This does not
add overall compute shader support to Skia; it still needs to be
integrated into the Skia pipeline before it is possible to actually use
compute shaders in practice.

Change-Id: Ic5c69863704f141d16bb191224a817e44f4a8565
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539060
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-06-15 18:52:42 +00:00
Herb Derby
8ccbeeebc3 Remove SkMakeSpan
Change-Id: I33121076bac3ceca19c81ff9fb47e4b024a14230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549838
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-15 17:26:32 +00:00
John Stiles
78c1845e66 Update SkMakeRuntimeEffect to return a raw SkRuntimeEffect*.
Previously, we were storing sk_sp<SkRuntimeEffect> objects in static
variables. This would presumably lead to destructors executing during
atexit time, which is unnecessary and can lead to shutdown bugs. We no
longer attempt to free these objects.

Change-Id: I0b09d7ab3dc67c9b8fbc35c81d72ff57b0592c03
Bug: skia:13426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549658
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-06-14 23:37:34 +00:00
Herb Derby
e619fb0aa1 In SkSpan, use template guides for CTOR
Use template guides for deducing the type needed by the CTOR.
This allows SkSpans to be deduced when things like vector,
array, A[], etc. are passed as parameters without using SkMakeSpan.

Change-Id: Ieedcbddc8d40281f819b0c798acd178a12a05891
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549568
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-06-14 19:50:46 +00:00
Jim Van Verth
6ed17ef4c5 Fix some remaining SK_GRAPHITE_ENABLED defines.
Change-Id: I7a4cd8e2c629ba53e40adc379ea92f86f70d11da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549857
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
2022-06-14 17:24:53 +00:00
Jim Van Verth
8e96c9db78 [graphite] Hook in more of the text drawing interface
Bug: skia:13118
Change-Id: Icaf2b0914ce7943f57e1ab23e7778d1dcb811cc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548781
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-06-14 15:55:11 +00:00
Jim Van Verth
56e6286317 [graphite] Add ContextOptions
Bug: skia:13118
Change-Id: I0d6e0a9f542680456d3de82a32376722c5b9cd1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549097
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-06-14 15:39:21 +00:00
Herb Derby
54ef59188b Update SkSpan to use new c++17 facilities
Use std::size and std:data to get needed values.
Add a SkMakeSpan for initializer_list.

Change-Id: I43b4b2391323c84b3d6aad22ac4775487c6d5570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549565
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-14 14:01:31 +00:00