Commit Graph

314 Commits

Author SHA1 Message Date
Florin Malita
7ef3e14516 [skottie] More snug kTop Shaper alignment
The current implementation relies on SkShaper ascent values for top
text box alignment, but the results are not as visually accurate as AE
(or Lottie).

Use the computed tight bounds instead.

Change-Id: I4447a834fe3cae398fc887766daa68802e7f50a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206684
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-08 22:48:08 +00:00
Mike Reed
b286bc2da8 Introduce new factory for SkColorFilters
Idea: transition callers to this, so we can later typedef SkColorFilter
and SkShader to the same thing.

Bug: skia:8937
Change-Id: I000c882e11622091aa44c141aa6ddd1216414f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 21:03:59 +00:00
Kevin Lubick
09d022cbb8 [pathkit] build with newer emscripten
Bug: skia:
Change-Id: I5576ec94cae42dd0e03079321e61f71292350808
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206389
Reviewed-by: Eric Boren <borenet@google.com>
2019-04-08 13:56:18 +00:00
Kevin Lubick
c7755d9470 [canvaskit] Bump GPU resource cache to 256MB
Wrong file was previously edited.

Change-Id: I2e78d102ca85a22268481d1958b983e41d72ee3e
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206271
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-05 18:06:18 +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
Florin Malita
774aeba9d0 [skottie] Add support for pre-decoding images at load time
Some animations use humongous images which thrash Skia's resource caches
at raster time.

To avoid that, we can

1) force decoding upfront, when the animation is loaded

2) clamp the image size to something reasonable (2K^2)

Add a flag to support this operation mode, and enable for Skottie/WASM.

Change-Id: Id2f127a5200b812b87e588904393d82c80452aa1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206179
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-04-05 16:30:22 +00:00
Ben Wagner
51874e3e37 Allow selection of shaper wrapping algorithm.
Change-Id: I8103348de810863088758d26b6b2d8062827105e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206170
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-04 21:03:00 +00:00
Florin Malita
e797dfba63 Revert "[canvaskit] Bump GPU resource cache to 256MB"
This reverts commit a93aa74a39.

Reason for revert: Busted skottie.skia.org

Original change's description:
> [canvaskit] Bump GPU resource cache to 256MB
> 
> Bug: skia:
> Change-Id: I398ef2e79076018f3f62e62a2040052eeaf60784
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206066
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

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

Change-Id: I0e6181a6ded0adc40531f936fc495f89400516a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206077
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-04 16:53:41 +00:00
Florin Malita
b161a7d965 [skottie] Fix gradient ramp interaction with non-atomic draws
Currently, shader effects are applied via layers for non-atomic draw fragments.

This is incorrect, as shaders on layer paints are ignored.

Update to always propagate the shader to leaf node paints.

Change-Id: I59f5a5b874e87827f61844969550600fa39e22a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205931
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-04 16:52:59 +00:00
Florin Malita
a93aa74a39 [canvaskit] Bump GPU resource cache to 256MB
Bug: skia:
Change-Id: I398ef2e79076018f3f62e62a2040052eeaf60784
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206066
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-04-04 15:49:01 +00:00
Ben Wagner
1383a38e1d Allow users to create stock shaping iterators.
This provides a way to re-use the existing basic shaping iterators.

Change-Id: I148dd513dcd01381301e7835672d0d605c1c462b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205933
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-04 15:04:59 +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
Florin Malita
866e262a21 [skottie] Fix gradient ramp for non-solid layers
Two issues:

  1) Empirically (per AE's model), only solid layers transform the effect space.
     All other layer types implement their effects ignoring the layer xform.

  2) Due to the effect deferral mechanism in sksg, shader effects are
     sometimes applied with a different transform than intended.

To address #1, tweak the layer builder logic to attach the effects
before/after the transform node, depending on the layer type.

For #2, track the CTM active when the shader effect is attached and undo
any intervening transformations via a local matrix when the shader is
actually applied to SkPaint.

Change-Id: I29b5a4df3b223e7da9dfc36b0d7d40055d192ac0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205922
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-03 20:46:35 +00:00
Mike Reed
fae8fceb4a Use SkTileMode instead of nested enum
Add guard to transition clients

Change-Id: Ia7a3e8f95722f91e84af262168dadf89a78707da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205720
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 15:24:18 +00:00
Florin Malita
9a9e723f02 [skottie] Add support for (non-standard) v-centered text
Introduce a Skottie JSON extension for controlling vertical text
alignment ("sk_vj"), with a single public value for now: 1 (centered).

Refactor SkottieShaper to handle vertical adjustments based on a VAlign
enum:

  kTop         - the topmost line is ascent-aligned with the box top
                 (AE text-box behavior)
  kTopBaseline - the topmost line is baseline-aligned with the top box
                 (AE text-point behavior)
  kCenter      - the text center is aligned with the box center
                 ("sk_vj": 1, Skottie extension)

Also externalize the vertical adjustment as a text blob offset (instead
of baking into blob glyph offsets).

Change-Id: I29a414d4c6ccfafc534ca7b61f48ef96d8cff86e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205590
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-03 13:06:14 +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
Brian Osman
4428f2c39f Remove SkScalarSinCos
This differed from the separate versions in that it snapped to zero.
It was also strictly worse than calling the two separate versions.
Most clients don't need the snapping, so just call the two existing
functions. For clients that need the snapping, call new variants of
each that do snap.

Change-Id: Ia4e09fd9651932fe15caeab1399df7f6281bdc17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-02 15:46:57 +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
Florin Malita
3d846c98ca [skottie] Initial gradient ramp effect support
Implement gradient ramp using SG shader effects.

A couple of quirks:

- since the gradient type (linear/radial) is animatiable (?!),
  update sksg::ShaderEffect to allow resetting the shader

- gradient ramp doesn't have an assigned/stable JSON effect type,
  but the data is present; introduce a name-based effect lookup method
  (used as a fallback when the type is not recognized)


Change-Id: I02bbd6c75c3af175b64c1df502aa52b7c0875162
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205342
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-02 14:24:56 +00:00
Ben Wagner
1e08a7cbc4 Expose basic shaper iterators.
Change-Id: I1b4a04a296df6830c50461a891725b48a2defbd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204261
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-01 19:42:53 +00:00
Florin Malita
fb4bce8322 [sksg] Refactor gradient implementation
Currently, gradients are PaintNode subclasses - which limits their
applicability to leaf DAG nodes.

In order to support generalized gradient/shader effects:

  * introduce a new Shader base class
  * refactor gradients as Shader subclasses
  * introduce ShaderPaint (to support current Gradient-as-paint use)
  * introduce ShaderEffect (to support future Gradient-as-effect use)

Tangentially:

  * rename SkSGPaintNode.h -> SkSGPaint.h
  * consolidate sksg::Color into SkSGPaint.h

Change-Id: I94ba949f4504c09cfde4a4f030d927411fdd66a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205263
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-01 18:43:43 +00:00
Florin Malita
8dd5ea1a75 [skottie] Allow extra-normal Bezier interpolation
AE/Lottie allow Bezier control Ys to be outside the [0..1] range.

Update SkCubicMap to do the same.

Bug: skia:8931
Change-Id: I54ee8dbb4e6e0a33a917500523c82fe56c854d4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205002
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-29 18:23:03 +00:00
Florin Malita
20678f822b [skottie] Tweak Shaper test tolerances to fix NativeFonts bots
TBR=bungeman@google.com
Change-Id: I70ac3a993f1eaee57b074c493eaa70ba9adbf20d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204780
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-28 23:09:52 +00:00
Florin Malita
01fe263606 [skottie] Add support for BodyMovin 5.5.0 keyframes
BM 5.5.0 introduced a change in the keyframe format (dropped redundant
start/end value repetitions).  This updates the parser to support the
new format.

TBR=reed@google.com
Change-Id: I44efc54b60d08574ab649b0da90336dbd0e40391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-28 22:50:32 +00:00
Florin Malita
0d33eac1aa [skottie] Compute tight bounds in skottie::Shaper
Instead of relying on conservative text blob bounds, update
Shaper::Result::computeBounds() to be more accurate.

Also add a skottie::Shaper unit test.

Change-Id: Icf17afcc814329197825e8d404416b6b7060c79d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204480
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-28 19:02:50 +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
Daniel Bratell
78a282f49b Add an include guard to SkottieShaper.h
SkottieShaper.h was not protected against multiple inclusions in the
same translation unit.

Change-Id: Ie1f5acbcab82b9b1c37868739fb4322c471886cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204421
Auto-Submit: bratell <bratell@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-28 13:05:02 +00:00
Florin Malita
0ed4c37634 [skottie] Fix handling of hidden shapes and layers
TBR=reed@google.com

Bug: skia:8923
Change-Id: I5bd1d4f2ef62ebd95cfae0fe3665960b07ed4ae1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204082
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-27 13:17:48 +00:00
Florin Malita
f4e8733947 [skottie] Relocate text shaping utils to separate compilation unit
Introduce AE-specific text shaping abstractions, and move the existing
implementation to a separate CU.

Change-Id: I8533ed8d9c59af6d82b3f1ca66a6e1d50a3c33c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203706
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-26 20:34:02 +00:00
Ben Wagner
7415a422ac Replace SkSpan with Range in shaper reporting.
This allows for using non-contiguous input in a future api for shaper.
This change forces cleanup of error handling when doing low level
shaping, which prompts cleaning up the correct shaper code to make the
control flow more obvious.

Bug: skia:8906
Change-Id: If084e0dd88e2f3a9651551ceeff87480e87fb998
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203465
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-03-25 20:26:50 +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
Mike Klein
5b3f343d25 DEFINE_int32 + DEFINE_uint32 -> DEFINE_int
There's really no big benefit to distinguishing these.

Change-Id: Ib329d32b1fc43e98ba40658cfea37261203ecdb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202801
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:20:19 +00:00
Mike Klein
84836b799a moar static flags
Like any normal variable, flags can be made file-scoped static,
and like any normal variable, mostly they should be if they can.

This CL converts most flags to be static, if only so that the
ones that do cross files stand out more clearly, and so that
there's more examples of static flags through the codebase for
people to ape.

Change-Id: Ibb5ddd7aa09fce073d0996ac3ef0487b078b7d79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202800
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-21 17:07:13 +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
Mike Klein
cd5104e942 SkAnimTimer -> AnimTimer
Change-Id: I700b7c0461475062ac66712cc29070f150cf777d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202315
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:26:35 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Mike Klein
0cffcbf97b de-Sk tools/font, and git clang-format
Change-Id: I0326eb9cc1e1e38b0fdc417567987a595f9021d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202310
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:36:52 +00:00
Mike Klein
88544fbe63 remove Sk prefix from CommandLineFlags
The command line flag package is tool-only, not part of Skia per se,
and does not need an Sk prefix to avoid naming conflicts.

And git clang-format.

Change-Id: Ida8477779e51750ed0475590ed2454841b23d6ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 17:13:22 +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
Florin Malita
7b49eeb496 [skottie] Turn on AA for solid layers
TBR=reed

Change-Id: I8b7b73516eeb7acb5412ad61d6fcbe92dbe10525
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201467
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-19 22:16:48 +00:00
Florin Malita
e3e8da5e52 [skottie] Initial camera support
Camera layers introduce a top-level 3d camera/view matrix based on their
transform properties:

  * position - camera location
  * point of interest (stored as anchor point by BM) - camera direction
  * rotation - camera orientation

The perspective degree is controlled by a "zoom" camera property (which
corresponds to the view distance), and the composition dimensions.

Current limitations:

  * single camera track/layer
  * affects all layers (not just 3d-tagged layers)
  * parent layer transforms are likely not applied correctly

Bug: skia:
Change-Id: Ifc1b8b699ff09fa13b4804d18546b444d02e81c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201651
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-19 19:49:12 +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
Hal Canary
c25f4e9eaa GN: split out skia_*_public from skia_*_sources
`gn check` passes.  We will work towards removing `check_includes = false`.

Change-Id: I0ab396fadaf31a166921bdea334b2cfedca23dcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195363
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-03-15 18:29:19 +00:00
Florin Malita
b9008539c5 [skottie] Initial text box support
AE supports two text layout modes [1]:

  * point text: text is laid out on an infinite line, starting at the given position,
    and observing explicit line breaks only; in this case the text baseline is at the
    given position.

  * paragraph (box) text: text is laid out within the given box, using line breaks to
    fit.

This CL implements the latter mode, in addition to the already supported point mode:

  - parse & plumb the text box info
  - update the text adapter logic to use SkShaper's width-constrained shaping mode
  - tangentially, fix sksg::TextBlob's bounds computation

[1] https://helpx.adobe.com/after-effects/using/creating-editing-text-layers.html

Bug: skia:8849
Change-Id: Ifdb34e39eef84d10fd75870aef785e3ee960a19c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201387
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-15 14:39:17 +00:00