Commit Graph

176 Commits

Author SHA1 Message Date
Brian Salomon
00ba5ef4a6 Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"
This reverts commit f6784a8c84.

Reason for revert: breakage of builds

Original change's description:
> Don't build GL on Metal, Vulkan, Dawn, Direct3D bots
> 
> Misc fixes to omit GL-dependent targets and fix assumptions that
> SK_SUPPORT_GPU implies SK_GL.
> 
> Bug: skia:10051
> Change-Id: Ida88ac3f1bf4d9e23f66d0700c2bce18b938ed6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277456
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: I4e02f675fd8820ed3c8efee192c64e570a23c3e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10051
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-03-18 14:42:28 +00:00
Brian Salomon
f6784a8c84 Don't build GL on Metal, Vulkan, Dawn, Direct3D bots
Misc fixes to omit GL-dependent targets and fix assumptions that
SK_SUPPORT_GPU implies SK_GL.

Bug: skia:10051
Change-Id: Ida88ac3f1bf4d9e23f66d0700c2bce18b938ed6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277456
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-03-18 14:26:28 +00:00
Kevin Lubick
beefcb9d38 Reland saveLayer can omit the rectangle argument.
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>
2020-03-17 17:38:54 +00:00
Kevin Lubick
7957d53c80 Revert "Allow null rect for saveLayer"
This reverts commit f2e9709266.

Reason for revert: Breaking the build

Original change's description:
> Allow null rect for saveLayer
> 
> Bug: skia:10043
> Change-Id: Ia049e72565810e1f72500141678e166027230535
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277097
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=kjlubick@google.com,dnfield@google.com

Change-Id: I0aae159380cbdfd4ead0f8e3e9c9de284c2dc103
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277182
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-03-16 18:08:45 +00:00
Dan Field
3d44f73b64 Sweep gradient support for CanvasKit
Change-Id: I04af9ea7aa6c6f95de6ff1eaf5ee41d59df7f09e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277059
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-16 16:57:03 +00:00
Dan Field
f2e9709266 Allow null rect for saveLayer
Bug: skia:10043
Change-Id: Ia049e72565810e1f72500141678e166027230535
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277097
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-16 16:46:12 +00:00
Mike Reed
ba96256581 hide getters so we can change the internals of SkVertices
Bug: skia:9984
Change-Id: Id8d8d568fb29b006d19079248c579282207279c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275692
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-13 12:08:12 +00:00
Nathaniel Nifong
2e307968fd Clean up Enums in Canvaskit
- Removed inverse filltypes
 - Removed StrokeAndFill Paint Style
 - Removed TextEncoding (all functions assume UTF-8)

Change-Id: Ie2824042b48b3dcefb41ef761bb3070df894da75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276099
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-03-10 15:17:20 +00:00
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