Commit Graph

210 Commits

Author SHA1 Message Date
Florin Malita
270c04af1d [skottie] Avoid redundant instantiation of image asset nodes
Add an attached asset cache, and prevent unnecessary duplication of
image nodes when referenced multiple times.

TBR=
Change-Id: I3f0e8d592b1f57d71c9bc41cec7b2240bdb6d859
Reviewed-on: https://skia-review.googlesource.com/145366
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-08-03 18:49:04 +00:00
Florin Malita
8949c8a2f8 [skottie/sksg] Move source files list to .gni
To facilitate Chromium integration.

Change-Id: Ie6a08e90feda4c6deace9754f0baef7176882334
Reviewed-on: https://skia-review.googlesource.com/145146
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-08-02 16:29:13 +00:00
Mike Reed
6cfa297382 remove conditional flags for sksg -- not needed for a module
Bug: skia:
Change-Id: I1b73379bd8a1ba2cd4293180052ba7ad59dfe96f
Reviewed-on: https://skia-review.googlesource.com/144642
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-07-31 22:27:20 +00:00
Hal Canary
f107a2fd01 SkUTF
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.

SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.

Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.

Also added more unit testing and cleaned up old tests.

Removed functions that were unused outside of tests or used only once.

Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-31 20:11:19 +00:00
Florin Malita
f2dd96fbbc [sksg] Fix image filter quality handling
TBR=

Change-Id: I06bd30650f1a9d70225b3e3374313f672dae3a8d
Reviewed-on: https://skia-review.googlesource.com/144343
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-30 15:38:45 +00:00
Hal Canary
4014ba6ec7 SkUtils: remove some versions of UTF routines.
Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32
Reviewed-on: https://skia-review.googlesource.com/143111
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-25 17:21:56 +00:00
Ben Wagner
d5148e3314 Move SkNoncopyable to include/private.
Change-Id: I62f60ea52faeebddecacf03d9429ac3f7c516b8e
Reviewed-on: https://skia-review.googlesource.com/141823
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-07-17 21:39:51 +00:00
Florin Malita
c45a5c5593 [skottie] Treat color properties as optional (default black)
TBR=
Change-Id: I51029b5718ec9925c214709ae4e3497dae130d37
Reviewed-on: https://skia-review.googlesource.com/141544
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-16 18:43:39 +00:00
Florin Malita
0c604ed06b [skottie] Teach skottie_tool to dump frame SKPs
Similar to saving PNG frames, now we can save SKPs.

TBR=
Change-Id: I5791b564a1d3e70424e45e62034e559e677795f1
Reviewed-on: https://skia-review.googlesource.com/141320
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-15 02:52:38 +00:00
Florin Malita
a487b0677a [skottie] Make stroke width optional
TBR=
Change-Id: I432a79b652ffd5838829f32980e2dcca55d57af4
Reviewed-on: https://skia-review.googlesource.com/141283
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-13 19:06:24 +00:00
Florin Malita
13ac194dbf [skottie] Fix matrix parenting for default/static values
When all matrix properties are static/default, we simply discard the
matrix node.  But we cannot do that in the presence of a parent matrix.

TBR=
Change-Id: I56c62216f18786249dea063690261bfae83fabec
Reviewed-on: https://skia-review.googlesource.com/141127
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-13 00:07:44 +00:00
Florin Malita
4b15dc202f [skottie] Fix polystar points distribution
Points start at bearing 0.

TBR=

Change-Id: I6798b1a5fb4709ab31b13ab76a78f49758e7eec6
Reviewed-on: https://skia-review.googlesource.com/140246
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 19:58:41 +00:00
Florin Malita
a7e78ee1d4 [skottie] Misc cleanup
* pass inline defaults
  * log expressions

TBR=
Change-Id: I5e3ab038d612c738abb1bcf35b4cc492b9aaa6c1
Reviewed-on: https://skia-review.googlesource.com/140240
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 19:58:40 +00:00
Florin Malita
4cbfb30006 [skottie] Log (unsupported) layer effects
TBR=

Change-Id: Ia35e4110cb3c02339a38e82cd0f4516c7c58a5d9
Reviewed-on: https://skia-review.googlesource.com/140251
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 19:53:36 +00:00
Florin Malita
7f8a073fae [skottie] Fix spurious gradient error messages
The adapter apply() method can get called before stops resolution, so
only log when some stops are present.

TBR=

Change-Id: I8e336e2cff781a0e64de31e6b63f3cf373b2daa0
Reviewed-on: https://skia-review.googlesource.com/140245
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 19:53:36 +00:00
Florin Malita
3be2e10ce5 [skottie] Ignore identity transforms
Some tranform properties are not optional, but many of them are static
identity.  Detect these cases and don't attach SG nodes for them.

Reduces the number of sksg::Matrix nodes by ~18%.

TBR=
Change-Id: Ia51c865d6928e8c48c73b30f6d45541caf334880
Reviewed-on: https://skia-review.googlesource.com/140186
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 15:07:04 +00:00
Florin Malita
418e658a69 [skottie] Apply fully opaque masks as clips
We already have a clip optimization when there is only one opaque mask.

Extend to cover multiple opaque masks, using Merge scene nodes.

TBR=
Change-Id: I24b61f0c0d080b13438c6777e98a8e2fefd09fdd
Reviewed-on: https://skia-review.googlesource.com/140002
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-10 13:28:15 +00:00
Florin Malita
502c3ffce8 [skottie] Do not discard SkPath's FillType when interpolating
The fill type is not reflected in shape keyframes, but it is tracked in
the scene graph.  Make sure we don't overwrite when interpolating.

TBR=
Change-Id: I281a61c3f4181ce34f772b36b83d0c7a64e265f6
Reviewed-on: https://skia-review.googlesource.com/139176
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-03 22:36:27 +00:00
Florin Malita
5dfd0694dc [skottie] Add support for comp time remapping
- plumb the framerate in AttachContext (needed for remapping)
  - expand CompTimeMapper to handle time remapping (in addition to
    time start, time stretch)

TBR=
Change-Id: If33bae7b4fe224f45d5a094a47899b9025827991
Reviewed-on: https://skia-review.googlesource.com/138990
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-07-02 19:32:42 +00:00
Florin Malita
8deab3ac1e [skottie] Fix 'subtract' masks
Empirically, AE applies subtract masks as inverted intersect masks: it
applies the opacity *outside* the mask geometry.

Adjust the masking logic accordingly.

TBR=
Change-Id: If8d9dedbed9ce01b623b6c86ea91e494823d5dc5
Reviewed-on: https://skia-review.googlesource.com/138580
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-29 17:40:27 +00:00
Florin Malita
1d7f930763 [skottie] Ensure static split-position properties are committed
We currently drop static split-position adapters without commiting the
value to the scene graph.

TBR=
Change-Id: Id5852da35345fa58ecaf6c752456ecb32e5b405a
Reviewed-on: https://skia-review.googlesource.com/136782
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-22 01:28:06 +00:00
Florin Malita
5361935cd0 [skottie] Simplify AttachMask
Minor cleanup: BindProperty reports whether a non-default property was
applied or bound for animation -- use this mechanism to detect
fully-opaque masks.

TBR=
Change-Id: I3bd9429842621309d0c6bd966ef748917e498c66
Reviewed-on: https://skia-review.googlesource.com/136623
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-21 16:52:48 +00:00
Florin Malita
8c5f9ef801 [skottie] Fix start-time/stretch-time handling
We currently apply start-time/stretch-time adjustments to the referenced
composition AND to the referencing layer local properties.  That last
part is incorrect: the adjustment should only apply to the referenced
composition.

Introduce a specialized composition time mapper to handle t adjustments,
and push the logic down to AttachCompLayer (and out of the generic
AttachLayer).

TBR=
Change-Id: I0ddb86232010a8e7cdac6524aef2eea5823e306d
Reviewed-on: https://skia-review.googlesource.com/136166
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-20 17:17:19 +00:00
Florin Malita
f5ac906476 [skottie] Simplify Parse<SkPoint>
Some BM versions wrap point values as single or even multi-element arrays.
Parse<SkScalar> already handles the former case - we can extend that
behavior to also cover the latter and simplify Parse<SkPoint>.

TBR=

Change-Id: I2152928944f43dc03a5d8f0d65865ac43974fd7a
Reviewed-on: https://skia-review.googlesource.com/135800
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-19 20:01:28 +00:00
Florin Malita
80452bee11 Fold SkJSON into Skia/utils
It's a tiny, core-ish component -- might as well treat as such to
simplify dependencies.

Change-Id: I6f31ce2d151f9a629d88bfc7f15d64891d5150c0
Reviewed-on: https://skia-review.googlesource.com/135780
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-19 18:23:30 +00:00
Florin Malita
fb3beb0591 [skjson] More short string micro-optimizations
When possible, load 8 chars and mask out the tag and \0 terminator.

~19% faster on a Z840, ~5% faster on a PixelC.

Change-Id: I12d4b7d86c92c887b00f5d2480d3ff05a7042df1
Reviewed-on: https://skia-review.googlesource.com/135624
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-19 02:50:58 +00:00
Ben Wagner
f08d1d0ce1 Stop using SkTSwap.
Use std::swap instead. It does not appear that any external user
specializes SkTSwap, but some may still use it. This removes all use in
Skia so that SkTSwap can later be removed in a smaller CL. After that
the <utility> include can be removed from SkTypes.h.

Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753
Reviewed-on: https://skia-review.googlesource.com/135578
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-19 02:06:31 +00:00
Florin Malita
94d4d3e20b [skottie] Fix OOB access in Parse<SkPoint>
SkJSON requires valid array indices, so callers must guard against
out-of-bounds conditions explicitly.

Bug: oss-fuzz:8956
Change-Id: I50b96b088e44a4c1a569e6911d4be5d75799b464
Reviewed-on: https://skia-review.googlesource.com/135445
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-06-18 17:33:18 +00:00
Florin Malita
0052a31868 [skjson] Detect end-of-input for unbalanced strings
We currently blow through string chars without checking for end-of-input.

Maybe we could avoid this upfront, when we locate the stop char: try to
determine if it's part of an unterminated string, fail immediately if
so.  Figuring out if the tail is an unterminated string seems
intractable though (requires arbitrarily deep tail parsing).

That brings us to plan B:

  * treat scope-closing tokens (} & ]) as string terminators
    (we know end-of-input points to one of these for sure)

  * adjust matchString() to check for end-of-input

Bug: oss-fuzz:8899
Change-Id: Ic0a88a405548e8724b76faca525099a7e7037341
Reviewed-on: https://skia-review.googlesource.com/135145
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-06-15 21:04:35 +00:00
Florin Malita
587f5a9a30 [skjson] Catch end-of-stream for unbalanced scopes
The input is not guaranteed to contain well-formed scopes, so it's not
sufficient to check for end-of-stream only when popping the top-level
scope -- we have to check on every scope pop.

Bug: oss-fuzz:8898
Change-Id: I7399a8872187ec6714672cac2ff8fc7fbf3c2dfe
Reviewed-on: https://skia-review.googlesource.com/135059
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-15 13:56:44 +00:00
Florin Malita
d7bfcaf57c [skjson] Some short string optimizations
1) skip redundant \0 terminator => Value is always zero-initialized

2) skip storing a len record => strlen is cheap for short strings

Change-Id: I3c10c9b9cf6155b95124e2c0194c59e9531a7ca4
Reviewed-on: https://skia-review.googlesource.com/135049
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-15 12:27:04 +00:00
Florin Malita
7d42c44cdd [skottie] Switch to SkJSON
Convert to SkJSON APIs and remove RapidJSON dependency.

TBR=
Change-Id: I5b4fd78821a443326e3a5b370748d840b80ef279
Reviewed-on: https://skia-review.googlesource.com/134612
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 21:21:14 +00:00
Florin Malita
fedfd5402c Reland [skjson] Size-constrained input API
Pass an explicit input size instead of requiring a C string.

Thanks to mtklein's clever trick, this has no measurable perf impact.

TBR=
Change-Id: Ic8cb1dc75f4d0814e5b2c80038d1b8d3a7b072ab
Reviewed-on: https://skia-review.googlesource.com/134946
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 19:40:04 +00:00
Florin Malita
0510edeebf Revert "[skjson] Size-constrained input API"
This reverts commit fc792b8718.

Reason for revert: New ASAN, Android failures.

Original change's description:
> [skjson] Size-constrained input API
> 
> Pass an explicit input size instead of requiring a C string.
> 
> Thanks to mtklein's clever trick, this has no measurable perf impact.
> 
> Change-Id: I64f210a9f653a78b05ab6b58fa34479504aa35ff
> Reviewed-on: https://skia-review.googlesource.com/134940
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>

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

Change-Id: Ic0b52398b1ce6f64c781debb858829cb64bbae58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135022
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 18:41:50 +00:00
Florin Malita
28f5dd8a4c [skjson] Fix ASAN undefined behavior
ASAN opines that a nullptr memcpy dest is undefined behavior, even when
n == 0.  ASAN may be right.

This doesn't occur internally, in the parser, but can be triggered with
the DOM builder API (as do some tests currently).

We could say "don't do that", but if someone wants to build an empty
string/array/object, it's kind of awkward to force them to provide a
valid source pointer instead of simply e.g. Array(nullptr, 0).

So let's guard for this case to make ASAN happy.

Change-Id: If12e39f5eb8b273f22bbb0b5fce3321bf6482173
Reviewed-on: https://skia-review.googlesource.com/134944
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 18:23:47 +00:00
Florin Malita
fc792b8718 [skjson] Size-constrained input API
Pass an explicit input size instead of requiring a C string.

Thanks to mtklein's clever trick, this has no measurable perf impact.

Change-Id: I64f210a9f653a78b05ab6b58fa34479504aa35ff
Reviewed-on: https://skia-review.googlesource.com/134940
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 18:13:19 +00:00
Florin Malita
ae2527964f Reland [skjson] Implementation/API tweaks
*  move most common accessor methods to the header, for inlining
  *  drop the lazy type checking semantics in favor of explicit guarded/unguarded
     conversions
  *  revisit the public class hierarchy to better constrain type-bound APIs
  *  expose public type factories and add tests
  *  drop the empty-vector optimization -- allocating an external size_t in these
     uncommon cases is better than paying for a conditional on every access.

TBR=
Change-Id: Ic609bb74f12cad1756865a2489ad56c03ecc5494
Reviewed-on: https://skia-review.googlesource.com/134845
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 15:49:57 +00:00
Florin Malita
5ff4fb286c Revert "[skjson] Implementation/API tweaks"
This reverts commit 03b68421ca.

Reason for revert: Broke Debian9 builds

Original change's description:
> [skjson] Implementation/API tweaks
> 
>   *  move most common accessor methods to the header, for inlining
>   *  drop the lazy type checking semantics in favor of explicit guarded/unguarded
>      conversions
>   *  revisit the public class hierarchy to better constrain type-bound APIs
>   *  expose public type factories and add tests
>   *  drop the empty-vector optimization -- allocating an external size_t in these
>      uncommon cases is better than paying for a conditional on every access.
> 
> Change-Id: I24a7c75db3aa8b12c740c77ac7df4af4e3a1dff8
> Reviewed-on: https://skia-review.googlesource.com/134610
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I2c681ef5c8d5fc15508e58b4b0f6ab9491b7d76f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134880
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-14 15:16:48 +00:00
Florin Malita
03b68421ca [skjson] Implementation/API tweaks
*  move most common accessor methods to the header, for inlining
  *  drop the lazy type checking semantics in favor of explicit guarded/unguarded
     conversions
  *  revisit the public class hierarchy to better constrain type-bound APIs
  *  expose public type factories and add tests
  *  drop the empty-vector optimization -- allocating an external size_t in these
     uncommon cases is better than paying for a conditional on every access.

Change-Id: I24a7c75db3aa8b12c740c77ac7df4af4e3a1dff8
Reviewed-on: https://skia-review.googlesource.com/134610
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-14 15:07:47 +00:00
Hal Canary
c640d0dc96 Revert "Revert "SkTypes: extract SkTo""
This reverts commit fdcfb8b7c2.

> Original change's description:
> > SkTypes: extract SkTo
> >
> > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> > Reviewed-on: https://skia-review.googlesource.com/133620
> > Reviewed-by: Mike Klein <mtklein@google.com>

Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa
Reviewed-on: https://skia-review.googlesource.com/134506
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 14:55:17 +00:00
Hal Canary
fdcfb8b7c2 Revert "SkTypes: extract SkTo"
This reverts commit 2a2f675926.

Reason for revert: this appears to be what is holding up the Chrome roll.

Original change's description:
> SkTypes: extract SkTo
>
> Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> Reviewed-on: https://skia-review.googlesource.com/133620
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,halcanary@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae
Reviewed-on: https://skia-review.googlesource.com/134504
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-13 13:45:47 +00:00
Hal Canary
2a2f675926 SkTypes: extract SkTo
Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
Reviewed-on: https://skia-review.googlesource.com/133620
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-12 15:03:21 +00:00
Florin Malita
46fbf8c97a Disable module deps in Android Framework builds
Module-related functionality is not required in dm/bench at this point.

Let's disable module deps flattening for now.  As an immediate benefit
we can reduce the deps visibility for some internal skjson targets.

Bug: skia:8061
Change-Id: I0e09208964ca94b519121207ba1b6225059ef573
Reviewed-on: https://skia-review.googlesource.com/133822
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-11 15:00:31 +00:00
Florin Malita
92206a435b [skottie] Fix color parsing
Currently truncating unnecessarily.

TBR=
Change-Id: I1929a4de62364e4685eb67f9a79b01a8dbac1c61
Reviewed-on: https://skia-review.googlesource.com/133823
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-10 21:34:13 +00:00
Florin Malita
7796f00dcf SkJson
For now this is only wired to a bench and a couple of tests.

Local numbers, for a ~500KB BM "compressed" json:

    micros   	bench
   2456.54  	json_rapidjson	nonrendering
   1192.38  	json_skjson	nonrendering


Change-Id: I7b3514f84c7c525d1787722c43ad6095e3692563
Reviewed-on: https://skia-review.googlesource.com/127622
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-08 17:45:33 +00:00
Florin Malita
79725d3271 [skottie] Add a tool for dumping encoded animation frames
Exports animation frames as a sequence of .png files:

  0000000.png
  0000001.png
  ...

Usage:

  skottie_tool -i <input_json> -w <out_dir>

Other options:

  --width  Frame width (default: 800)
  --height Frame height (default: 600)
  --fps    Frames per second (default: 30)
  --t0     Normalized timeline start (default: 0)
  --t1     Normalized timeline end (default: 1)

Change-Id: I4a79be0f823da15e6863909b6d67d38aa74bb740
Reviewed-on: https://skia-review.googlesource.com/132265
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-06 01:41:12 +00:00
Brian Osman
ccb87523a2 Revert "Rename sg tests and samples targets to fix Visual Studio name conflict"
This reverts commit ba2f82986f.

Reason for revert: This is going to be hard to maintain long-term. I've fixed the python script to handle this case: https://skia-review.googlesource.com/c/skia/+/131580

Original change's description:
> Rename sg tests and samples targets to fix Visual Studio name conflict
> 
> GN was emitting projects for the SG versions of tests and samples, which
> conflicted with the top-level versions of those. This made the normal GN
> VS IDE files confusing, and the merged ones totally broken.
> 
> Change-Id: Ifd048258d4358ed2852d5263b16278c5b8ebd9c4
> Reviewed-on: https://skia-review.googlesource.com/131391
> Commit-Queue: Brian Osman <brianosman@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Auto-Submit: Brian Osman <brianosman@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=jvanverth@google.com,brianosman@google.com,fmalita@chromium.org,fmalita@google.com

Change-Id: I25553fdcfd063c920635fe1bd71553b578d0b0c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/131600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-01 19:20:07 +00:00
Kevin Lubick
f14bc98b2f Avoid compilation error on older compilers
The constness on null_provider causes:
 "default initialization of an object of const type
 'const NullResourceProvider' without a user-provided default constructor"

See https://stackoverflow.com/a/47368753 for more.

TL;DR; clang 3.8 and older is not happy

Bug: skia:
Change-Id: Icfc38680163c3bd4952c0e35551706cad8dbfee6
Reviewed-on: https://skia-review.googlesource.com/131521
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-06-01 17:28:56 +00:00
Brian Osman
ba2f82986f Rename sg tests and samples targets to fix Visual Studio name conflict
GN was emitting projects for the SG versions of tests and samples, which
conflicted with the top-level versions of those. This made the normal GN
VS IDE files confusing, and the merged ones totally broken.

Change-Id: Ifd048258d4358ed2852d5263b16278c5b8ebd9c4
Reviewed-on: https://skia-review.googlesource.com/131391
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-06-01 15:12:26 +00:00
Florin Malita
911ae4066e [skottie] Remove inPoint/outPoint/frameRate from public API
TBR=
Change-Id: Ice4de3abe350c4570c22e859a36dbd445527fa41
Reviewed-on: https://skia-review.googlesource.com/131300
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-01 13:10:15 +00:00
Florin Malita
c83a0deaa8 [skottie] Make the resource provider factory argument optional
Most of the existing clients don't care about nested resources.

Change-Id: Ie7991dd25ebbd679b5b49e5624772c7e19e7ec79
Reviewed-on: https://skia-review.googlesource.com/131141
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-31 16:39:13 +00:00
Florin Malita
8f480d91ee Add 'public' headers support to find_headers.py
Update the script to search for headers in both 'sources' and 'public'.

Change-Id: I195c6e3720f3d3d99dea04628388821a58fa791b
Reviewed-on: https://skia-review.googlesource.com/130823
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-30 18:00:09 +00:00
Florin Malita
6e4d95f804 Add Skottie support to Fiddle
Change-Id: I2d89c1340215b43476337c354057328c1bb2b8ff
Reviewed-on: https://skia-review.googlesource.com/130720
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-30 13:50:08 +00:00
Herb Derby
264182c3f7 Make SkShaper a module
Change-Id: I3709e49ba865f14260660cc07a762b9ac837cb3c
Reviewed-on: https://skia-review.googlesource.com/130602
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-30 04:04:07 +00:00
Florin Malita
a33447dab9 [skottie] Animation::animationTick() -> Animation::seek()
Replace poorly defined animationTick() with a normalized seek() method.

TBR=
Change-Id: Id2ea17bb426fe86fede0d6c8a3d93236902f10af
Reviewed-on: https://skia-review.googlesource.com/130508
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-29 18:58:16 +00:00
Florin Malita
77f2db7339 Clean up modules/skottie/BUILD.gn
Per comments in https://skia-review.googlesource.com/c/skia/+/130480

Change-Id: I978b04e4b06bf01c008b44540c640b77f5900f12
Reviewed-on: https://skia-review.googlesource.com/130501
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-29 14:50:05 +00:00
Kevin Lubick
457fa97bc8 Fix fuzz+Skottie integration
Bug: skia:
Change-Id: Ic926f6a838ac1e6d358d51913dc5c58d3083274a
Reviewed-on: https://skia-review.googlesource.com/130480
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-05-29 13:46:45 +00:00
Florin Malita
3d856bdeee [skottie] Relocate to modules/skottie
TBR=
Change-Id: I218d251ca56578a3a7fd4fb86cba9abdc10fb3bd
Reviewed-on: https://skia-review.googlesource.com/130322
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-27 02:21:33 +00:00
Florin Malita
50d9c94846 [sksg] Fix WASM build
Bug: skia:
Change-Id: I62c18765d13e2b64ec06fc913e91a3b492fb022f
Reviewed-on: https://skia-review.googlesource.com/130132
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-25 18:07:52 +00:00
Florin Malita
3b526b05d6 "Modularize" SkSG
* relocate all SkSG-related files under modules/sksg/
* fix various tidbits to make non-sksg builds possible
* drop obsolete SampleSGInval.cpp

Change-Id: I54e6c5bb1a09f45030fa8d607b3eb3f7cba78957
Reviewed-on: https://skia-review.googlesource.com/130025
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-25 17:11:52 +00:00