Commit Graph

12 Commits

Author SHA1 Message Date
Harry Terkelsen
223ffcdff9 Add more paragraph bindings to CanvasKit
Change-Id: Ib02b6504724e4d7cfa197a3508f8c0b84b4135bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313146
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Auto-Submit: Harry Terkelsen <het@google.com>
2020-10-04 12:56:57 +00:00
Kevin Lubick
d1285b131b Upgrade CanvasKit emscripten to version 1.39.16.
Changes are largely mechanical.  Non-mechanical changes to support newer
versions of emscripten are enumerated below, in format ${EMSCRIPTEN_VERSION}:
${RELEVANT_CHANGE}.

- 1.39.9: TOTAL_MEMORY has been renamed INITIAL_MEMORY.
- 1.39.12: passing of linker flags to wasm-ld has changed in a way that requires
  supplying `--no-entry` to avoid error message "wasm-ld: error: entry symbol
  not defined (pass --no-entry to suppress): main".
- 1.39.16: The factory function created by using `MODULARIZE` build option now
  returns a Promise instead of the module instance.  As such, the ready.js
  workaround is removed.  Note this is a breaking API change for CanvasKit,
  which now uses just `then()` and not `ready().then()`.
- 1.38.33: `emsdk install` hasn't required the `-64bit` suffix on version names
  since `1.38.33`, so we remove them.  E.g. `emsdk install sdk-1.39.6-64bit`
  simply becomes `emsdk install sdk-1.39.16`.

cf. https://github.com/emscripten-core/emscripten/blob/master/ChangeLog.md

Bug: NONE
Change-Id: Iabec4bd5ad7db2e0715ad42c2e4cf7d67b192b4c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291182
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-21 14:18:48 +00:00
Kevin Lubick
67c905ce6b Fixing a bug in SkOpEdgeBuilder::walk that causes pathOps to fail when cubic segment is reducable
Inside SkOpEdgeBuilder::walk(), when current segment is cubic curve, its shape may be reduced, therefore, the curve points should be determined by the reduction result ‘split->fVerb’ instead of ‘verb’.

Actually, inside this switch case, ‘verb’ is always ‘SkPath::kCubic_Verb’, which makes the ‘fCanAdd’ always true. The outcome of this bug makes the subsequent logic which depends on ‘fCanAdd’ (L301-332) incorrect, and in some cases, fails the whole boolean operation at L329.

The Fiddle below demonstrates how this bug fails a union operation of two paths, by returning an empty path.
https://fiddle.skia.org/c/e528567b62bc338cd99f4a89f0c5342e

Screen shot of the fiddle:
https://www.dropbox.com/s/4bnzlponq6gen27/pathOpsBug.png?dl=0

2nd Fiddle drawing the results (larger)
https://fiddle.skia.org/c/1f2a513c2ee0395b9d05fb1eb987b01f

Change-Id: If07f54cef1b9409f9b6db27d6294a3e3461b0181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284426
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-04-21 16:56:54 +00:00
Kevin Lubick
d254435603 [pathkit] Clean up perf/test init
This will hopefully help with flakiness.

Bug: skia:8810
Change-Id: Id2fa9abcc0e95f0cf8b08557215766b4f9c57478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200047
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2019-03-12 13:46:41 +00:00
Kevin Lubick
da3d8acce5 [canvaskit] Add path/canvas methods
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>
2019-01-07 16:32:57 +00:00
Kevin Lubick
faa73875d2 [*kit] fulfil promise immediately
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>
2019-01-07 03:29:04 +00:00
Kevin Lubick
d2efe524af [pathkit] Increase test timeouts (for asmjs mostly)
Bug: skia:
Change-Id: Ia84b2eda24b43b858c3f95d860c3f9b6a880bc90
Reviewed-on: https://skia-review.googlesource.com/c/181401
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-01-04 20:59:36 +00:00
Kevin Lubick
275eaff3be [pathkit] Add .ready() to initialize
See https://github.com/kripken/emscripten/issues/5820 and
https://skia-review.googlesource.com/c/skia/+/181177 for more context.

(Problem was discovered in CanvasKit, and this ports the same fix to
PathKit).

Bug: skia:
Change-Id: Ic8b2fb399210631a571595a5b3d11d1736c00def
Reviewed-on: https://skia-review.googlesource.com/c/181178
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2019-01-04 19:58:22 +00:00
Kevin Lubick
1a05fceb38 [canvaskit] Expand canvas2d API
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>
2018-11-20 18:39:43 +00:00
Kevin Lubick
e71e9ef311 [canvaskit] Add catchException everywhere
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>
2018-11-05 13:07:02 +00:00
Kevin Lubick
774be5aa96 [PathKit] Add cubicYFromX
Docs-Preview: https://skia.org/?cl=152385
Bug: skia:8216
Change-Id: I0020e8d2d4e6e7c7de5c71ddf923a618659cde2c
Reviewed-on: https://skia-review.googlesource.com/152385
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2018-09-07 18:01:40 +00:00
Kevin Lubick
c7d057103e [PathKit] Move from experimental to modules
Add in Code of Conduct and Contributing.md as well.

Docs-Preview: https://skia.org/?cl=150901
Bug: skia:8216
Change-Id: Ia881124f653617ad0b7b91f40ba21de2c13220a6
Reviewed-on: https://skia-review.googlesource.com/150901
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2018-08-31 14:18:16 +00:00