Commit Graph

10 Commits

Author SHA1 Message Date
Florin Malita
7806794543 [skottie] Initial audio layer plumbing
Looking at audio layer support for Skottie, we need an API to
externalize audio asset loading and playback.

Similar approach to the other resource types for loading, but in
addition we also delegate playback control to the embedder.

First thought: keep it really simple and just emit seek() events.
Positive |t|s for track playback, negative for track off.

The embedder needs to implement state menagement (playing/not-playing)
and optional synchronization (if animation playback is not real time).

Change-Id: I54d1c2c39d0c38dd926f7c93764bde6695cb3fe2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309317
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-08-12 13:03:16 +00:00
Florin Malita
ef666fa83d [skottie] Avoid image data duplication when pre-decoding
The MultiFrameImageAsset helper can be flagged to decode lazy images
upfront (to avoid run-time decoding and resource cache interactions).

But when pre-decoding is enabled, MultiFrameImageAsset yields a
different SkImage for every request - *even for static images*.

This means that e.g. each image layer precomp instance gets its own
copy of the data.  Bad bad bad.

Update MultiFrameImageAsset to cache the last frame, and reuse when
backed by a static image.

Change-Id: I65431e7ccf4a64f0055f935f9823c33402d1bb2b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306938
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-07-30 22:09:41 +00:00
Florin Malita
d1ae99438e [skottie] Add support for inline/data-uri fonts
BM can now export inline fonts, encoded as data-uris.

Extend our DataURIResourceProviderProxy helper to also intercept and
decode inline typefaces.

Change-Id: Iaf1be9db2fd32383af78bc351b1228fe6b3b64bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305685
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-25 13:46:52 +00:00
Florin Malita
d140e767b8 ResourceProviderProxyBase should not drop loadFont (yet)
Although deprecated, loadFont is still in use - we should proxy it for
now.

Change-Id: Iccef76d4ba394d08fc61c7471def8dee470db695
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305516
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-23 18:26:50 +00:00
Florin Malita
1d585c219b [skottie] SkResources::loadTypeface() callback
Some clients already have SkTypeface objects, and forcing them to pass
these as SkData is awkward - especially since Skottie immediately turns
them into SkTypeface again.

Replace the existing loadFont() callback with loadTypeface().

(for compatibility, we try both for now, but the plan is to phase-out
loadFont)

Change-Id: Ib4c2446a96cb6a5f95581c405d0a1b4ecff7ddb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296718
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-06-16 18:53:04 +00:00
Florin Malita
123e3b893f [skottie/tools] Video playback support
Implement a VideoAsset wrapper, used for Skottie video layers.  This
requires a non-testlib build target for SkVideoDecoder, hence a
dedicated BUILD.gn.

Add software conversion fallback for SkVideoDecoder, using libswscale.

Change-Id: I80dd555a1241081e50ee4834b64ad3518948a0f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285378
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-04-24 15:56:50 +00:00
Mike Klein
a01c6b0b59 reformat GN files
Change-Id: I2d19c4f0ff1439dcd923a3064eb3ba78432a5113
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281043
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-04-01 23:23:03 +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
Brian Osman
849f4d6571 Copy SkottieUtils' classes into skresources
For now, we'll have two copies. Once clients are using the skresources
versions exclusively, we can remove the originals from skottie.

Change-Id: I3152f526b0505b8374bdd9b4513a80bddc702ccc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256416
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-26 14:25:44 +00:00
Brian Osman
85bf9314c0 Extracted Skottie's resource provider to a separate module
This is a first pass that should help with migrating clients.
The utility implementations of ResourceProvider are still in
skottie - those are going to be harder to move. More likely
that I'll add parallel implementations in skresources, then
we can shift clients over and delete the skottie copy.

I'm planning to use this interface/system in particles.

Bug: skia:9513
Change-Id: I004da685983c05cb1b48a75f8a23bd7d73a3f5af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256077
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-25 18:58:26 +00:00