Commit Graph

168 Commits

Author SHA1 Message Date
Nathaniel Nifong
a3aa601ea6 Add a canvas test to make and draw SkVertices
Change-Id: I54647b84e0ee0e13cf3041e9340120a6aca89d08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275997
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-03-09 20:28:48 +00:00
Leon Scroggins III
a77f30c7db Reland "Split building encoding from decoding"
This reverts commit 9d4b788807.
Copyright issue has been fixed in
https://skia-review.googlesource.com/c/skia/+/275998.

Original description:
Bug: skia:9756

In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.

Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.

Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.

Change IsPng signature to match other SkCodecs.

TBR=djsollen@google.com

Change-Id: Ic847bae0154e0a2922100b3f2ee14a077ee5635a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276007
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-03-09 20:21:19 +00:00
Nathaniel Nifong
c8f95e27c4 Fix deprecated names
Change-Id: I40756339e3ef61f05da2b0df510318ff4329c8ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275999
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-03-09 17:06:18 +00:00
Nathaniel Nifong
d96c3c78e7 Add shader makers to SkShader externs
Bug: skia:9843
Change-Id: I98ba2e41563b8b3dcec523ae7a2340b9aacfec2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275963
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-03-09 15:22:28 +00:00
Nathaniel Nifong
4cf2ab6ffe JS files to support running jasmine tests in google3
accompanied by cl/299139086

Change-Id: I9d05aab8171313d2efd2f47c0007b716e4f5a76e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275763
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-03-09 14:20:27 +00:00
Mike Klein
9d4b788807 Revert "Split building encoding from decoding"
This reverts commit 94aaf7cdf5.

Reason for revert: you know what I already typed the reason stop making rules that people have to follow, robots.

Original change's description:
> Split building encoding from decoding
> 
> Bug: skia:9756
> 
> In CanvasKit, a large part of the binary is for encoding. Clients
> would be happier with a smaller binary and no webp/jpeg encoding. Make
> this an option by splitting up the GN arguments.
> 
> Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
> existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
> PNG.
> 
> Update CanvasKit compile script to disable webp and jpeg encoding.
> Update debugger compile script to disable all encoding.
> 
> Change IsPng signature to match other SkCodecs.
> 
> Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Nathaniel Nifong <nifong@google.com>

TBR=djsollen@google.com,scroggo@google.com,kjlubick@google.com,nifong@google.com

Change-Id: I4fc2ea916743fda7e7d0d668b59e52052e880104
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275710
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-03-06 21:39:21 +00:00
Leon Scroggins III
94aaf7cdf5 Split building encoding from decoding
Bug: skia:9756

In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.

Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.

Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.

Change IsPng signature to match other SkCodecs.

Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-03-06 18:50:40 +00:00
Nathaniel Nifong
7e46b14d84 Replace red line skp with a prettier example
https://screenshot.googleplex.com/QqfxdSfccZD.png

Change-Id: Id7328beec06c54593a2f144dc4cd048442d9b443
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272059
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-06 16:15:08 +00:00
Kevin Lubick
a093cffed2 [canvaskit] Fix shadow bugs
This also adds a helper option to writing canvas2d spec tests
to see the CanvasKit option side by side with the real canvas
version.

Bug: skia:9940, skia:9947
Change-Id: Ia8fc4e1332d3896933b86291181bc3ba890d26ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275618
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-06 16:14:20 +00:00
Nathaniel Nifong
6066a0c2bd Remove all uses of bones
Change-Id: I302f43484c599a05e077545df5f053a89d63a6a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275079
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-05 18:47:38 +00:00
Nathaniel Nifong
23b0ed9480 Name name changes suggested in API review
Bug: skia:9843
Change-Id: Ib7e30a129dff17ecde81daa1ff665304908face3
Docs-Preview: https://skia.org/?cl=275048
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275048
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-03-05 15:13:41 +00:00
Nathaniel Nifong
628f3e70ee Remove experimental from name of skm44 canvas methods
Change-Id: If275ede5049b74c0c4c36eb5ac5697ec63737228
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275047
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-04 21:36:18 +00:00
Mike Reed
5caf9358c3 remove bones from SkVertices
Bug: skia:9984
Change-Id: I7c4f33ee82087eb1b0a60243183f0c68e310f10d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274547
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-02 20:30:59 +00:00
Kevin Lubick
79e41e7063 [canvaskit] Roll to v0.13.0
Change-Id: I4ff4e7549f0eeb15fe66755f3da26c15f51bf8f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274052
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-28 19:27:22 +00:00
Kevin Lubick
bde9fcce15 [canvaskit] Precise font measuring
Bug: skia:9864
Change-Id: I097ca54b55e0864a7659fa1c3a05ea7f02811aed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273297
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-02-28 13:36:34 +00:00
Nathaniel Nifong
f106bc27a4 Add SK_NO_FONTS check around font uses in skottie
Prerequisite to cl/297131877

Change-Id: Icd58c69fd53b703e43d67f4a1a9bafe096943edc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273765
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-02-27 20:50:16 +00:00
Nathaniel Nifong
19304d88c8 Move all canvaskit example resources to CDN
Change-Id: I92c83051017648d5703b06daac77e99ff40aeb2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273000
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-24 21:54:47 +00:00
Kevin Lubick
9279798022 [canvaskit] Expose releaseResourcesAndAbandonContext on GrContext
Bug: skia:9910
Change-Id: If0a6aa106d42c680f1f0f3092c4a4dbd0f04c937
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270936
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-02-24 17:11:28 +00:00
Nathaniel Nifong
cc5415a8ce Modify 3D example with light and bump shader.
Depends on what I assume the final version of https://skia-review.googlesource.com/c/skia/+/272646 will be
Change-Id: I53485c5f47e0fef120c8a1bd6d0620fddfb3cde9
Bug: skia:9866
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272529
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-24 12:46:35 +00:00
Mike Reed
9e8f605344 SkM44.h is now in include/public
Change-Id: I679d3328a65123d4cbb15045d98fe4ac498ee531
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272837
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-22 16:43:56 +00:00
Kevin Lubick
ecd8762e1f [canvaskit] Support children shaders into runtime shaders
Change-Id: I88106babe35f6e5b3ee764e7fbaf82c7f43d136d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272646
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-02-22 12:38:52 +00:00
Nathaniel Nifong
77798b4585 Expose 4x4 matrices on canvas in a way similar to SimpleMatrix, add example.
Bug: skia:9866
Change-Id: I718455743e482e4f60a462027b629dc19b1dbad3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270201
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-22 00:12:13 +00:00
Kevin Lubick
f8f9cd84fa [canvaskit] Expose bindings to particles uniforms.
Uniforms in the general case can be multiple floats, so
we expose a small struct to provide information about all
uniforms (including the built in ones like "dt") as well
as effectUniforms and particleUniforms which return Float32Arrays
bound to the WASM memory containing those unifroms.

Thus, by modifying the Float32Array, one can directly affect
the particle/effect properties.

This allows us to expose sliders on particles.skia.org
(https://skia-review.googlesource.com/c/buildbot/+/272398)

Change-Id: Ie390f3d2dc571ee4ebaab59a7fa1b7b2dc24d871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272377
Reviewed-by: Brian Osman <brianosman@google.com>
2020-02-21 14:43:01 +00:00
Kevin Lubick
392846665c [canvaskit] Expose parseColorString
This is handy for interacting with <input type=color>

Change-Id: I7946c08ef10a2481016885d58cc52f76f5cd40e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272344
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-21 12:43:15 +00:00
Brian Osman
7353dc5490 Change SkSL main() from (float x, float y) to (float2 p)
Change-Id: Id046199edd63535ef07e1dfa65fbc7c0f8cefd00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269371
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-07 20:19:13 +00:00
Nathaniel Nifong
25cf469a11 Move Make functions for corner and discrete path effects into namespaces.
Deprecates MakeSkCornerPathEffect in favor of SkCornerPathEffect.Make
Deprecates MakeSkDiscretePathEffect in favor of SkDiscretePathEffect.Make

Bug: skia:9843
Change-Id: I5a5b79838d1212605c6cb0b124dc0eabde8a4b4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268629
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-02-04 19:48:04 +00:00
Kevin Lubick
6e1320da6b [canvaskit] Fix flaky test
We accidentally were not waiting until all font files were loaded before
trying to process them.

Bug: skia:9858
Change-Id: I10decd5fbf0aa46e300d2ce5255f24f1ac1c12d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268626
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-02-04 17:50:35 +00:00
Kevin Lubick
dc49b0ca98 [canvaskit] Fix support for fonts with CFF
Adds a test to load different font types. Currently supported:
 - .ttf
 - .otf
 - .ttc

Not supported:
 - .woff
 - .woff2

This only increases code size by ~4kb, so that big glyph table
has still been successfully removed.

Bug: skia:9829
Change-Id: I0231578b2abf4f36df57ff8073b7697d16606373
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267180
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-01-29 12:39:55 +00:00
Kevin Lubick
f76da63fbd [canvaskit] Update build script to support latest Emscripten
Add workaround for https://github.com/emscripten-core/emscripten/issues/10072

Note to reviewer, please check out the steps I added
in canvaskit/README.md to document this process.

Bug: skia:9816
Change-Id: Idbe7ff08ac62f4f4d70e656384831b8d24c4a684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266941
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-28 15:41:58 +00:00
Kevin Lubick
52379335eb [canvaskit] Fix test for drawOnce
I belatedly realized that drawOnce's test would always be blank now
that drawOnce is async.

Change-Id: If30bbdd895039bd8de050a59dd348ba6849c5835
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266631
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-27 15:11:34 +00:00
Bryce Thomas
2c5b856a7f Add drawOnce() API to SkSurface.
The existing |SkSurface.requestAnimationFrame| API provides a convenient way of
drawing Skia animations using the same idiom as the well known
|Window.requestAnimationFrame|.  It gracefully handles providing the caller with
access to the right canvas, as well as flushing after the user-supplied
callback.

The new |SkSurface.drawOnce| API added in this change provides the same
conveniences around access to the right canvas and flushing, but for the
use-case where the user wishes to draw a single frame only.  Importantly, this
new API disposes of the SkSurface upon completion, i.e. frees the memory
associated with the underlying pixel storage an surface.  This avoids memory
leaks that occur when |SkSurface.requestAnimationFrame| is used for single-frame
purposes.

Bug: NONE
Change-Id: Ic4e48e65dffc4809513ceaf72260ac0432b98952
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265604
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-27 13:45:47 +00:00
Kevin Lubick
4ca0dacbce [canvaskit] Roll to 0.12.0
Change-Id: I306f18b49574d264fa7091112a77dea158d8967a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265959
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2020-01-22 20:35:54 +00:00
Kevin Lubick
a538e46d5f [canvaskit] Fix color opaqueness
Bug: skia:9800
Change-Id: I61d50df47467dbcee6d90fd636749a4d19c4da8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265957
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-22 20:35:54 +00:00
Kevin Lubick
319524ba72 [canvaskit] Fix colorType bug
Bug: skia:9788
Change-Id: I1c7eeefb0e2883edc9095599ff2f10e8419f54c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265956
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-22 20:35:54 +00:00
Kevin Lubick
486aecf130 [canvaskit] Make font names programmatically accessible
Change-Id: I384e4f37fa274665438b523f0636bfc1856ec0ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264574
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-01-17 14:18:09 +00:00
Bryce Thomas
1fa54044ef rm CanvasKit.HEAPU8.buffer caching (fix UAF bug).
Cached references to the WASM heap buffer are invalid following memory growth:
https://github.com/emscripten-core/emscripten/issues/6747#issuecomment-400081465.
This change replaces references to the cached CanvasKit.buffer with direct
references to CanvasKit.HEAPU8.buffer.  The symptom of this bug is a Javascript
error thrown in the Chrome console: "Uncaught TypeError: Cannot perform
Construct on a neutered ArrayBuffer", causing the operation in question to fail.

Bug: NONE
Change-Id: I27462e80db1d33e0e77ee7295b25039c9036d2e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264477
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-15 14:48:36 +00:00
Kevin Lubick
a4f218dd68 Add support for reading .skp files in CanvasKit.
Bug: skia:9760
Change-Id: Ifecd819a0e4b6b8f8818ce593afd546e10c36df3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262159
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-15 14:46:37 +00:00
Kevin Lubick
032aa72178 [canvaskit] Roll to 0.11.0
Built at f72e48dd2f

Change-Id: I4f8a37b7027621234547e159c3fdb173abdf083d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263574
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-10 17:22:39 +00:00
Kevin Lubick
f5bc8fba95 [canvaskit] Create an SkImage from a frame of an SkAnimatedImage
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>
2020-01-09 13:25:43 +00:00
Kevin Lubick
a4c4c3cd9f [canvaskit] Add webp support
I had thought this was in, but I guess not.

Oof, this adds 328kb of code size (131kb gzipped).

About 2/3 of the code added is due to encoding, which
we'd like to do away with.
(see https://bugs.chromium.org/p/skia/issues/detail?id=9756)

Change-Id: Ia2bd80c70ec9fb80cdc52052049fd4526ba7eeef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262928
Reviewed-by: Hal Canary <halcanary@google.com>
2020-01-08 18:10:16 +00:00
Kevin Lubick
08bf8f79f1 [canvaskit] Remove support for T1 fonts and reduce code size
We were previously building FreeType2 with the psnames module,
which included large tables of glyphnames [1]. These were only
used in code related to PDF (and only when outputting Type 1
fonts, which is very rare).

Even though the PDF backend isn't in CanvasKit, the compiler
couldn't throw away these massive tables (about 80k in all)
of strings. Since these tables were only used for T1 fonts,
it made sense to tell FreeType not to include the rest of the
T1 related code, which saved about 55k more.

If, one day, we add in support for the PDF backend to CanvasKit,
SK_PDF_DO_NOT_SUPPORT_TYPE_1_FONTS is likely something we'll
want to define.

The roll-freetype.sh is inspired by a script of the same name
in the Chromium repo and aids in the updating of freetype
and our forked config files.

[1] 0a3d2bb99b/src/psnames/pstables.h (629)

Bug: skia:9733
Change-Id: I359bab4184587cbe91400661fb012eac1a601a83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262232
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-01-06 18:49:41 +00:00
Kevin Lubick
dbc53a8af3 Make tracing data a compile-time option
This saves about 32kb uncompressed, 21kb gzipped from CanvasKit.

This would also save about 11kb from a Flutter build.

Bug: skia:9733
Change-Id: I0a21b7279a73c692ea39aa28ac00d70d24b70373
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262218
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-01-06 18:37:13 +00:00
Kevin Lubick
31f2df0420 [canvaskit] Update test to use correct metrics
Followup from https://skia-review.googlesource.com/c/skia/+/260778

Change-Id: I3faf8aa527d8cc356a0d298aac815ac11203a2aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262219
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-01-06 15:28:36 +00:00
Kevin Lubick
f3d6c36de3 [canvaskit] Add npm release target to ship smaller binaries
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>
2020-01-06 13:13:06 +00:00
Kevin Lubick
933ea8c301 [canvaskit] Add build flag for pathops
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>
2020-01-06 13:10:43 +00:00
Brian Osman
524360e9e4 Tweak the CanvasKit interface to SkRuntimeEffect
Feedback from https://skia-review.googlesource.com/c/skia/+/261439

Change-Id: I5c5b8c11e59bea11b2dbe4ee08f903dd3961ba89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261999
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-01-03 16:00:27 +00:00
Brian Osman
ee426f223f Move SkRuntimeEffect.h to include/effects
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>
2020-01-02 17:37:46 +00:00
Kevin Lubick
b6a3b7db70 [canvaskit] Update compile.sh with initial code size findings
make profile can be used with bloaty [1] and twiggy [2]

Some example commands for investigating code size:

    bloaty ./canvaskit/bin/canvaskit.wasm -d symbols
    bloaty ./canvaskit/bin/canvaskit.wasm -d sections

    twiggy top -n 50 --retained ./canvaskit/bin/canvaskit.wasm
    twiggy monos ./canvaskit/bin/canvaskit.wasm -g -m 40
    # Let's pretend we have a symbol called
    # AddIntersectTs(SkOpContour*, SkOpContour*, SkOpCoincidence*)
    # that we want to investigate further
    twiggy dominators --regex ./canvaskit/bin/canvaskit.wasm AddIntersectTs.+
    twiggy paths --regex ./canvaskit/bin/canvaskit.wasm AddIntersectTs.+


[1] https://github.com/google/bloaty
[2] https://rustwasm.github.io/book/reference/code-size.html#the-twiggy-code-size-profiler

Bug: skia:9733
Change-Id: I4a665fe2c750da552fee1dbf804ce0028a06c6c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261903
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-01-02 14:05:45 +00:00
Bryce Thomas
0d423a60eb Add instructions for compiling CanvasKit and viewing example page.
Bug: NONE
Change-Id: I135d8a341a10e9cda13b0b49518375acb838080f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261825
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-02 13:04:27 +00:00
Brian Osman
107c66669d Make it safe to include SkRuntimeEffect.h from client code
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>
2019-12-30 21:06:56 +00:00