Graphite expects uniforms to be passed in as a span of SkUniforms.
When making a runtime effect, we now convert the SkRuntimeEffect's
`Uniform` data into SkUniforms as well.
I briefly looked at sharing a single uniform type, but
SkRuntimeEffect::Uniform is public API, so changing it is non-trivial,
and Uniform would not be usable as a direct replacement for SkUniform.
(Uniform is non-POD since it contains an SkString; SkUniform is POD
and we declare a bunch of them at global scope. Also, each class
represents types using a separate enum.)
Change-Id: Idef2141d3a4860529719382840a157b7b0c41643
Bug: skia:13457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553595
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This will be used for pre-transformed Geometry such as DirectMaskSubRun.
Bug: skia:13118
Change-Id: I82e277acf786931c04a4667b2b93a6ccd8ae90fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554036
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
The tests themselves are the same, just split up into their logical
groupings. http://go/unit-testing-overview#properties
"Focused. Above all, unit tests are narrow in scope, validating the
correctness of individual pieces of code rather than the correctness of
the system as a whole."
Change-Id: I6149536e84763abc98dfe243d4090bb25a555525
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553592
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
GrDawnBuffer now implements GrGpuBuffer::onRelease in which it unmaps
the underlying wgpu::Buffer if it is mapped to main memory. This has to
be done explicitly to prevent unbounded growth in memory usage of
staging buffers.
Bug: skia:13475
Change-Id: I985cf090b3861b08e13a425dfeae53e01c784d2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553736
Commit-Queue: Arman Uguray <armansito@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
MSVC and clang-cl do not recognize -isystem, but do recognize
-I. Thus if those compilers use our rules, we want our copts
to be maximally compatible.
Some of these options didn't seem to do anything, so I removed
them rather than replace them.
Change-Id: I73feb63d5c682a6df646d731b10ca2509e105e6f
Bug: skia:12541, b/237076898
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553878
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
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>
I don't know why none of the CQ bots don't run scaledemojiperspective,
but this was not found in the gold for the CL. Because it is
clearly wrong.
Take a best guess at the perspective size calculation by using
the matrix's getMaxScale() to estimate the scaling caused by
the perspective matrix.
Change-Id: I58258b18c0c427b39c56f16c7ee17b8b8d4e4e1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553593
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I7abba20991482d72ca90b52a92034b9875be4098
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553578
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:13118
Change-Id: I04d47d0cf3e2f6318d289b4f8d41fe9386bb4fad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553876
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: Id781d04f9ece7e27365e19c8ba509d28f3f4e186
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553576
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
I'm switching to this two pass method because it will allow
simplifying the buffer structures in MakeInAlloc routine.
I need to simplify the buffer handling to rewrite the interface
to the SkStrikeForGPU to pass only the information the RemoteStrike
has. This will be many CLs to accomplish.
This seems to give the exact same results as the existing code.
Change-Id: I94a31549cbc1924adb1de44e0438996b902fdca8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552682
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
The clang_linux and clang_mac Bazel configs were removed in
commit I515c114099d659639a808f74e47d489a68b7af62.
Bug: skia:12541
Change-Id: Ib42764686a19a73164efbcf3d72869574f747b8f
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553590
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Mumford <cmumford@google.com>
This reverts commit 64284e1482.
Reason for revert: unused code
Original change's description:
> experimental alternative isconvex
>
> Bug: skia:
> Change-Id: I55175a95d37aad9a656cd211fc6c7238bdb7d674
> Reviewed-on: https://skia-review.googlesource.com/c/173361
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
Change-Id: Ib00acfc0964ecfd2fe01689c0d46d0773d5c5258
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553588
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This can let us create versions of skia_public with certain settings
enabled in an easy way (i.e. not requiring clients to set the compile
flags themselves).
Change-Id: I909449c6186f4912ea80dd9d579fcd7cafb4775c
Bug: skia:12541 b/237076898
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553377
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Change-Id: Id6efc88e2d048ade8aa2c0e7870c0bc73b1afcf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553537
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: James Godfrey-Kittle <jamesgk@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Suffixes already have a . in the beginning. Two dots does not
leave us with a valid URL.
Change-Id: Ia232d1b68a78450da7883e659fa6871b562db20f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553538
Reviewed-by: John Stiles <johnstiles@google.com>
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>
In [1] SkGraphics was changed to receive a flag callback from Blink if
variable COLRv1 is enabled. Pass this flag down to the corresponding
FreeType property in order to be able to continuously land changes in
FreeType for COLRv1 until shipping it.
Roll FreeType to current head, to include property addition to FreeType
in [2].
[1] https://skia-review.googlesource.com/c/skia/+/551637
[2] 4b6f92e6b3
Bug: skia:13448
Change-Id: I296ec5c5b4093cb1af0300de7d1eadcc8e740a36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553436
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
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>
`findOrCreateRuntimeEffectSnippet` takes a pointer to the runtime effect
and returns a code-snippet ID associated with the runtime effect, with
matching uniform layout, etc. The SkShaderCodeDictionary will maintain a
persistent map from {sksl-hash, uniform set} to code-snippet ID.
http://go/runtime-effects-in-graphite
Change-Id: I9c51667aad96f850184899f3df00a8206a1fe354
Bug: skia:13405
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552686
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: I6c6aed7de0747c4fea720fc4aa8b18ae6ad7327e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552685
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
In order to simplify buffer and strike handling eventually,
add a routine that will allow finding the maximum dimension of a
list of glyphs. In a future CL, I will use this to simplify
handling calculating the scale factor needed in the drawing of
last resort.
Change-Id: I8ac47328e1dfe59ea80499a83253bb166172a6b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552684
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Change-Id: I9a27b52bb0d3f96d296d712fe36a727f8ad5ded4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552683
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Graphite only needs a single token to manage DrawAtlases, which is
incremented after DrawAtlas uploads are issued.
Bug: skia:13118
Change-Id: I0adbee2870bb30f65ac98adc43e17ff191bf224f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552681
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Also removes usage of SkMatrixProvider.
Bug: skia:13118
Change-Id: I3f8a90b3de2d3adc5742c72095f33acf2e9080ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544246
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
These changes are necessary to use the toolchain on both the
M1 Mac and Intel Macs.
This adds a way to detect the host platform and choose different
compile options in the toolchain.
We cannot statically link in libc++.a from the clang zip because
it appears to be x64 only.
Finally, this fixes copts not being passed to objective c libraries.
Known issue:
- Intel Mac building has an error about the default CC toolchain.
Change-Id: Ie8e5e83dc41513563ac684e70a8a6947b36df445
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552472
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
unordered_map is much slower than SkTHashMap in practice, and it is
pretty straightforward in this case to replace.
Change-Id: I6d6bea6fa8c5c1ae6d23dfde05552db651975173
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553016
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
The particles version is used only when we want to demo brand-new
APIs. These demos should be using stuff that has baked in
for a while.
No-Try: true
Change-Id: I3a6cb9d4f384fe43c4acaae32416820f47adb440
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553018
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Chris Mumford <cmumford@google.com>
Pointer data is obliterated when we assemble draw passes, so this
feature didn't work for its intended purpose.
Change-Id: I85331aa7b6212c55fe16081937465c2f38e5a103
Bug: skia:13428
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552718
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit fc51827b56.
Reason for revert: Appears to have broken Mac (https://logs.chromium.org/logs/skia/5baefe22efa21e11/+/steps/dm/0/stdout)
Original change's description:
> Add removeUserDefinedSnippet method to ShaderCodeDictionary.
>
> We need to purge out user snippets when they are no longer needed, to
> avoid unbounded memory usage.
>
> Change-Id: Ib33909ec8c94cd6272f1a28e52a7ab92b27dfb0d
> Bug: skia:13405
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552577
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13405
Change-Id: I914eca4f017697fc4c82316b805ebaaa8c72e162
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552679
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Many of these happen to include private headers.
Change-Id: If416de1f30639d797406727dd18f350a85c744bb
Bug: skia:12541, b/237076898
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552937
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
The default canvas size was so tall that the instructions to
drag an image on the canvas were easily missed because they
are likely scrolled off the bottom of the page. This change
does the following:
1. Reduce canvas size to minimum for the hard-coded image
renderings.
2. Add a dashed gray border so that the user can more easily
identify where to drag the image. If not dragged to the
canvas then a new tab is opened (we don't want this).
3. Tweaked image drag instructions to reference "rectangle"
(the canvas) instead of the page.
Bug: skia:13456
Change-Id: I4f5aeb2653702e1daa80fe30f6c037b98eb585e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551766
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Mumford <cmumford@google.com>
Bump CanvasKit version to latest (0.34.1) to fix incompatibilities with
current version of these demos.
The first code incompatibility with the previous CanvasKit (0.25.0)
was introduced in Change-Id I8cf958acf9214d0de903a4097647afd74f2a659e.
Bug: skia:13456
Change-Id: Idc8c9935698743b4478ff61b8c10d8385093527c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551762
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Mumford <cmumford@google.com>
The demo pages are deployed to https://demos.skia.org/demo (singular),
but locally live in a "demos" directory. The absolute path to the
test image worked, when run locally, but not when deployed.
Switching to a relative path fixes this.
Bug: skia:13456
Change-Id: Ia6b6d0bedacaade4ba6b96f702179910825e871e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551765
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Chris Mumford <cmumford@google.com>