Commit Graph

1084 Commits

Author SHA1 Message Date
Hal Canary
b45d512481 bin/sysopen: script moved to bin
No-Try: true
Change-Id: I1b9b1be36c9ed2d574de681b90b98e56f45e70fa
Reviewed-on: https://skia-review.googlesource.com/c/174588
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-06 14:21:33 +00:00
Hal Canary
ed18c93d1e bin/gerrit-number (no longer experimental)
Change-Id: Iadbef27074201173be2c71447c5d6f721afffbb3
Reviewed-on: https://skia-review.googlesource.com/c/174585
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-12-05 16:47:29 +00:00
Hal Canary
e0dc346d9e experimental/tools/gerrit-change-id-to-number: cleanup
No-Try: true
Change-Id: I684e681ec38769f5c9b5d66c0190fb08f28ff367
Reviewed-on: https://skia-review.googlesource.com/c/174581
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-12-05 16:05:14 +00:00
Kevin Lubick
92d8ea6f99 [canvaskit] remove setMatrix
Bug: skia:
Change-Id: I9fc895e8b499fec8d72dfcd794c705380108bf9b
Reviewed-on: https://skia-review.googlesource.com/c/174314
Reviewed-by: Mike Klein <mtklein@google.com>
2018-12-04 21:32:45 +00:00
Kevin Lubick
52b9f370b3 [canvaskit] Support getImageData/putImageData
setMatrix -> _setMatrix with the hope of removing it
from the API (it breaks the save()/restore() model) and
replacing it with concat (which I'll try in a follow on CL).

Adds MakeImage for those times when a client has pixels
and needs to clip them (e.g. putImageData with 7 args).

This removes SkSurface._readPixels, which I might have
been holding wrong. It might get re-surfaced eventually.

Bug: skia:
Change-Id: Iee9a494db720b22e23f9e674b20ba678fad91d25
Reviewed-on: https://skia-review.googlesource.com/c/174300
Reviewed-by: Mike Klein <mtklein@google.com>
2018-12-04 20:40:14 +00:00
Mike Klein
2d9e543a58 some SkAtomics cleanup
- Replace sk_memory_order with std::memory_order.
 - Remove SkAtomic<T>.

SkPath was the only user of SkAtomic<T>, for its fConvexity and
fFirstDirection fields.  I've replaced them with std::atomic types, and
funneled access to them through methods that enforce the relaxed memory
order like SkAtomic<T> did.

For fConvexity, we can use the exisiting setConvexity() and
getConvexityOrUnknown() methods, adding a private const setConvexity()
to mutate convexity from const methods.  For fFirstDirection I've added
private setFirstDirection() and getFirstDirection() methods.

Removing SkAtomic<T> means SkAtomics.h no longer needs SkNoncopyable.h.
I've had to update a bunch of other headers that were depending on
transitive inclusion.

Change-Id: Ib238be71a121519db6e970a9a8955834e1298c87
Reviewed-on: https://skia-review.googlesource.com/c/174220
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-04 13:53:39 +00:00
Kevin Lubick
f9910ea258 [canvaskit] Add profile mode
Firefox is the only browser that supports WASM+Source maps
so it's only really useful there.

It allows for profiling to see where time is speant, even
down in the C++ calls.  (see the below comment for a screenshot)

Bug: skia:
Change-Id: Ie0380bae9fdea45e1652dd7d2d8036f242087d33
Reviewed-on: https://skia-review.googlesource.com/c/174101
Reviewed-by: Mike Reed <reed@google.com>
2018-12-03 20:43:17 +00:00
Florin Malita
6ba8c7ea84 [skottie] Surface composition markers in CK
Change-Id: Ie53c81f4dbe981327469d8a9990d27f8a41d8b4c
Reviewed-on: https://skia-review.googlesource.com/c/173983
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-12-03 20:12:10 +00:00
Kevin Lubick
7a1b845f2f [canvaskit] remove POC Nima code
Now that drawVertices is exposed, no need to keep this around as a demo

Docs-Preview: https://skia.org/?cl=173994
Bug: skia:
Change-Id: I6293c8e2038ece27635d254db097e651c9d77a94
Reviewed-on: https://skia-review.googlesource.com/c/173994
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-12-03 19:31:09 +00:00
Kevin Lubick
0a1293c2e4 [canvaskit] Add drawImage support
Adds drawImageRect as well.

Bug: skia:
Change-Id: Ib74f92a3ee22664297d8ce7ff1d2cd2644b806b7
Reviewed-on: https://skia-review.googlesource.com/c/173990
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-12-03 18:47:29 +00:00
Florin Malita
91af8d8202 [skottie] Expose composition markers to embedders
Add a MarkerObserver interface (to replace the current
AnnotationObserver), and update CustomPropertyManager to intercept both
properties and markers.

TBR=
Change-Id: If79de419066916bc596316f0a551c75564069239
Reviewed-on: https://skia-review.googlesource.com/c/173766
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-12-01 04:44:03 +00:00
Kevin Lubick
ea905ec333 [canvaskit] Save a copy on CPU backend by using RasterDirect
Draw directly into an unpremul buffer (which is what Canvas's
get/putImageData is) and it speeds up Skottie animation by
about 3x.

Bug: skia:
Change-Id: Ie131276e3a675e0e5a35190da93f34d7469624e4
Reviewed-on: https://skia-review.googlesource.com/c/173644
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-30 19:29:25 +00:00
Kevin Lubick
dee08d8f65 [canvaskit] Fix conversion of large images to base64
Bug: skia:
Change-Id: I8ab40a382557ae6bd13884ddce027e51ce1fb21f
Reviewed-on: https://skia-review.googlesource.com/c/173701
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-30 18:43:37 +00:00
Kevin Lubick
eb2f6b0adb [canvaskit] Add gradients and clips
Refactors things inside to support both color
and gradient as _fillStyle/_strokeStyle.

Bug: skia:
Change-Id: I364ceb7d55c41e11161d5577dcd1611a592bbc29
Reviewed-on: https://skia-review.googlesource.com/c/173421
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-30 13:06:07 +00:00
Florin Malita
c2e85f942f [skottie] Expose property bindings in CK
Add a new (optionally-built) ManagedAnimation CK helper, and provide
accessors for color and opacity properties.

The new wrapper class can be used as a drop-in replacement for the existing
Animation.

Change-Id: Iab6b6be9c736697b4731722806b145cbd130ce73
Reviewed-on: https://skia-review.googlesource.com/c/173322
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-29 17:09:35 +00:00
Kevin Lubick
43ff69a83f [canvaskit] Fix arc() call
Bug: skia:
Change-Id: I7a06b4bd5d2e88b12b08b0568301515653512ebb
Reviewed-on: https://skia-review.googlesource.com/c/173236
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-28 20:52:09 +00:00
Kevin Lubick
12c0e50fda [canvaskit] support globalAlpha and dashed strokes
This involves a refactor of how we deal with paint.
Now, we have a source-of-truth paint that is copied
and modified for each of fill/stroke/shadow.

Adds preliminary support for blend modes.

Most of what remains is text, images, and gradients.

Bug: skia:
Change-Id: I41806adeb7de4faa6c98a580c4f1de4e4a34a37d
Reviewed-on: https://skia-review.googlesource.com/c/173223
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-28 19:03:19 +00:00
Kevin Lubick
61ef7b2589 [canvaskit] Add shadow and save/restore support
This also exposes the ShadowUtils::drawShadow on Canvas,
even though it wasn't what was needed to duplicate
the Canvas effect.

Bug: skia:
Change-Id: I12276ef106244218e4827b7fcd7949c83cf13e5f
Reviewed-on: https://skia-review.googlesource.com/c/172967
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-27 18:56:09 +00:00
Kevin Lubick
b9db3906d5 [canvaskit] Make transforms work properly
This re-works the subpath model and does transforming
of ports in JS rather than in C++; the latter was not easy
to conform to the Canvas Spec, especially for changing
transforms in the middle of a path.

Additionally adds jpeg to the available images it can produce.

Bug: skia:
Change-Id: I5a52ec341d4060198c8680aa4d3b85a26f77b6b9
Reviewed-on: https://skia-review.googlesource.com/c/172500
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-11-26 17:16:42 +00:00
Mike Reed
114bde830b Revert "Revert "add rect-parameter to makeImageSnapshot""
This reverts commit 1e28e5d79e.

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-21 14:46:06 +00:00
Kevin Lubick
6fccc9db67 [canvaskit] Add debug-mode only logs
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-20 22:22:04 +00:00
Kevin Lubick
b07204a6f9 Add software backend to gpu build
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 19:41:27 +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
Alexander Khovansky
3e11933765 [canvaskit] Exposed SkPath::arc. Exposed SkEncodedImageFormat enum. Exposed 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-15 02:52:02 +00:00
Mike Klein
54378230f8 Reland "simplify disabling effect deserialization"
This reverts commit 34d7a163a4.

Reason for revert: ok now?

Original change's description:
> Revert "simplify disabling effect deserialization"
>
> This reverts commit 5bbf790b5b.
>
> 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-08 14:26:52 +00:00
Mike Klein
34d7a163a4 Revert "simplify disabling effect deserialization"
This reverts commit 5bbf790b5b.

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-07 18:52:19 +00:00
Mike Klein
5bbf790b5b 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>
2018-11-07 18:20:23 +00:00
Kevin Lubick
e5a06e7bd3 [canvaskit] Update examples after enum name change
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-07 15:45:14 +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
b5ae3b5afc [canvaskit] Add drawVertices API
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-03 12:18:04 +00:00
Mike Reed
f67b1620aa add pvg experiment
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-11-02 15:35:21 +00:00
Hal Canary
a0a6fe44fc experimental/tools/generate-unicode-test-txt: update
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-31 17:05:54 +00:00
Kevin Lubick
134be1d9ba [canvaskit] Expose nima animation as POC
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-30 20:15:28 +00:00
Kevin Lubick
d969932474 Refactor Nima code
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-30 19:32:52 +00:00
Kevin Lubick
2cf29ce4db [canvaskit] Remove ReadBuffer
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-25 19:17:59 +00:00
Kevin Lubick
006a6f3b14 [canvaskit] Fleshing out the beginnings of a Canvas API
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-22 18:02:09 +00:00
Kevin Lubick
9e40e6fa79 Give attribution
Bug: skia:8488
Change-Id: If96c6bb500ceb0bf4b41c9b3aaf10aa9ad301c70
Reviewed-on: https://skia-review.googlesource.com/c/164260
Reviewed-by: Heather Miller <hcm@google.com>
2018-10-22 16:55:34 +00:00
Kevin Lubick
b9d7fb9624 [canvaskit] Disable effect_deserialization
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-19 14:44:10 +00:00
Kevin Lubick
d04b551b4a [canvaskit] Increase timeout thresholds for perf
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 14:54:33 +00:00
Kevin Lubick
32dfdbe1af [canvaskit] Slice out SkPicture
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-18 14:15:47 +00:00
Kevin Lubick
f2a146c6ad [canvaskit] Add perf jobs
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 19:41:16 +00:00
Kevin Lubick
f20c3493eb [canvaskit] Remove DAA and SAA from gpu build
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 14:11:51 +00:00
Kevin Lubick
5b90b84085 [canvaskit] POC working on Node.js
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-17 12:48:24 +00:00
Kevin Lubick
3d99b1e347 Add Correctness tests for CanvasKit
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-16 14:32:28 +00:00
Kevin Lubick
4bf2c26b93 Remove nvpr from CanvasKit
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-15 14:11:29 +00:00
Mike Klein
36528e91c2 clean up SkPipe
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-12 16:50:21 +00:00
Brian Salomon
d7065e72da Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call.""
This reverts commit 8d5b41b553.

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-12 16:09:21 +00:00
Brian Salomon
8d5b41b553 Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."
This reverts commit 0a0304c426.

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-12 14:25:06 +00:00
Brian Salomon
0a0304c426 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>
2018-10-12 13:14:24 +00:00
Kevin Lubick
53965c9d68 Add CPU backend for CanvasKit
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-11 13:30:27 +00:00