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>
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>
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>
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>
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>
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>
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>
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>
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>
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>