Go to file
John Stiles a72eda6bfc Split callbacks into separate preamble/expression phases.
Previously, snippets held a single callback which had two separate
responsibilities:
1 - If needed, emit helper functions into the preamble
2 - Return an expression that invokes the snippet

This works great when you only call a snippet exactly one time, but
poses a problem if you need to invoke a snippet more than once;
the callback would also emit all of that snippet's helper functions
again!

This CL splits the callbacks into two pieces: a "preamble generator"
and an "expression generator." The preamble generator is responsible
for bullet point 1 above; the expression generator is responsible
for bullet point 2.

The preamble generator will run exactly once for every entry in a
shader info, and is in charge of advancing the entry-index through
the shader (a surprisingly non-trivial concern when children are
involved!). The expression generator can be called any number of
times for an entry, does not advance the entry index, and cannot
change the preamble.

At present, we do not actually have any use cases where we generate
the expression for a given snippet more than once, but this is a
feature that Runtime Shaders will need to leverage in a followup.

Change-Id: I3b75fc894351ac459b13763331e8bf64694de1df
Bug: skia:13508
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/558920
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-07-15 18:33:52 +00:00
bazel Manual dawn roll 2022-07-14 14:45:31 +00:00
bench [graphite] Add HybridBoundsManager and use as default impl 2022-06-21 15:52:22 +00:00
bin Update emsdk to version 3.1.15 2022-07-12 17:30:43 +00:00
build/fuchsia
build_overrides Manual Dawn Roll 2022-06-23 12:39:45 +00:00
client_utils/android Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
demos.skia.org Pin canvaskit used in demos 2022-06-24 19:59:24 +00:00
dm Reland "Replace SK_ARRAY_COUNT with std::size() all the rest" 2022-07-01 16:20:51 +00:00
docker Update Perfetto reference following fix for b/234001590 2022-06-16 15:16:55 +00:00
docs/examples Replace SK_ARRAY_COUNT with std::size() for skia/docs 2022-06-16 20:09:58 +00:00
example reland "set up GL sample app to build through Bazel Mac toolchain" 2022-06-21 19:22:16 +00:00
experimental Better encapsulate Blend, Color and Empty shaders 2022-07-11 16:37:52 +00:00
fuzz Reland "Replace SK_ARRAY_COUNT with std::size() all the rest" 2022-07-01 16:20:51 +00:00
gm Revert "In the CPU backend, stop treating alpha images as coverage" 2022-07-14 16:29:44 +00:00
gn [Graphite] Use more flexible system for storing commands in DrawPass. 2022-07-14 18:59:25 +00:00
include Fix some prevent_unsafe_narrowing warnings 2022-07-14 17:31:01 +00:00
infra Update linux mesa drivers. 2022-07-14 20:54:02 +00:00
modules Add addCircle, isInterpolate, and interpolate 2022-07-14 17:26:43 +00:00
platform_tools Enable inline/datauri image support for SkottieView 2022-06-27 19:54:24 +00:00
resources Disallow most modifiers in runtime effects 2022-07-13 18:22:23 +00:00
samplecode Better encapsulate Blend, Color and Empty shaders 2022-07-11 16:37:52 +00:00
site [gardener] Update docs for triaging oss-fuzz bugs 2022-07-12 11:04:12 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src Split callbacks into separate preamble/expression phases. 2022-07-15 18:33:52 +00:00
tests Disallow most modifiers in runtime effects 2022-07-13 18:22:23 +00:00
third_party Add skia_use_system_freetype2_include_path and skia_use_system_freetype2_lib build options to configure system freetype2 to build and link against. 2022-07-13 20:56:02 +00:00
toolchain [includes] Reduce IWYU exports from SkTypes.h 2022-07-06 14:52:55 +00:00
tools Turn on bilerp support for the atlas in viewer 2022-07-14 16:13:20 +00:00
.bazelrc [bazel] Add option for SkSVGCanvas (and expat third_party DEP) 2022-06-27 15:56:55 +00:00
.bazelversion Reland "[bazel] Update to v5.2.0" 2022-06-21 18:49:10 +00:00
.clang-format
.clang-tidy
.gitignore [infra] Add BazelBuild task to build CanvasKit on the CI with Bazel 2022-05-06 17:54:08 +00:00
.gn Disable wayland in ANGLE 2022-06-15 18:24:40 +00:00
.vpython [python3] Reland recipes -> python3 changes 2021-12-01 13:04:03 +00:00
AUTHORS Add mike@reedtribe.org to AUTHORS 2022-05-19 12:49:11 +00:00
BUILD.bazel [bazel] Make modules depend on //:skia_internal 2022-06-24 17:01:56 +00:00
BUILD.gn Add vtune jit support for linux 2022-07-07 19:48:25 +00:00
codereview.settings
CONTRIBUTING
CQ_COMMITTERS
DEPS Roll ANGLE from ea1382365f6b to ebf14fe370a8 (3 revisions) 2022-07-15 17:54:42 +00:00
DIR_METADATA
go_repositories.bzl [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.mod [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.sum [infra] Fix go.sum 2022-04-28 18:01:34 +00:00
LICENSE
OWNERS
OWNERS.android Update OWNERS.android with more details 2022-03-16 18:13:33 +00:00
package-lock.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
package.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
PRESUBMIT.py Skip buildifier check on go_repositories.bzl during presubmit. 2022-07-15 14:48:15 +00:00
public.bzl Have the remote and main strike caches return a StrikeRef 2022-07-14 18:15:32 +00:00
README
README.chromium
RELEASE_NOTES.txt Update single-child RuntimeShader to use string_view. 2022-07-12 18:59:43 +00:00
requirements.txt Added expected hash for MarkupSafe for the MacOS platform with the M1 chip 2022-05-19 17:54:32 +00:00
whitespace.txt Push shaders.skia.org. 2022-01-19 21:46:16 +00:00
WORKSPACE.bazel Update emsdk to version 3.1.15 2022-07-12 17:30:43 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.