The equivalent functionality is available in
include/effects/SkImageFilters.h via SkImageFilters::MatrixTransform.
Bug: skia:11230
Change-Id: I77b78d508d653a32c913a7599f1004ab634e3e6d
Docs-Preview: https://skia.org/?cl=361497
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361497
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Document why mask gamma, optical sizing, and contrast hacks are used and
where. In addition to documentation this also justifies where contrast
settings should be placed in the API.
Change-Id: I8c67d800a95e62360a88c815d3224e0c05ed65c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356305
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This enforces an even stricter version of the rules from GLSL ES 1.0
Appendix A, Section 5. Essentially, indices (to arrays, vectors,
matrices) must be made of literals, loop indices, and expressions made
of those two.
Bug: skia:10837
Bug: skia:11096
Change-Id: I437a5ed64da58e24d5991ddbde68859f5214e98b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354665
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Also fix a crash if you try to play an effect that has never compiled
correctly. (After the first compile, the arrays were always large enough
to set "dt" -- this code is all going to be reworked soon for SkVM, but
I hit this while diagnosing the type coercion error).
Change-Id: I5bfab539c7304bde2da36b0b0604991d5b5b303a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354660
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
I'm going to remove this feature to simplify migration to skvm.
fireworks was updated to work without it. raincloud is fairly complex,
and not that attractive, so it's just being deleted.
Change-Id: Id2d5cd490baa7bae627002f41edf7522c8bdfcd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353076
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This was unnecessary (closed-form unit-disc picking is simpler), and
these loops don't meet the strict ES2 standards that we'll be applying
to the interpreter soon.
Bug: skia:11095
Change-Id: Ic2617c2807fe49d57ff8e4d57d70b9ed1f015916
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348895
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
uint (and bitwise operations) aren't supported by our minimum spec, and
they're going to be removed from public SkSL. For now, convert the
random generator to a good-enough chaotic sequence of high-frequency
sine waves.
If/when the interpreter (and particles) are converted to the newer skvm
backend, it will be straightforward to support custom intrinsics that
emit skvm instructions directly into the builder, and re-introduce a
better integer-based PRNG, without requiring SkSL language support.
Bug: skia:11093
Change-Id: I885b15a51a9e5c12b4274b5938d8deb77219d41b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347036
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The 'flags' field is going away soon (per public SkSL minimum spec), and
the only use of that feature was for this one example. The alternative
is simpler to understand, too.
Bug: skia:11093
Change-Id: I18a85bd48316301edc44c691fbe20f93da243e2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346776
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
I've landed some CLs that should make it easier to launch apps on Xcode,
plus it looks like the latest GN has also added some fixes.
Change-Id: Ifaf051020dff7ecad7091c854b8b42fc7f475afa
No-Try: true
Docs-Preview: https://skia.org/?cl=335871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335871
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
The previous behavior leaked Skia-internal concepts into public SkSL.
Users coming from GLSL will expect that bindable/sampleable objects are
uniform (just like texture2D). This keeps the old support around (and
tested), but updates all of our examples to use 'uniform'.
Bug: skia:10679
Change-Id: I0c98162f5e21dad7014d9778ceb26143d2f6030e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332376
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: I9666a2358489cf2492515ea2dab5cc8dcf475bb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324884
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This also links the main canvaskit landing page to the quickstart
and both pages to the Typescript types and documentation.
Bug: skia:10717
Change-Id: I843639651aa04e48bb13f995c15e4ee18fb348bd
No-Try: true
Docs-Preview: https://skia.org/?cl=323889
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323889
Reviewed-by: Nathaniel Nifong <nifong@google.com>
This is a massive breaking change for all existing users of CanvasKit.
It will be (one of the only) changes in 0.19.0 to make the transition
easier.
Suggested reviewing order:
- index.d.ts (to see type changes). Notice SkPicture still has Sk
prefix, but no other types do (this felt "right" since Sk is
part of the name of the type, but I can be swayed on this).
- canvaskit-wasm-tests.ts
- tests/*.spec.js
- interface.js and helper.js
- html examples
- markdown files
Change-Id: I3b3d3815df2078f986893df3c70101d6248c117d
Docs-Preview: https://skia.org/?cl=322617
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322617
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
These are no longer needed now that we've migrated away.
Change-Id: Id308af7d40ffe0d539a3c6fd201220d145080928
Docs-Preview: https://skia.org/?cl=317281
Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android,Canary-G3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317281
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
I have been hacking around on Bazel more today,
and while I think it was a day well spent, I've
got intentionally nothing to commit except notes.
Change-Id: I711eaf403e447aff5b19830d3ed8c5132c98c469
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316910
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We had several defines around the code base that were not
very descriptive. Additionally, we had a patch of extra
runtime restrictions living in oss-fuzz that were applied
when fuzzing over there for some fuzzers.
This has all be consolidated and controlled via the defines
documented in site/dev/testing/fuzz.md
As such, we can remove one of the patches that is in oss-fuzz,
taking us closer to being able to fuzz in the CI/CQ.
PS 1 renames existing fuzz defines to the new schema.
PS 2-3 backports skia.diff from oss-fuzz and changes those
definitions to have the _GREATLY modifier.
PS 5+ further condenses the defines so that there is one
define for gating the runtime checks.
Change-Id: Ia4ad96f30c1e9620a2123b510e97c6f501a2e257
Docs-Preview: https://skia.org/?cl=316443
Bug: skia:10713
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316443
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
There is no more 'inout half4 color'. Effects return their output color.
If an effect wants the input color, it must use the (already existing)
approach of sampling a nullptr input shader.
The change is guarded for Chromium (so we can update their runtime color
filters in skia_renderer.cc).
For the GPU backend, FPs can now override usesExplicitReturn to indicate
that their emitCode will generate a return statement. If that's true,
then writeProcessorFunction doesn't inject the automatic return of the
output color, and emitFragProc will *always* wrap that FP in a helper
function, even as a top-level FP. GrSkSLFP opts in to this behavior, so
that the user-supplied return becomes the actual return in the FP's
emitCode.
Adapting the skvm code to this wasn't too bad: It looks fragile (what
happens if there are multiple returns?), but that's not really possible
today, without varying control flow.
Bug: skia:10613
Change-Id: I205b81fd87dd32bab30b6d6d5fc78853485da036
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Most of this is just not mentioning things that need not be mentioned
anymore, but there's one slight style tweak which I think is better,
from
case Foo: {
...
break;
}
to
case Foo: {
...
} break;
which is a little clearer that all paths through case Foo break
when the contents of the {} block become complicated.
Change-Id: Id7fe5ab09437006d125313b07862613316dd403c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312576
Reviewed-by: Brian Salomon <bsalomon@google.com>
The nullptr/0 distinction should go without saying,
and I think worrying about any of the rest just burns brainpower.
Change-Id: I7d0aea300f114e512437c3820f4e80a1408575c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312472
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This pattern is used frequently throughout the codebase but seems fairly
unique to Skia. It can be misleading if you haven't seen it before.
(In particular, the `onXxxxx` naming scheme is sometimes used to
indicate message-passing or event-handling, but that's not how it is
used in Skia.)
Change-Id: I73c5f7874bc51f8fde07baa8ef6a0e47c102302a
No-Try: true
Docs-Preview: https://skia.org/?cl=310159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310159
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I2102056847efe9e56ba6e8150e0d451bffc8f204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309378
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The style guide only mentioned the `k` prefix for enums, but it is
also used throughout Skia for constant values.
Also removed guidance about using anonymous enums to declare an
integral constant. static constexprs should be preferred here.
Change-Id: I2f7d4d375cc914d4efb9fe60fbd90ddaaf8c1b69
No-Try: true
Docs-Preview: https://skia.org/?cl=308919
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308919
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>