aboutsummaryrefslogtreecommitdiff
path: root/experimental
AgeCommit message (Collapse)Author
2018-11-21Revert "Revert "add rect-parameter to makeImageSnapshot""Mike Reed
This reverts commit 1e28e5d79e895e502afddecda2eb66a73a453d38. Bug: skia: Change-Id: I71c246885721c71de540e9079ecf7323234c8871 Reviewed-on: https://skia-review.googlesource.com/c/172302 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
2018-11-20[canvaskit] Add debug-mode only logsKevin Lubick
And a fix for node. Docs-Preview: https://skia.org/?cl=172143 Bug: skia: Change-Id: I519c2693b386aa68655f235281d932ee5fffbc61 Reviewed-on: https://skia-review.googlesource.com/c/172143 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-20Add software backend to gpu buildKevin Lubick
Bug: skia:8548 Change-Id: If3853711f4b183f3b0437ae2b31525b0e6c88213 Reviewed-on: https://skia-review.googlesource.com/c/172120 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-20[canvaskit] Expand canvas2d APIKevin Lubick
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-15[canvaskit] Exposed SkPath::arc. Exposed SkEncodedImageFormat enum. Exposed ↵Alexander Khovansky
SkImage::encodeToData overload with arguments 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/10 R=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>
2018-11-08Reland "simplify disabling effect deserialization"Mike Klein
This reverts commit 34d7a163a4a749d6e91cf768d0f1767e8da6ceb2. Reason for revert: ok now? Original change's description: > Revert "simplify disabling effect deserialization" > > This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. > > 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>
2018-11-07Revert "simplify disabling effect deserialization"Mike Klein
This reverts commit 5bbf790b5beeb2ed74f04551502259b54ac5556f. 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>
2018-11-07simplify disabling effect deserializationMike Klein
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>
2018-11-07[canvaskit] Update examples after enum name changeKevin Lubick
Docs-Preview: https://skia.org/?cl=169186 Bug: skia: Change-Id: I083a07cc44e1534f4aeedc4e25e8ed786e29f168 Reviewed-on: https://skia-review.googlesource.com/c/169186 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-05[canvaskit] Add catchException everywhereKevin Lubick
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-03[canvaskit] Add drawVertices APIKevin Lubick
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>
2018-11-02add pvg experimentMike Reed
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>
2018-10-31experimental/tools/generate-unicode-test-txt: updateHal Canary
No-Try: true Change-Id: Ie904a1493570e7f2d50ab2e79c30951610641428 Reviewed-on: https://skia-review.googlesource.com/c/166802 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
2018-10-30[canvaskit] Expose nima animation as POCKevin Lubick
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>
2018-10-30Refactor Nima codeKevin Lubick
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>
2018-10-25[canvaskit] Remove ReadBufferKevin Lubick
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>
2018-10-22[canvaskit] Fleshing out the beginnings of a Canvas APIKevin Lubick
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>
2018-10-22Give attributionKevin Lubick
Bug: skia:8488 Change-Id: If96c6bb500ceb0bf4b41c9b3aaf10aa9ad301c70 Reviewed-on: https://skia-review.googlesource.com/c/164260 Reviewed-by: Heather Miller <hcm@google.com>
2018-10-19[canvaskit] Disable effect_deserializationKevin Lubick
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>
2018-10-18[canvaskit] Increase timeout thresholds for perfKevin Lubick
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>
2018-10-18[canvaskit] Slice out SkPictureKevin Lubick
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>
2018-10-17[canvaskit] Add perf jobsKevin Lubick
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>
2018-10-17[canvaskit] Remove DAA and SAA from gpu buildKevin Lubick
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>
2018-10-17[canvaskit] POC working on Node.jsKevin Lubick
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>
2018-10-16Add Correctness tests for CanvasKitKevin Lubick
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>
2018-10-15Remove nvpr from CanvasKitKevin Lubick
Saves about 20k uncompressed, 7k compressed. Bug: skia: Change-Id: I060c58380f3e3266bca9028ba5ba6aa17ce178dc Reviewed-on: https://skia-review.googlesource.com/c/161942 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-10-12clean up SkPipeMike Klein
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>
2018-10-12Revert "Revert "Add experimental API to draw a set of SkImages in one ↵Brian Salomon
SkCanvas call."" This reverts commit 8d5b41b5530e8a6dea440bf87c1094d5f070accd. Bug: skia:8444 Change-Id: I29b52c6fe9475c6113ec954b7918cf591111846c Reviewed-on: https://skia-review.googlesource.com/c/161627 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-12Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."Brian Salomon
This reverts commit 0a0304c426c44c15897c74dcffb2dcbae544b948. 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>
2018-10-12Add experimental API to draw a set of SkImages in one SkCanvas call.Brian Salomon
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>
2018-10-11Add CPU backend for CanvasKitKevin Lubick
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>
2018-10-10Make CCPR optionalKevin Lubick
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>
2018-10-10Tweak to compile flagsKevin Lubick
Bug: skia: Change-Id: I067fa83e1a07b244bec71ed4f95c144dc7e2edc1 Reviewed-on: https://skia-review.googlesource.com/c/161143 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-10-09Add CanvasKit buildKevin Lubick
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>
2018-10-02Fix text on CanvasKitKevin Lubick
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>
2018-09-21move skpipe to experimentalMike Klein
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>
2018-09-21[canvaskit] Link demos to fiddlesKevin Lubick
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>
2018-09-21[CanvasKit] Implement some basic Canvas/Surface things.Kevin Lubick
drawText is having issues in a release build. Skottie sometimes asserts in debug mode. This possibly has something to do with memory alignment - like https://skia-review.googlesource.com/c/skia/+/155980 helped fix. Patchset 9 shows off integrating Skia drawing to an HTML canvas using Ganesh. To see it locally, set up https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html and then set $EMSDK to be that directory. Then run make clean make local-example and navigate to http://localhost:8000/skia-wasm/example.html Patchset 20 shows off Skottie animating directly to a Canvas. Docs-Preview: https://skia.org/?cl=153882 Bug: skia: Change-Id: I2ad2f4ffac00925ee901982ccbaeb7aa63b1ea23 Reviewed-on: https://skia-review.googlesource.com/153882 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-08-31[PathKit] Move from experimental to modulesKevin Lubick
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-30remove scaling from pathopsCary Clark
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>
2018-08-29[PathKit] Make pathops assertion a little more forgivingKevin Lubick
Bug: skia: Change-Id: I5135b8e38e955fe5dbbad8a16bf3f26c98e4e996 Reviewed-on: https://skia-review.googlesource.com/150124 Reviewed-by: Cary Clark <caryclark@google.com>
2018-08-27[PathKit] Re-create test expectationsKevin Lubick
See https://skia-review.googlesource.com/c/skia/+/149620 Bug: skia: Change-Id: I2a8c88e813b5084f667d08317145866b57bbd7ab Reviewed-on: https://skia-review.googlesource.com/149681 Reviewed-by: Ravi Mistry <rmistry@google.com>
2018-08-24[PathKit] Write more complete docs and clean up API to be consistentKevin Lubick
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>
2018-08-22[PathKit] Add asm.js build and test jobsKevin Lubick
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>
2018-08-18[PathKit] Add more correctness tests to goldKevin Lubick
Bug: skia:8216 Change-Id: I549f59f165e01ef2e827cf389a5412c123314a90 Reviewed-on: https://skia-review.googlesource.com/147817 Reviewed-by: Stephan Altmueller <stephana@google.com>
2018-08-17[PathKit] Add conic tests and re-create expectations.Kevin Lubick
Expectations changed in https://skia-review.googlesource.com/147720 Also apparently I missed a spot when adding conics. Bug: skia: Change-Id: I6a9b40ef4518a304bcb575a1ea9be1c900ef18d1 Reviewed-on: https://skia-review.googlesource.com/147816 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-08-17[PathKit] Rework API to avoid extra copies unless explicitly called for.Kevin Lubick
Breaking Changes: - All method calls that mutate a path now return the same JS path object to allow chaining (moveTo, lineTo, trim, op, simplify, etc). Pre-existing code likely will need to have some delete() methods removed because the path will be deleted multiple times. See chaining.js for this code (basically, we wrote our own binding code since the default code wasn't quite flexible enough) - GetCanvasFillType -> GetFillTypeString (Was in https://skia-review.googlesource.com/c/skia/+/147209) Since Canvas and SVG use the same strings, it seemed logical to make them share. - stroke() now takes a single object instead of 3 params. This object currently can have up to 4 params, cap, join, width, miter_limit. This object can be expanded on in future versions as more configuration options are added. As per custom with v0 software, we bump the minor version to 0.2.X to indicate breaking changes in a pre-release software package. Other changes of note: - Simple tests added for effects (see effects.specs.js) A follow up CL will handle the Gold (correctness tests) - Simple tests added for equals and copy constructors (from https://skia-review.googlesource.com/c/skia/+/147209) - Added transform() to allow for arbitrary matrix transforms - Added SimpleMatrix as a value_array, which means users can provide a 9 element array which will be converted to SimpleMatrix and then SkMatrix on the C++ side. - Renamed helpers_externs.js to externs.js and expanded it greatly. This was necessitated by the code written in chaining.js - Fixed a few bugs in previous tests (svg gold test race condition, uncaught exception in svg reporting) See also https://skia-review.googlesource.com/c/skia/+/147209 which allows .moveTo .lineTo, etc to chain on the C++ SkPath. Bug: skia:8216 Change-Id: I7450cd8b7b5377cf15c962b02d161677b62d7e15 Reviewed-on: https://skia-review.googlesource.com/147115 Reviewed-by: Mike Reed <reed@google.com>
2018-08-15[PathKit] Adding test infrastructure to support Gold outputKevin Lubick
To get the gold images out of the browser tests, this adds testReporter.js and pathkit_aggregator.go. testReporter bundles up the output as a base64 encoded PNG and sends it over the local network to pathkit_aggregator. pathkit_aggregator will keep a list of test results reported in this way and write the PNGs to /OUT of the container (which is the swarming output directory). Finally, after all the tests are run, the helper script "test_pathkit.sh" makes a POST request that creates the JSON file that gold expects (following the schema https://github.com/google/skia-buildbot/blob/master/golden/docs/INGESTION.md) pathkit_aggregator takes many command line arguments which control the keys that Gold needs in order to ingest and handle the data. Of note, this creates a new set (i.e. source_type) of gold images called "pathkit", which will distinguish it from "gm", "image", etc. There will be at least 2 sub-sets of "pathkit" images, "canvas" and "svg", (representing the 2 output types of PathKit). This CL doesn't quite handle SVG yet, as it needs a way to convert SVG to PNG in the browser and will be addressed in a follow up CL. A "standard" gm is sized at 600x600. This was arbitrarily picked. Note that the functions in testReporter.js return Promises based on the fetch requests to post the data. This eliminates the race condition between the /report_gold_data and /dump_json since running the karma tests won't return until all reports are done. Other changes of note: - Adds go to karma-chrome-tests container. - renames recipe_modules/build/wasm.py -> pathkit.py to be consistent with the name of test_pathkit.py and make for easier grepping. - Increases the JS test timeout to 10s (up from 5) to hopefully avoid the flakes seen in the Debug Test. Bug: skia:8216 Change-Id: Ic2cad54f3d19cc16601cf2e9a87798db1e6887a2 Reviewed-on: https://skia-review.googlesource.com/147042 Reviewed-by: Stephan Altmueller <stephana@google.com>
2018-08-15[PathKit] Fix bindings to account for SkPath methods returning thisKevin Lubick
Bug: skia: Change-Id: I25baf2d5d215cc950da99679649bb3da89dc0681 Reviewed-on: https://skia-review.googlesource.com/147209 Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-08-10[PathKit] Add various path effectsKevin Lubick
API Changes (nothing should be breaking): - Exposes conic, although all output formats (SVG, Canvas) need conics to be approximated with quads. Tests have been added to verify this happens. - Add .dash(), .trim(), .stroke() and examples for them. - Expose Stroke enums (StrokeJoin, StrokeCap) Adds tests for the cubic part and clean up a few spacing things. There are some changes to the C++ code to simplify the build - otherwise, I need to appease the linker and add add in a bunch of files that may or may not get optimized out. Best make them not even be compiled, just to make sure. Bug: skia:8216 Change-Id: I1da3aaab1891f14a5b3dc01bb6523b4fd9a87b04 Reviewed-on: https://skia-review.googlesource.com/146650 Reviewed-by: Florin Malita <fmalita@chromium.org>