Commit Graph

17 Commits

Author SHA1 Message Date
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
3902628e35 Support WebGL 1.0 with caps
There is some logic in here for 2.0 as well, just as a
"as long as I was looking at the specs", but only 1.0
is really supported.

This seems to resolve the bug where some GPUs weren't
advertising correctly that they had vertex array object
support, by checking for both extension names (with and
without "GL_" prefix)

Of note, this saves about 18 Kb (5.5 Kb gzipped) of code size
by compiling out the unneeded GLES checks/functionality.

Bug: skia:8378
Change-Id: I773bf4dbf231b991051d2a9f640b8047a9010e7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203461
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-28 17:21:23 +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
Mike Klein
e5acd7547b delete DAA
Change-Id: I1fd8cba067c0063c6621641e8196e69fd5e31cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203080
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-22 15:44:03 +00:00
Kevin Lubick
025949e0f7 [canvaskit] npm version 0.5.1
Fixes a build flag

Bug: skia:
Change-Id: I51f0fff18415fba5ea8396189aeab8a40f196c70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202713
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2019-03-21 18:35:18 +00:00
Kevin Lubick
27ba7032be Add GN args for GL/GLES interface
Bug: skia:
Change-Id: I8445a6f3641aa43e7b18832c7c228b66dd321f2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-21 12:57:27 +00:00
Kevin Lubick
359a7e305c [canvaskit] Add requestAnimationFrame to SkSurface
Bug: skia:
Change-Id: I8a15c10d0d8f20098d0e5357ffd602db97c50c84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201986
Reviewed-by: Mike Reed <reed@google.com>
2019-03-20 14:42:35 +00:00
Kevin Lubick
8aa203c1d8 Add macro to decide GrGLStandard
This allows us to remove certain interfaces at compile time.

This replaces most (all?) of the cases where it was
if (gl) else [implicit gles] to be explicitly
if (gl) else if (gles)
in preparation for adding a WebGL standard.

For consistency, I tried to check first for GL, then for
GLES, which involved re-arranging a few if blocks.

PS 3 removes about 1.2KB (0.4 KB gzipped) from CanvasKit by
removing the GrGLInterface related checks from
GrGlInterface::validate()

PS 8 removes a total of 6.0 KB (2.6 KB gzipped) from
GrGlInterface::validate() and GrGlCaps::*

Bug: skia:8378
Change-Id: Ia91b732d888907f5d94b0eac8ca023084999fa7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201604
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-03-19 18:19:12 +00:00
Kevin Lubick
2697dd626e [canvaskit] Various cleanups around docs/build
- Break up example into two pages
 - Deprecate SkCanvas.flush()
 - add build flag that helps with certain GPU's webgl support

Bug: skia:
Change-Id: I49b1dbfecc10265a14ef4cbe54f7e8f0306e12ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201649
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2019-03-18 15:53:30 +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
832787ac6c [canvaskit] Fallback to CPU more gracefully
This should also trim down code size since WebGL should never want
GrGLMakeAssembledGLInterface only GrGLMakeAssembledGLESInterface

Bug: skia:
Change-Id: I9246d467847eeb91517c56075077b3e26c4ee336
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201223
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2019-03-14 20:25:25 +00:00
Kevin Lubick
f35551815f [canvaskit] missing extern
Bug: skia:
Change-Id: I9893650b394c71ced15c0b6b7623a4c3081cedff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201225
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-03-14 15:18:22 +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