For API simplicity, if the rectangle is to be omitted, the client
should only provide the paint. (emscripten already does parameter
count checking, so let's use that instead of doing it ourselves).
This also adds tests to help verify the new behavior.
Revert "Revert "Allow null rect for saveLayer""
This reverts commit 7957d53c80.
Bug: skia:10043
Change-Id: I9ed8caabbfc77deab1ca3d9b1a415489e012528f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277399
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Dan Field <dnfield@google.com>
Flutter on the web wants to be able to extract arbitrary frames from
an animated image and pass those into functions like:
drawAtlas, drawImage, drawImageRect
This should allow that to happen w/o having to add lots of variants like
drawAnimatedImage. If this sticks, is drawAnimatedImage still useful?
(maybe it saves a copy?)
Change-Id: I99d7045c5dea61d0a1bd6d335c88e7517f2c4fc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263020
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Moves RTShader to be built behind a flag (and not shipped
to npm [yet])
Bug: skia:9733
Change-Id: Ibdf965bbf3c0191ab7d9689168b1a099488c2ca3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262142
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
This fixes up some other build flag options:
- font-specific js code is correctly omitted when no_font is set
- SKP serialization is only compiled in debug (or with flag).
Bug: skia:9733
Change-Id: Ifdbd2ddac278cfcefa842f6d4826d5429b6ed64b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262137
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Change-Id: I0b11d4210c6e663cfb4854fc33e1396fd79fe9a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bundling the pipeline stage arguments also simplifies the code in
several spots.
Change-Id: I85e81b436a39378f753cc9404b6eeb27fe055525
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261778
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This makes the effect *be* the factory, so we can get rid of
SkRuntimeShaderFactory (and later, SkColorFilterFactory).
Change-Id: I2cd95f1380a0ec1e65fe5a18b1226c042598a8bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261439
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SkShaders::Empty may be easy to expose, but that doesn't mean we should.
It shouldn't even be public, but Chrome uses it in one place.
Change-Id: I398a5e6f782990a7baec0d9b1d0018f7456ff15f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260956
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Turns out constant doesn't like to take an enum, but needs explicit
coercion to be an int.
Change-Id: I29c761fd2dfd9eb3cde0db3c0c3f0e97dd6ff411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260698
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: Ib6dc1ff861efe4040508fea09c8a66d8d06db597
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258568
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 3e7af41224.
Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This reverts commit 1792b19485.
Reason for revert: need to update legacy_convexity, still used by google3
Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
>
> This reverts commit 0dacc6b7d3.
>
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=reed@google.com
Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 0dacc6b7d3.
Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit e0fbe94351.
Reason for revert: need to add guard flag to flutter
Original change's description:
> Use flat version of path-direction enum
>
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
TBR=fmalita@chromium.org,reed@google.com
Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
We hadn't been requesting one, but told Skia we had one, which caused
issues.
Bug: skia:9564
Change-Id: I9a2e78a528778a386225cdcbbb2d2b3d8f705f05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254801
Reviewed-by: Brian Salomon <bsalomon@google.com>
With these things exposed, I think Flutter will not need
CanvasKit to expose the very complex SkCodec API.
Change-Id: Iace1b496d1dcb8842181466e860e8f212aba7b48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253542
Reviewed-by: Leon Scroggins <scroggo@google.com>
Like with the non-relative forms, we want to be able to
chain these together, but not leak the SkPaths (which happens
if the C++ side returns this). Thus, we have to add in
the JS glue to return the "JS this".
Change-Id: Ic640b84f6c09c1d931ad44bc403b14bb0d0893a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251960
Reviewed-by: Hal Canary <halcanary@google.com>
It was easier to just add a few saveLayer overrides rather
than try to expose the struct of pointers. SkRect*
was hard/impossible because we have it as a value_object,
which does not support pointers in enscriptem.
Change-Id: Iad702593cca19f80d6ef9a319f8c80a087135e38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
We are pretty comfy exposing this set for the long-term.
CanvasKit will generally support chains of image filters,
not necessarily arbitrary DAGs, just to simplify the
points needed to expose.
Change the naming around MaskFilters also, I like having
the factories be a class function, just to keep things
a bit better organized and minimize the amount of things
we want to keep on the top level CanvasKit object.
Change-Id: If32c630efa2fd8bc4bac84d0c3461ac3c0d21263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250758
Reviewed-by: Robert Phillips <robertphillips@google.com>