Refactor the implementation to decouple frame generators
(FrameGenerator: cpu, gpu, picture) from frame consumers (FrameSink:
png, skp, mp4, null).
Add a GPU frame generator using async readbacks. Unlike other
generators, which execute on a thread pool, selecting the GPU generator
forces single-thread execution.
Also add a couple of backend-specific build targets (skottie_tool_cpu,
skottie_tool_gpu) to facilitate binary size experiments.
Change-Id: Id59e230b3861afe5bf9b7ecfc710d672f38eeaaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551237
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
If we are going to create a new snippet ID every time a runtime effect
is painted, we will overflow a byte very rapidly.
Change-Id: Ic094af2a81e590488bf90b60492b004e9135d4a2
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551843
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: Ie2166fefe6ffa431b17590c53bf22a8725376938
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551885
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Without this define, I was seeing a compile error in SkKeyHelpers.cpp
Change-Id: I4d4a804f11fdd67e69bac4c7a6d0d686bebd8922
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552076
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
SkArenaAlloc uses new char[allocSize] to obtain new memory blocks.
Changes this to sk_malloc_throw which does not zero allocated
memory.
I don't think anything relies on the memory being zeroed. If
this CL makes it through all the *SANs I think this CL will
be ok in the field.
Change-Id: Ia564313a501dd7c5b34ac6a9bde71fab1d76be76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551880
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Replaces Device::recordDraw() with a static ChooseRenderer() function
that is closer to the final destination for renderer selection, and
provides a helper function drawClipShape() for ClipStack to use instead
of having it append to the DrawContext directly.
The renderer choosing now happens earlier in Device::drawGeometry()
so that it is available to modify bounds/draw-order calculations if
it requires coverage AA.
Bug: skia:12787
Change-Id: Ia12db71bcd3ab6fbecfc72c79f06a2597388eafd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550699
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This is a reland of commit fb13c18ddf
Bazel 5.2.0 was fine, it was the fact that our toolchain
was not erroring when clang failed that was an issue.
We were always returning error code 0, but Bazel 5.2.0
was correctly identifying that we hadn't produced the
promised build artifacts.
Original change's description:
> [bazel] Update to v5.2.0
>
> The primary change we are looking for is
> "Add support for .ar archives (and .deb files)
> https://github.com/bazelbuild/bazel/pull/15218"
>
> https://blog.bazel.build/2022/06/08/bazel-5.2.html
>
> In theory, we should be able to trigger Linux RBE
> compilations (e.g. IWYU) from Mac with this change.
>
> Change-Id: I217406d21fd55507e090c4bb5f79c796230717e6
> Bug: skia:12541
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549659
> Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Bug: skia:12541
Change-Id: I160b5802adc232d5cf7f7d05b20d5eabbb3d5102
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551841
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Note: in variedtext.cpp:66 changed static_assert to SkASSERT.
Change-Id: I853a2e5563c90c9dde5d6ba5443cc73b664b493d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551876
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
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>
In order to support a larger range for stop offsets in variable fonts, I
plan to resize the stop_offset field to 16.16 in FreeType. Prepare Skia
for handling that change.
Bug: chromium:1311241
Change-Id: I1da46a3e4c79f2f3d091e65005c19d16dc382669
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551638
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
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>
In MtlGraphicsPipeline, get_sksl_fs() will return '{}' if
SK_SUPPORT_GPU is false, which means it won't work in Graphite-only
builds. Making the related code Graphite-only fixes the link errors.
Change-Id: Ia6e9a99ad506c637b43a0830941f775ec0678b03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550713
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This combines the BruteForceManager and Gridmanager, starting with
brute force when it's fastest for low N and then transitioning to less
accurate grid that scales for larger N.
Also updates the set of benchmarks to run based on more reasonable
configs (e.g. having a reasonable level of accuracy to be worth
considering).
Updates Device to use the HybridBoundsManager with brute force up to
64 draws, and then a grid configured to make 16x16 pixel cells. My
guess is we will see a mix of perf regressions and improvements with
this. The existing use of the NaiveBoundsManager had negligible CPU
cost but disallowed all re-ordering. The brute force and grid
managers will add CPU cost but enable re-ordering, which shows up
as shorter command buffers (e.g. 17k commands vs. 28k commands in the
motionmark suits benchmark). However, because we don't have SSBOs
there still isn't as much batching that would let the GPU take
advantage of this re-ordering so I'm not sure how visible the wins
will be yet.
Bug: skia:13201, skia:12787
Change-Id: Iad58fccab45def5f702a30860e063669424dfcf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550518
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13427
Change-Id: I7a0833e19c7d97157cb18b9ad9a11f2d25427b2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551836
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
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>
Includes a unit test to generate the exact failing scenario, and also
fixes the case where inputFP was nullptr to begin with (and we would
have tried to call nullptr->clone().
Change-Id: I5a03730d1217d9b1747e5ad2018100bc1c5f9e50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550714
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 9be648ad64.
Reason for revert: breaking G3 roll
Original change's description:
> set up GL sample app to build through Bazel Mac toolchain
>
> Suggested review order.
> 1) tools/sk_app/* and src/gpu/ganesh/*
> sets up the actual target to be built by the toolchain
> 2) toolchain/* and .bazelrc
> changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution
>
> Change-Id: Ic8209b97a0d8448f984d43a579e600ba4e9118e1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549897
> Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I5414b94f2c6175ea8c7dbc6cd72c7dd8d1b47892
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551236
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Also rename existing transfer buffer alignment cap for surface transfers to distinguish from new one for buffer to buffer transfers.
Bug: skia:13278
Bug: skia:12720
Change-Id: Idc4116c72fc2852a01d40feec6584d2bde9eae82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550517
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
These need to be above any helper functions.
Change-Id: I6ed580b5be8822d720a9a649324699ee227578bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550709
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, glue-code helpers only allowed appending into `main` and
there was no mechanism to insert code elsewhere. Now, glue-code emitter
functions take two strings, `preamble` and `mainBody`, and can write
into either one as desired. When generation is complete, `preamble` will
be inserted directly above `mainBody`.
This will allow us to insert standalone functions, global variables,
prototypes, etc. into the finished shader code.
Change-Id: I17b545cd326605ddf032f6dadd6164bb9c9b2c69
Bug: skia:13443
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550705
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Adds a parameter to SDFTControl that forces all glyphs to fail as SDF
or Direct, and sets it in the Graphite Device constructor.
Bug: skia:13118
Change-Id: I212e35e992bb14925ec66fca610bb0825ff467b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550618
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
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>
Suggested review order.
1) tools/sk_app/* and src/gpu/ganesh/*
sets up the actual target to be built by the toolchain
2) toolchain/* and .bazelrc
changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution
Change-Id: Ic8209b97a0d8448f984d43a579e600ba4e9118e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549897
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
We can now fully round-trip pointers through a PaintParamsKey safely.
Change-Id: I1a2133b39d895996f6c94211a0c5741ad0933398
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550703
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This undoes http://review.skia.org/550018, and also eliminates the
pointer-related additions to Stack in http://review.skia.org/550179.
When this was originally added, the plan was that pointers would not be
represented in the data payload at all, so we needed a mechanism to
track whether pointers were needed for each snippet type. This is now
handled by the existence of the kPointerIndex data payload field--
you'll assert on field-type mismatch/missing field if you skip the
pointer.
Change-Id: Ie868526d8d9da47819ea08e16aab1a5566f9cff8
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550700
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>