isVolatile = false may make drawing some meshes faster.
saveLayer can be used to draw more rich effects.
Bug: skia:
Change-Id: If26f30cebba2a45f7519dd934eab02597cd6d2dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197851
Reviewed-by: Kevin Lubick <kjlubick@google.com>
If fetch-gn is omitted, the scripts fail in a clean checkout.
Change-Id: Idc944f7e8c5cd2ca998ab685b942df280e17dbab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197207
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The name should be sufficient.
Change-Id: I451ae4a0f8d0f0864f07abc0405b591a6e2ca769
Reviewed-on: https://skia-review.googlesource.com/c/196506
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
- use a single name -> SkData map for both images and fonts
- consolidate images/fonts as a generic "assets" API
- pass pre-constructed asset maps to the SkottieAssetManager factory
and remove setter (immutable class at this point)
Bug: skia:
Change-Id: Ief6d3bcbba339ccd1d81fd9950871eaa691ee947
Reviewed-on: https://skia-review.googlesource.com/c/196503
Reviewed-by: Kevin Lubick <kjlubick@google.com>
We ignore the url for web fonts, as we assume the names
will not collide.
Bug: skia:
Change-Id: Ifaaa0d27e0de2c5088bc0885c9299bb83ee78a5d
Reviewed-on: https://skia-review.googlesource.com/c/196426
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
There's a lot of refactoring here to fix up the
namespace of the JS (see pre/postamble js).
A reviewer can skip all the changes to interface.js,
as they are mostly whitespace changes.
Bug: skia:
Change-Id: I7cedeb98f04d4446ac4dfb555a416f30490b2b94
Reviewed-on: https://skia-review.googlesource.com/c/195885
Reviewed-by: Florin Malita <fmalita@chromium.org>
Also add a dynamic text shaping demo
No-Try: true
Docs-Preview: https://skia.org/?cl=195440
Bug: skia:
Change-Id: I1e220cecae080a6a643fed8a1b9771ba8fe60915
Reviewed-on: https://skia-review.googlesource.com/c/195440
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This should allow shaper to run on the no-deps bot.
Change-Id: I2515875d4e9b428681c20877630b904c3229ecc5
Reviewed-on: https://skia-review.googlesource.com/c/194420
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Depends on https://skia-review.googlesource.com/c/skia/+/186870
It's optional at build time, which is good given that
it adds about 2MB of uncompressed size (from 4.3 MB to 6.4 MB)
Bug: skia:
Change-Id: I5f54ad628b735c3bc880e917394fb27d16849ebe
Reviewed-on: https://skia-review.googlesource.com/c/187924
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This should have some slightly better, more minified JS and other
bugfixes
Bug: skia:
Change-Id: I7c5367b6650267ec8bafcc5de9e351bd8788392b
Reviewed-on: https://skia-review.googlesource.com/c/193582
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Removes old API and replaces with new version.
drawText now requires SkFont and other changes.
Bug: skia:
Change-Id: Ie42a5243629542934c761223ed2e8dc6685d3572
Reviewed-on: https://skia-review.googlesource.com/c/183389
Reviewed-by: Mike Reed <reed@google.com>
ToCmds/MakePathFromCmds taken from PathKit, as were the tests
for those methods.
Bug: skia:
Change-Id: I9c52c04fe61e8934543a10f84ebf8b01b449f7f4
Reviewed-on: https://skia-review.googlesource.com/c/181565
Reviewed-by: Kevin Lubick <kjlubick@google.com>
I think this would only commonly happen for cases which files aren't
being loaded (debug asmjs), but could happen if multiple ready() calls
are made (which is discouraged).
Bug: skia:
Change-Id: If848aad8603f997661502563136ac590cc9a6d5a
Reviewed-on: https://skia-review.googlesource.com/c/181409
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Prior to this, CanvasKit was unintentionally a thenable, which means if
it was used to resolve a Promise, certain logic would be called which
would put it into an infinite loop. By adding a .ready() which returns
a proper Promise and removes the .then(), this should make the CanvasKit
libary safer.
For now, the .then() still exists unless .ready() is called. .then will
be removed unconditionally in 0.4.0 which will be out after all known
clients (e.g. jsfiddle.skia.org) are changed.
See: https://github.com/kripken/emscripten/issues/5820
Bug: skia:
Change-Id: Ie4093f6b0ce03070ef737941693b06dfff93f61c
Reviewed-on: https://skia-review.googlesource.com/c/181177
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Maybe one day we'll want to expose makeWebGLContext too, thus
it takes in the attrs as a configurable parameter.
Bug: skia:
Change-Id: Idb38f932b5ea6b364d823283b262e8508bff07c4
Reviewed-on: https://skia-review.googlesource.com/c/180776
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Just to clean things up a bit.
Bug: skia:
Change-Id: I0e34c148a92817084348fcf62d9f513887933cb3
Reviewed-on: https://skia-review.googlesource.com/c/180768
Reviewed-by: Florin Malita <fmalita@chromium.org>
This moves the shared logic into path2d.js from
canvas2dcontext.js.
Bug: skia:
Change-Id: Id63bc52a190109f7cbc4e17ddb5603e6e87d5dc0
Reviewed-on: https://skia-review.googlesource.com/c/178268
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
There's the barest hint of a "font manager" here.
Basically, nothing smart to deal with bold or fallbacks.
Maybe one day, we'll expose
SkTypeface* matchStyleCSS3(const SkFontStyle& pattern);
and do smart things for fallbacks, but for now that's not
in the immediate future.
Docs-Preview: https://skia.org/?cl=177067
Bug: skia:
Change-Id: Iaeabcbf5ff4511a01b37c16c983e447c25b0e3e7
Reviewed-on: https://skia-review.googlesource.com/c/177067
Reviewed-by: Ben Wagner <bungeman@google.com>
Instead of using the test font(s), now ship with a small
(100k) Monospace font. This can be disabled by:
compile.sh no_font ...
This saves about 350k (164k gzipped) in binary size.
Bug: skia:
Change-Id: I195e3b35bea86d0f096066c1c6a44a4b602571f3
Reviewed-on: https://skia-review.googlesource.com/c/176580
Reviewed-by: Ben Wagner <bungeman@google.com>
Rather than one monolithic file, we now have one monolithic
file (canvascontext2d) and several smaller files (one per class,
and some helpers).
This should make the code navigation a little easier.
Bug: skia:
Change-Id: Ia191c2db778591af21d2a6126f053c17c4f677f1
Reviewed-on: https://skia-review.googlesource.com/c/175996
Reviewed-by: Florin Malita <fmalita@chromium.org>
While working on this, I realized some things I did
caused winding to be inconsistent with what the Canvas
spec said (and with what Chrome did).
This CL includes 2 changes to remedy that:
- removal of the subpath (which added needless complication).
- re-write of ellipse() (to mirror Chrome's implementation).
Bug: skia:
Change-Id: Idd6c8a40b3c46598892e50a1e586f2ff66b801e3
Reviewed-on: https://skia-review.googlesource.com/c/175425
Reviewed-by: Florin Malita <fmalita@chromium.org>
Add Changelog to start tracking API changes (in preparation
for NPM)
Simplify globalAlpha passing.
API change:
- Make ImageShader take an SkImage instead of encoded bytes.
Bug: skia:
Change-Id: I716f001b54ed58da3f40ae4e060b7098b550af9f
Reviewed-on: https://skia-review.googlesource.com/c/175260
Reviewed-by: Florin Malita <fmalita@chromium.org>
This is similar to how Chrome does it - more or less unapplying
the matrix as it changes to keep everything in the same
coordinate space.
We still need to keep the matrix around for things and do the math
ourselves for things like gradients.
This simplifies a bunch of logic, which makes me happy.
Bug: skia:
Change-Id: I66ee379a501cc6701f51c0f0b51d4e0634a4a692
Reviewed-on: https://skia-review.googlesource.com/c/174843
Reviewed-by: Florin Malita <fmalita@chromium.org>
setMatrix -> _setMatrix with the hope of removing it
from the API (it breaks the save()/restore() model) and
replacing it with concat (which I'll try in a follow on CL).
Adds MakeImage for those times when a client has pixels
and needs to clip them (e.g. putImageData with 7 args).
This removes SkSurface._readPixels, which I might have
been holding wrong. It might get re-surfaced eventually.
Bug: skia:
Change-Id: Iee9a494db720b22e23f9e674b20ba678fad91d25
Reviewed-on: https://skia-review.googlesource.com/c/174300
Reviewed-by: Mike Klein <mtklein@google.com>
- Replace sk_memory_order with std::memory_order.
- Remove SkAtomic<T>.
SkPath was the only user of SkAtomic<T>, for its fConvexity and
fFirstDirection fields. I've replaced them with std::atomic types, and
funneled access to them through methods that enforce the relaxed memory
order like SkAtomic<T> did.
For fConvexity, we can use the exisiting setConvexity() and
getConvexityOrUnknown() methods, adding a private const setConvexity()
to mutate convexity from const methods. For fFirstDirection I've added
private setFirstDirection() and getFirstDirection() methods.
Removing SkAtomic<T> means SkAtomics.h no longer needs SkNoncopyable.h.
I've had to update a bunch of other headers that were depending on
transitive inclusion.
Change-Id: Ib238be71a121519db6e970a9a8955834e1298c87
Reviewed-on: https://skia-review.googlesource.com/c/174220
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Firefox is the only browser that supports WASM+Source maps
so it's only really useful there.
It allows for profiling to see where time is speant, even
down in the C++ calls. (see the below comment for a screenshot)
Bug: skia:
Change-Id: Ie0380bae9fdea45e1652dd7d2d8036f242087d33
Reviewed-on: https://skia-review.googlesource.com/c/174101
Reviewed-by: Mike Reed <reed@google.com>
Add a MarkerObserver interface (to replace the current
AnnotationObserver), and update CustomPropertyManager to intercept both
properties and markers.
TBR=
Change-Id: If79de419066916bc596316f0a551c75564069239
Reviewed-on: https://skia-review.googlesource.com/c/173766
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Draw directly into an unpremul buffer (which is what Canvas's
get/putImageData is) and it speeds up Skottie animation by
about 3x.
Bug: skia:
Change-Id: Ie131276e3a675e0e5a35190da93f34d7469624e4
Reviewed-on: https://skia-review.googlesource.com/c/173644
Reviewed-by: Mike Klein <mtklein@google.com>
Refactors things inside to support both color
and gradient as _fillStyle/_strokeStyle.
Bug: skia:
Change-Id: I364ceb7d55c41e11161d5577dcd1611a592bbc29
Reviewed-on: https://skia-review.googlesource.com/c/173421
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Add a new (optionally-built) ManagedAnimation CK helper, and provide
accessors for color and opacity properties.
The new wrapper class can be used as a drop-in replacement for the existing
Animation.
Change-Id: Iab6b6be9c736697b4731722806b145cbd130ce73
Reviewed-on: https://skia-review.googlesource.com/c/173322
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This involves a refactor of how we deal with paint.
Now, we have a source-of-truth paint that is copied
and modified for each of fill/stroke/shadow.
Adds preliminary support for blend modes.
Most of what remains is text, images, and gradients.
Bug: skia:
Change-Id: I41806adeb7de4faa6c98a580c4f1de4e4a34a37d
Reviewed-on: https://skia-review.googlesource.com/c/173223
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This also exposes the ShadowUtils::drawShadow on Canvas,
even though it wasn't what was needed to duplicate
the Canvas effect.
Bug: skia:
Change-Id: I12276ef106244218e4827b7fcd7949c83cf13e5f
Reviewed-on: https://skia-review.googlesource.com/c/172967
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This re-works the subpath model and does transforming
of ports in JS rather than in C++; the latter was not easy
to conform to the Canvas Spec, especially for changing
transforms in the middle of a path.
Additionally adds jpeg to the available images it can produce.
Bug: skia:
Change-Id: I5a52ec341d4060198c8680aa4d3b85a26f77b6b9
Reviewed-on: https://skia-review.googlesource.com/c/172500
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Made addPath take one more arg to allow for append/expand
(which makes emulating the HTML canvas easier).
Add Gold test for various lineTo/pathTo, etc.
Make CanvasKit.Color() choose a better value for alpha
when omitted (was 0, should be 1).
Add some parsing logic to deal with colors/font sizes.
Fonts are going to be rather complex it seems.
Moves some arc-related logic to the JS side, (although
this should preserve the behavior of CanvasKit.arc() to
behave like the Canvas implementation)
Make Examples and tests to a side-by-side comparison to
HTML canvas where applicable.
Add a Changelog for PathKit. There was a bug (I thought), but
turns out I was wrong. The Changelog will be for future
bug fixes.
Bug: skia:
Change-Id: I1bd603fdb518232604b098e24543e3453015b504
Reviewed-on: https://skia-review.googlesource.com/c/170446
Reviewed-by: Kevin Lubick <kjlubick@google.com>
These changes expose the arc function for SkPath. The ApplyAddArc function is a copy from the PathKit bindings.
Also exposed the PNG and JPEG formats from the SkEncodedImageFormat enum and the SkImage::encodeToData overload that accepts format and quality options. The direct binding of encodeToData was replaced with a pre-js wrapper that calls the appropriate private overload
We are working on a PostCSS conic gradient polyfill plugin and want to use the CanvasKit to generate it.
Problem is - it lacks the arc function that technically exists but isn't exposed. And it would be really great to have encodeToData with options since generated PNGs are quite large.
More details on the issue can be found here: https://github.com/jonathantneal/postcss-conic-gradient/issues/10R=kjlubick@google.com
Bug: skia:
Change-Id: I3f1dc88ad308369fe62004080bcc196c4fbbf742
Reviewed-on: https://skia-review.googlesource.com/c/171046
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This reverts commit 34d7a163a4.
Reason for revert: ok now?
Original change's description:
> Revert "simplify disabling effect deserialization"
>
> This reverts commit 5bbf790b5b.
>
> Reason for revert: flutter GN needs some love
>
> Original change's description:
> > simplify disabling effect deserialization
> >
> > Switch to a simple #define instead of conditional build targets.
> >
> > No one changes skia_enable_effects or skia_enable_effects_imagefilters,
> > so we can merge all that together back into :skia.
> >
> > Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7
> > Reviewed-on: https://skia-review.googlesource.com/c/169220
> > Reviewed-by: Kevin Lubick <kjlubick@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
>
> TBR=mtklein@google.com,kjlubick@google.com
>
> Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/169222
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,kjlubick@google.com
Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Release-Flutter_Android
Change-Id: I534346c3ef3561a871f1af6df976bfee0b48014a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/169640
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 5bbf790b5b.
Reason for revert: flutter GN needs some love
Original change's description:
> simplify disabling effect deserialization
>
> Switch to a simple #define instead of conditional build targets.
>
> No one changes skia_enable_effects or skia_enable_effects_imagefilters,
> so we can merge all that together back into :skia.
>
> Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7
> Reviewed-on: https://skia-review.googlesource.com/c/169220
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,kjlubick@google.com
Change-Id: I3b818418d303dbc6d2a926a19df64a68499f0ec3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/169222
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Switch to a simple #define instead of conditional build targets.
No one changes skia_enable_effects or skia_enable_effects_imagefilters,
so we can merge all that together back into :skia.
Change-Id: I2985f95ee89149ddc687dc31f4c6bf35cb3a93c7
Reviewed-on: https://skia-review.googlesource.com/c/169220
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This should make the logs in the bots more actionable by showing
the error and trace.
This also fixes the API change causing mysterious red.
Bug: skia:
Change-Id: I38df2bb4557041f8bdfefcae5c8d95b58e770033
Reviewed-on: https://skia-review.googlesource.com/c/168180
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This also does some clean up to how we name enums - the caps felt a bit
obnoxious. CAPS are reserved now for constants (like colors).
Small bug fix with leaking memory on discrete path effects
This also adds a few more things from PathKit
Bug: skia:
Change-Id: Iad7e21ac36d35a36a8b255dc82b1dcc886344db1
Reviewed-on: https://skia-review.googlesource.com/c/166804
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Bug: skia:
Change-Id: I4b7e512e6ee8e4da4ab96924acc034355ae6b8bf
Reviewed-on: https://skia-review.googlesource.com/c/167101
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Still to come, actually exposing drawVertices, and the
other APIs needed.
Had to re-make all the jsfiddles because of an API change
in a previous CL.
Docs-Preview: https://skia.org/?cl=166444
Bug: skia:
Change-Id: I4d4825f6e7b073d6792ab8d99d5117df860d4815
Reviewed-on: https://skia-review.googlesource.com/c/166444
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
There were two copies of a Nima "player" and this moves them out of
samplecode/ and viewer/ to experimental/ where it is a bit more
accessible (e.g. for WebAssembly).
Bug: skia:
Change-Id: I05419a352f0d13d16b462a374578107513eb1243
Reviewed-on: https://skia-review.googlesource.com/c/166441
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Takes about 20kb off uncompressed size, 8kb gzipped.
Also turns off AAA and DAA on CPU builds (already off on GPU)
Bug: skia:
Change-Id: I708038394b61cc8eb7944d5ad1a3bb494db6c719
Reviewed-on: https://skia-review.googlesource.com/c/165100
Reviewed-by: Mike Klein <mtklein@google.com>
I can probably write most, if not all, of a Canvas API in
JS using the SkCanvas and SkPaint objects. This lets us expose
the fancier API and optionally have a more familiar API.
This is controlled at compile time, i.e. bring in the extra
JS or not.
There is still plenty of the API that needs working, but
this is meant to outlay the plans of where this is going.
Bug: skia:
Change-Id: I2e36a33c24c2bacd52811dc85508dba170ab0dd7
Reviewed-on: https://skia-review.googlesource.com/c/163490
Reviewed-by: Mike Reed <reed@google.com>
This trims about 260k uncompressed, 88k gzipped
Bug: skia:
Change-Id: I8c51a7929c0cf1387df88fcb77d90ada54c48bcb
Reviewed-on: https://skia-review.googlesource.com/c/163487
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Especially on the very first load of the wasm binary,
this has been seen to sometimes timeout.
Bug: skia:
Change-Id: I9321eb1e2f70751a1dbbaee3c1e54d38f5bea450
Reviewed-on: https://skia-review.googlesource.com/c/163247
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Removes about 120k uncompressed, 40k gzipped
Bug: skia:
Change-Id: I7e0b404f18fc3c6d4ff6b01d2c9bcd657b7d5e07
Reviewed-on: https://skia-review.googlesource.com/c/163246
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Of note, the perf results reported are not directly
comparable CPU->GPU because the GPU ones are likely
emulated (no real gpu in the Docker container on an
GCE VM).
Bug: skia:
Change-Id: I52259085f4d9e22c45b67f3e8ce1211a5c6c6d3e
Reviewed-on: https://skia-review.googlesource.com/c/163126
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:
Change-Id: If7f5eaf19fd268613ac883b268b424ca84b9be00
Reviewed-on: https://skia-review.googlesource.com/c/162660
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Basically no hoops to jump through - the same binary
that works in the browser works in Node.
Tested locally with Node 8.9.3.
This aligns the GPU and CPU APIs (that is, makeSurface)
and breaks out the GPU/CPU js interface parts into
their own files. We only need one of them and we know
which at compile time.
Bug: skia:
Change-Id: I6d141387403a792d2374cf904872c6dbc999abfb
Reviewed-on: https://skia-review.googlesource.com/c/162746
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Also make a CPU only and GPU only build (although
the latter still has a lot of CPU logic).
Bug: skia:
Change-Id: I857c2300021c2adb5344865c28e4ad3e8d332954
Reviewed-on: https://skia-review.googlesource.com/c/162022
Reviewed-by: Kevin Lubick <kjlubick@google.com>
One less SkCanvas subclass to deal with...
Change-Id: I21e81648026be5d732e8d9a28baed55015492a04
Reviewed-on: https://skia-review.googlesource.com/c/161584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This reverts commit 0a0304c426.
Reason for revert: Breaking metal
Original change's description:
> Add experimental API to draw a set of SkImages in one SkCanvas call.
>
> The client provides a src and dst rect for each image as well as
> a bitfield that indicates whether each edge of the image should be
> antialiased. This per-edge AA is useful for tiled compositors.
>
> Rather than take a full SkPaint this API only takes an alpha, a filter
> quality (which is pinned to kLow), and a blend mode. This is a likely
> point of future evolution.
>
> Currently the API is only fully implemented for kSrcOver on the GPU
> backend. With other blend modes or on other backends AA will be ignored
> for images that do not have all four edge AA flags set.
>
> BUG: skia:8444
>
> Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
> Reviewed-on: https://skia-review.googlesource.com/c/159062
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,bsalomon@google.com,brianosman@google.com,reed@google.com
Change-Id: I815baaeee5de9c6722cf2b9d071a8e2f7c1b6a96
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/161622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The client provides a src and dst rect for each image as well as
a bitfield that indicates whether each edge of the image should be
antialiased. This per-edge AA is useful for tiled compositors.
Rather than take a full SkPaint this API only takes an alpha, a filter
quality (which is pinned to kLow), and a blend mode. This is a likely
point of future evolution.
Currently the API is only fully implemented for kSrcOver on the GPU
backend. With other blend modes or on other backends AA will be ignored
for images that do not have all four edge AA flags set.
BUG: skia:8444
Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
Reviewed-on: https://skia-review.googlesource.com/c/159062
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This also makes the GPU and Skottie portions optional
at build time.
Bug: skia:
Change-Id: I34f494caf0e2ca35dc4767d57f79ba92b24e818f
Reviewed-on: https://skia-review.googlesource.com/c/159146
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This can reduce code size where CCPR is not supported (e.g. WebGL 1.0)
Drops 130k uncompressed, 50k compressed.
Bug: skia:
Change-Id: I8af7e681e1f3520a18e0c0d55e318dcf88206584
Reviewed-on: https://skia-review.googlesource.com/c/161041
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Building CanvasKit uses very similar logic to PathKit, so there
was a fair amount of copy/paste/customize.
Fixes the name of skia.js/wasm -> canvaskit.js/wasm and
adds a package.json to formally track versions.
Also move PathKit helper scripts to align better.
Docs-Preview: https://skia.org/?cl=160463
Bug: skia:
Change-Id: Ie75b30592dcc4d520dca41f6f5579006aaa8849b
Reviewed-on: https://skia-review.googlesource.com/c/160463
Reviewed-by: Eric Boren <borenet@google.com>
Updates example to use text (and be more mobile friendly).
Also make the compile step a bit nicer and remove SKOTTIE_HACK.
Docs-Preview: https://skia.org/?cl=158664
Bug: skia:
Change-Id: I4c465482058ad7d359729a492e29205c07f3933e
Reviewed-on: https://skia-review.googlesource.com/c/158664
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Nothing's using it except test tools.
I'd like to make that a bit clearer by getting it out of src.
Disabled the fuzzer.
Removed the bench so Android's building nanobench doesn't block this.
Bug: chromium:886713
Change-Id: I761f52c40171c27ff4b699409b32647e84684ec3
Reviewed-on: https://skia-review.googlesource.com/156240
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This adds one more skottie example and spruces up
the demos a bit (including making the star only
respond when you hold down the mouse)
No-Try: true
Docs-Preview: https://skia.org/?cl=156141
Bug: skia:
Change-Id: Ib577d6c06bd9784f4566d506150c451beadf1f1c
Reviewed-on: https://skia-review.googlesource.com/156141
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
PathOps added a cheat some time ago to reduce
fuzzer bugs by scaling down very large paths,
with the hope that it would make the math more
sane.
This had the side-effect of causing small edges
to disappear altogether if the bounds is large
enough.
Removing the scaling causes a single regression to
one fuzz-generated bug. That path succeeeded with
scale by eliminating the troublesome tiny contour.
Eliminating the scale may fix the CCPR-related bug
discovered by Flutter, or at least uncover the next
bug.
I would expect more fuzzer bugs to appear with
this change; paths with large and small values will
no longer have the small values removed.
R=csmartdalton@google.com,reed@google.com,bsalomon@google.com
Bug: skia:8290
Change-Id: I3bfdb101c568e9cfa324858685eac1f9c368c291
Reviewed-on: https://skia-review.googlesource.com/150465
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Breaking Changes (should be minor, as it's mostly just things
for testing):
- PathKit.ApplyPathOp should have returned a new SkPath, but didn't.
It now does and is named "MakeFromOp", which makes the convention of
"Have 'make' in name, needs delete" more consistent.
- PathKit.FromCmds(arr) now only needs to take the JS Array and
will handle the TypedArrays under the hood. If clients want to deal
with TypedArrays themselves, they can use _FromCmds(ptr, len) directly.
- PathKit.MakeLTRBRect is now just PathKit.LTRBRect. The thing
returned is a normal JS Object and doesn't need delete().
As per custom with v0 apps, we are updating the minor version
to v0.3.0 to account for breaking changes.
Docs-Preview: https://skia.org/?cl=147960
Bug: skia:8216
Change-Id: Ia3626e69f3e97698fc62a6aee876af005e29ffca
Reviewed-on: https://skia-review.googlesource.com/147960
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Consolidates the karma files into one for docker/asmjs/wasm and all
combinations.
The asm.js build seems to have some small imprecisions that we didn't
see as much as with WASM, probably due to JS limitations/differences
to c++'s floats.
To address these, I've marked some (5) tests in PathOps* as flaky
because they fail on Release, Debug or Test versions of the asm.js build.
Other then that, asm.js seems basically identical to the WASM.
WASM is much smaller, 416k vs 877k and seems to load faster (not
measured).
Note to reviewers:
example.html was copied from npm-wasm version, so doesn't need
further review.
Bug: skia:8216
Change-Id: Ib92b90fa6c598de85a0be319d46b25693ae5aaa4
Reviewed-on: https://skia-review.googlesource.com/148396
Reviewed-by: Stephan Altmueller <stephana@google.com>