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>
Dawn headers and symbols for WASM are provided by emscripten and a
direct dependency on Dawn native leads to conflicts in those builds.
Fixed the ganesh/dawn Bazel rules to only depend on Dawn on non-wasm
builds.
Bug: skia:13427
Change-Id: Ie1fa0b2c1a6486b4db3a9adb2366645c9c8c5e7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550257
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
It has served use well, but its time to let it enjoy its life in
retirement.
Change-Id: I47213a7a74a890aa0b04e906fb236c7cc4aabb61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550621
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
* Skia GN can now build the Dawn backend without depending on Dawn
native, provided that webgpu_cpp.h/webgpu_cpp.cpp is provided by
emscripten.
* Split gpu.js into webgl.js and webgpu.js. None of the CanvasKit API
functions are wired up to WebGPU yet so it will use the CPU renderer.
* Added new macros and GN args to distinguish between WebGPU and WebGL
builds in CanvasKit, instead of relying on Skia GN args.
* Renamed CANVASKIT_NO_ALIAS_FONT macro to CK_NO_ALIAS_FONT to match
style.
Bug: skia:12512
Change-Id: Ifc4191da046bd7af73492cfba6e3ca530590d722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548603
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Previously we were overwriting the renderpassXferBarriers flag on
ProgramInfo to set it to kNone. This flag is meant to say whether or not
the entire render pass uses barriers or not. This is needed in Vulkan
because all pipelines in a render pass that has an input attachment
must bind the input attachment regardless if it is used or not. So the
pipeline must be created with a layout for an input attachment
descriptor set.
This change just removes to performance optimization to only use the
barrier on the stencil and not fill draw. This use case shouldn't
come up too often and also shouldn't be a big perf hit regardless.
The way GrAppliedClip is created/used it is hard for us to create
multiple different Pipeline objects: one for stencil and one for the
fill.
Bug: skia:13402
Change-Id: I15ce74b4d41b90d3dd4169a1f4fb77ed87c8b26d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549898
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This was added during a refactor to detect behavior regressions and
in anticipation of removing kStream_GrAccessPattern. That removal
wasn't completed because of skbug.com/11297. Given the advent of
Graphite it likely will never be fixed.
The assert is only detecting whether our behavior conforms to what
is effectively a hint and is making it harder to modify
GrGpuBuffer. It's also a bit of heavy hammer in that for some backends the writes to the buffer are effectively gpu->gpu and so
don't violate the spirit of the hint.
Bug: skia:12720
Change-Id: I27e8d89b63df54a667879f2f7e4452e3c37da264
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550620
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The API for keys containing colors was unfinished--there was a way to
add a single color to a key, but there were was no support in
BlockReader to read the color back out, and only fCount == 1 was
supported.
This CL fills in these gaps, and adds a test verifying that SkColor4f
data can round-trip through a PaintParamsKey successfully.
Change-Id: I9586fbd59e1a091970f44751322c03ad493888f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550698
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:13118
Change-Id: I37fa38012ba752026c03266466a713221bd746be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550616
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Using a switch lets the compiler flag an error if we add a
DataPayloadType and forget to update this function.
Despite initial appearances it's quite efficient when compiled:
https://godbolt.org/z/vqoaddGn4
Change-Id: I5f650afdf81205942966fb318643ff4af5a29252
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550501
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
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>
This will give us stable data in the payload, so that the key itself
will match with operator== regardless of the pointer value. We can
extract pointers from the pointer-data block efficiently, even in the
case of multiple/nested children with embedded pointers, by using the
pointer-index value to fetch from the pointer-span.
Change-Id: Ic3b5f823a631257fd50ec6989b7c0fd1c70e6178
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550497
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
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>
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>
[[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>
The only remaining test was the ES3 matrix constructor test (using
non-square matrices). Ideally, we'd run this on GPU, but it fails on
a huge number of devices.
With this change, we no longer have tests that break the version rules
for CPU (ie, disable ES2 restrictions because we know a test uses a
subset of features known to work). This will simplify version logic.
Bug: skia:11209
Change-Id: Ida07ec943d81539c327bd1125da22bad68df26f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550498
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
And a little bit of unit tests and benchmarking...
Change-Id: I56252846c2c00f35e70472e5d8272717d6ec4b25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545897
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
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>
Bug: skia:13118
Change-Id: I49ce429913b9ac06d30250401434e68ef4e5da18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550180
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
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>
The BlockReader does not yet support pointer-data; that will be
implemented in a followup CL.
Change-Id: I01cd3712241071095fdb9cde741b8566d2761926
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550179
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
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>
Bug: angleproject:7434
Change-Id: I77dcdcbe288f531698abc8ff0fd89b421066935d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550217
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
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>
Create a new Geometry class that encapsulates Shapes, but can later encapsulate Vertices & text subruns. DrawGeometry has been renamed to DrawParams for clarity and now stores a Geometry object instead of a Shape.
Bug: skia:13352
Change-Id: I42781b3eecff9845b893aa99fe78c08fd50fb995
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547281
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Nicolette Prevost <nicolettep@google.com>
This reverts commit d78d52a86f.
That reason this CL was reverted in the first place is that it broke the Android roller - perfetto.h could not be located.
We now disable the use of perfetto for Android in the gn_to_bp.py script, so the roller should be good to go.
Reason for revert: Relanding
Original change's description:
> Revert "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class"
>
> This reverts commit bfc9b94840.
>
> Reason for revert: new dependency causing Android build error
>
> Original change's description:
> > Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class
> >
> > First incremental step to incorporating Perfetto tracing into Skia, more CLs to follow
> >
> > NOTE: The presubmit check is failing. This appears to be due to the known issue where the presubmit check bugs out if the DEPS file is edited, which it was on this CL (modified to include Perfetto).
> >
> > Bug: skia:13303
> > Change-Id: I908be0392b520e8da14b34588b842bf6d955bd93
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543081
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Nicolette Prevost <nicolettep@google.com>
>
> Bug: skia:13303
> Change-Id: Ia2b883bbab1f8fb4f3914b63104a39240cc60e86
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544239
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Auto-Submit: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Nicolette Prevost <nicolettep@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>
Bug: skia:13303
Change-Id: Ibd369b9c8c0e69fc9615fc05cf588ee4440c8ed5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544244
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Nicolette Prevost <nicolettep@google.com>
It's been broken for quite some time.
Change-Id: Ic75f75e2062e9c1f624aa59c2d8de8909a208ea2
Bug: skia:12830
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550256
Reviewed-by: Eric Boren <borenet@google.com>
This also pinpointed one more case where we had an sk_sp<> inside a
static.
Change-Id: I01af66213249334667f107bcb95d53e4ce6f4c52
Bug: skia:13426, skia:13432
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550020
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Note that both `unordered_map` and `sk_sp` had non-trivial
destructors.
Change-Id: I39ffc2193c7935e71aab9b5c7474a64b5f93f753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550176
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
There is a very old bug (http://crbug.com/510931) that was fixed back
then via a special check when unpacking glyphs. However, it was noted in
another CL that it doesn't seem this should still be possible. The only
case where expectedMaskFormat != maskFormat is when we have a 565 glyph
but a RGBA8 texture due to lack of 565 support. Otherwise they should be
the same. There is no access of the glyph cache that should change the
maskFormat.
Change-Id: I4a6ea11e5095f47f4ce5cc095db8bee084dd8a31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549846
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>