Commit Graph

216 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Brian Osman
93de162dc2 Add SkRuntimeEffect::makeShader
This makes the effect *be* the factory, so we can get rid of
SkRuntimeShaderFactory (and later, SkColorFilterFactory).

Change-Id: I2cd95f1380a0ec1e65fe5a18b1226c042598a8bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261439
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-27 21:50:20 +00:00
Brian Osman
77742c3503 Remove SkShader.Empty from CanvasKit
SkShaders::Empty may be easy to expose, but that doesn't mean we should.
It shouldn't even be public, but Chrome uses it in one place.

Change-Id: I398a5e6f782990a7baec0d9b1d0018f7456ff15f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260956
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-19 14:11:17 +00:00
Kevin Lubick
e6e39bcbe0 [canvaskit] Fix SaveLayer constants
Turns out constant doesn't like to take an enum, but needs explicit
coercion to be an int.

Change-Id: I29c761fd2dfd9eb3cde0db3c0c3f0e97dd6ff411
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260698
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-12-18 17:55:59 +00:00
Mike Klein
f46d5ca492 use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-12 22:32:45 +00:00
Kevin Lubick
62836903bc [canvaskit] Expose SkShader combiners
Change-Id: I84652fcec828fea55e2aa35567c054e9678ecf80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258797
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-12-09 14:19:24 +00:00
Kevin Lubick
4b5b645049 [canvaskit] Add _RTShaderFactory for demos
Change-Id: Ib6dc1ff861efe4040508fea09c8a66d8d06db597
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258568
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-12-06 19:35:25 +00:00
Mike Reed
7d34dc7747 Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224.

Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 17:43:14 +00:00
Mike Reed
3e7af41224 Revert "switch to new filltype for SkPath"
This reverts commit 3a50981a83.

Reason for revert: chrome win build found compile-problem in xpsdevice

Original change's description:
> switch to new filltype for SkPath
> 
> Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Iacb3566da61c2512b9bd6b7e42b592febc85e031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256530
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-26 03:34:30 +00:00
Mike Reed
3a50981a83 switch to new filltype for SkPath
Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-25 22:31:46 +00:00
Florin Malita
0d603d8add [CanvasKit] Add SkResourceCache helpers
Allows clients to tune their image decode cache.

Change-Id: I121db096fe6c79a64aa1d388d3bae29f29dd2993
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256359
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-25 19:10:06 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Kevin Lubick
e59c167b0f [canvaskit] Add SkContourMeasure
Change-Id: Ied060a4de792d6372b8410bf8c7628b5fd1dfefb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255528
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-22 12:17:55 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
Mike Reed
0dacc6b7d3 Revert "Use flat version of path-direction enum"
This reverts commit e0fbe94351.

Reason for revert: need to add guard flag to flutter

Original change's description:
> Use flat version of path-direction enum
> 
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-21 22:10:32 +00:00
Mike Reed
e0fbe94351 Use flat version of path-direction enum
Bug: skia:9663
Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-21 21:45:20 +00:00
Kevin Lubick
d267719e32 [canvaskit] Add MatrixTransform ImageFilter
Change-Id: Ifcb73c331846abb3ffa9ac2f41236de8da4fdccc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254804
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-11-15 19:50:14 +00:00
Kevin Lubick
1496758da4 [canvaskit] Request an 8 bit stencil buffer from the WebGL 1/2 context
We hadn't been requesting one, but told Skia we had one, which caused
issues.

Bug: skia:9564
Change-Id: I9a2e78a528778a386225cdcbbb2d2b3d8f705f05
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254801
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-11-15 17:21:48 +00:00
Kevin Lubick
37ab53e7c7 [canvaskit] Expose a few more methods
More requests by flutter-web.
 - drawPoints
 - drawImageNine
 - getSegment
 - addPoly

Change-Id: Iad8f51bb7df5fe014931dc12c8d09d64c08c3a13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253740
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-14 19:00:33 +00:00
Kevin Lubick
47bd9f1b73 [canvaskit] Expand SkAnimatedImage
With these things exposed, I think Flutter will not need
CanvasKit to expose the very complex SkCodec API.

Change-Id: Iace1b496d1dcb8842181466e860e8f212aba7b48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253542
Reviewed-by: Leon Scroggins <scroggo@google.com>
2019-11-08 14:58:14 +00:00
Kevin Lubick
79b7134b5f [canvaskit] Add relative SkPath operators
Like with the non-relative forms, we want to be able to
chain these together, but not leak the SkPaths (which happens
if the C++ side returns this). Thus, we have to add in
the JS glue to return the "JS this".

Change-Id: Ic640b84f6c09c1d931ad44bc403b14bb0d0893a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251960
Reviewed-by: Hal Canary <halcanary@google.com>
2019-11-01 20:08:27 +00:00
Kevin Lubick
77d9b5c58e [canvaskit] Add tentative support for savelayerrec
It was easier to just add a few saveLayer overrides rather
than try to expose the struct of pointers. SkRect*
was hard/impossible because we have it as a value_object,
which does not support pointers in enscriptem.

Change-Id: Iad702593cca19f80d6ef9a319f8c80a087135e38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-10-29 16:46:43 +00:00
Kevin Lubick
15b40236bd [canvaskit] Add various ImageFilters
We are pretty comfy exposing this set for the long-term.

CanvasKit will generally support chains of image filters,
not necessarily arbitrary DAGs, just to simplify the
points needed to expose.

Change the naming around MaskFilters also, I like having
the factories be a class function, just to keep things
a bit better organized and minimize the amount of things
we want to keep on the top level CanvasKit object.

Change-Id: If32c630efa2fd8bc4bac84d0c3461ac3c0d21263
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250758
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-10-29 14:48:33 +00:00
Kevin Lubick
6dbc4ed880 [canvaskit] Expose various canvas features
clipRRect and drawColor

Change-Id: I6e947b4a30646a96935c74e0cd334f1624c41065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249892
Reviewed-by: Mike Reed <reed@google.com>
2019-10-22 16:09:27 +00:00
Kevin Lubick
369f6a5ea2 [canvaskit] Initial addition of SkParagraph
There are more parts of ParagraphStyle and TextStyle, but
this should be a bulk of the components.

Bug: skia:9469
Change-Id: I87fff6700f41cff49ecbee3a1339e84c36699c93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244837
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2019-10-03 18:04:55 +00:00
Kevin Lubick
61887c7b88 [canvaskit] Create SkFontMgr from passed in data
This repurposes much of our embedded SkFontMgr code
to take in data directly instead of from compiled-in
variables.

Also makes no_font and no_embedded_font work better.

Bug: skia:9469
Change-Id: Ibde49c9a448cfca79c5712aa9abbe15997a163d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244510
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-26 19:27:12 +00:00
Kevin Lubick
6b921b7e4a [canvaskit] add support for SkAnimatedImage
Also adds tests for static png,jpg,gif

Was unable to simply expose drawDrawable because the JS
side of things does not understand inheritance (specifically,
it doesn't know what is a descendant from SkDrawable).

Change-Id: I6a833c93f22ef90ae12e901168ff428e20504209
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242562
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-09-20 18:34:01 +00:00
Robert Phillips
ea1b30b57b New proposed syntax for SkColorTypes
Everything except for SkImageInfo.h is mechanical

Change-Id: I2d775c79467fb15f6022e80d21b4a9151272fe2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242896
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-09-19 20:42:55 +00:00
Robert Phillips
17a3a0bda9 Last tranche of new SkColorTypes
This CL adds:
    kAlpha_F16_SkColorType
    kRG_F16_SkColorType
    kRGBA_16161616_SkColorType,

which should be it for a while.

Bug: skia:9121
Change-Id: I81b9d46a202a76e9b7d7ca86495d72dbdae32576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241357
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-18 18:23:29 +00:00
Kevin Lubick
d372934c42 [canvaskit] expose SkColorFilter and add SkColorMatrix helpers
of note, this is kjlubick's 2^9 = 512'th commit into the Skia repo.

Change-Id: I635cb1db6812217358ab138cd833c0c61f676232
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241037
Reviewed-by: Mike Reed <reed@google.com>
2019-09-13 14:09:03 +00:00
Robert Phillips
429f0d380c Add kRG_1616 and kAlpha_16 SkColorTypes
This also switches GrColorType::kR_16 to kAlpha_16 to more closely match raster.

Bug: skia:9121
Change-Id: I03c6e6c52c90aa4223478c5ea6c8b2ed8558f677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239930
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-09-12 12:20:09 +00:00
Kevin Lubick
50f377e275 [canvaskit] expose ComputeTonalColors
Change-Id: Ia4f0eec8e162ad273e856c04ca98c7e2cb48935e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240693
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-09-11 19:44:51 +00:00
Kevin Lubick
7d644e182e [canvaskit] expose all 8 radii for RRect
Change-Id: I537bda18a588c9db5b0f3ea17203bb1daab0feb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240689
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-09-11 19:02:33 +00:00
Robert Phillips
d470e1b905 Add kRG_88_SkColorType
Bug: skia:9121

Change-Id: Id2a12a5d607b84ce393d2b58233bf8e23f646059
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235797
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-09-06 17:55:26 +00:00
Kevin Lubick
2e5fe35044 [canvaskit] Add rrect support
Change-Id: Ic9f2c0224b95e277df93a1d46e59a1096d8005b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238896
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-09-03 18:00:16 +00:00
Kevin Lubick
e384df4f5e [canvaskit] Add sundry APIs and tests
To the reviewer: I've tried to make it so each PS adds one new API.

Change-Id: I81fc85c7a93a19ce4fd725a125e138d35471e693
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237155
Reviewed-by: Mike Reed <reed@google.com>
2019-08-27 12:35:49 +00:00
Kevin Lubick
d6ba725da3 [canvaskit] Save a copy by using SkVertices::Builder
Change-Id: I7a01f97d57c37b7198b7f4fbb966c785ab998861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/217898
Reviewed-by: Mike Reed <reed@google.com>
2019-06-03 18:41:00 +00:00
Mike Reed
dc2b98fd29 simplify setColor, without needing the 4f or the colorspace
Change-Id: I7f6fe83cfb653819c1b5d865421f4fd2121e9b4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212418
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-05-20 16:59:26 +00:00
Kevin Lubick
d6b32ed39d [img-decode] Start on proposed new spec
This adds readPixel and a partial stub of window.createImageData

Change-Id: Iee992312b9331b71852fe2198f844a7e4ae9e963
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211344
Reviewed-by: Mike Reed <reed@google.com>
2019-05-06 17:39:19 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Kevin Lubick
cc13fd3d6c [CanvasKit] Add basic support for SkPicture
Can dump SkPicture to an skp, but only for debugging purposes
(no deserialization).

Bug: skia:
Change-Id: I37f3c4dcfdd70b665748773ee6b5135329c6240a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206262
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-05 17:14:55 +00:00
Kevin Lubick
a064c2812e [canvaskit] Make SkImageShader from SkImage
This removes a few src/ includes as well, to avoid using private
implementations like we did.

Change-Id: Ic9a21d04a131c30e17dfca6d8ea45bdefd362aa7
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206062
Reviewed-by: Mike Reed <reed@google.com>
2019-04-04 13:42:41 +00:00
Kevin Lubick
ee91c07a76 [canvaskit] adding drawAtlas to canvas API
Also re-works colors in the JS part to be unsigned,
so there's less chance for oopsies when passing them
to the C++ side.

Change-Id: I3f56d22e873e1407c402606444c50b76dd34ffd4
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204543
Reviewed-by: Mike Reed <reed@google.com>
2019-04-04 13:03:35 +00:00
Mike Reed
5c5de21463 no more legacy enum references
Bug: skia:8937
Change-Id: I64ba9dffe340769ead0de54a82cd32b61f87c57d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205838
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-04-03 21:24:17 +00:00
Mike Reed
e25b4472cd Move SkTileModes to top level
- move shader factories to their host (e.g. picture->makeShader)

More to do to formally deprecated SkShader::TileMode

Bug: skia:8937
Change-Id: I101e42fb9fba4ab91d028a34888f1fde16fdece4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205589
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 00:18:35 +00:00
Ben Wagner
3bdb69c55f Clean up shaper handler.
Change-Id: Icb741ba9013747528e893c94df3b9242562028ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-02 14:56:26 +00:00
Kevin Lubick
cd54466473 Expose gpu cache knobs
Change-Id: I5911593812ebf6fd235c6a3fc2acfa740c7687aa
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203164
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-25 11:48:25 +00:00
Kevin Lubick
d3cfbcae10 [canvaskit] Add TextOnPath helper to TextBlob
This adds the pieces needed to accomplish this, and
although clients could do it, I figured it would be
nice to expose as a universal tool (on TextBlob).

Bug: skia:
Change-Id: Id5d61744973de2da75049d33d40e1dc442c2442c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201601
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-03-15 22:28:17 +00:00
Kevin Lubick
3f67f411d8 [canvaskit] Move from experimental to modules
Bug: skia:
Change-Id: I2ffd54cf81c974f3a80103e1726a06067cc90d82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/200044
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-11 21:09:52 +00:00