summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2018-01-22 10:25:26 -0500
committerLeon Scroggins <scroggo@google.com>2018-01-24 13:11:39 +0000
commit2d14213849d6df70d0fa80319ab4ffc08743a683 (patch)
tree7a0a91fc95fda72f4d7fd360db5eb1cd31989bc1 /libs/hwui/pipeline/skia/SkiaDisplayList.cpp
parente1350ba9ea74b5389c4bf154ca24c0f35bca56ad (diff)
Initial implmentation of AnimatedImageDrawables on the RenderThread.
The current implementation schedules the next frame of the images to be decoded after the current frame completes but potentially schedules tasks that will result in a no-op execution if a new frame is not yet needed. Test: HwAccelerationTest Change-Id: I0510cb5a1b801abd651327e924deb586af0306d6
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaDisplayList.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index cb10901c4ccf..cf0b6a4d1dcc 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -31,6 +31,9 @@ void SkiaDisplayList::syncContents() {
for (auto& functor : mChildFunctors) {
functor.syncFunctor();
}
+ for (auto& animatedImage : mAnimatedImages) {
+ animatedImage->syncProperties();
+ }
for (auto& vectorDrawable : mVectorDrawables) {
vectorDrawable->syncProperties();
}
@@ -89,6 +92,18 @@ bool SkiaDisplayList::prepareListAndChildren(
}
bool isDirty = false;
+ for (auto& animatedImage : mAnimatedImages) {
+ // If any animated image in the display list needs updated, then damage the node.
+ if (animatedImage->isDirty()) {
+ isDirty = true;
+ }
+ if (animatedImage->isRunning()) {
+ static_cast<SkiaPipeline*>(info.canvasContext.getRenderPipeline())
+ ->scheduleDeferredUpdate(animatedImage);
+ info.out.hasAnimations = true;
+ }
+ }
+
for (auto& vectorDrawable : mVectorDrawables) {
// If any vector drawable in the display list needs update, damage the node.
if (vectorDrawable->isDirty()) {
@@ -109,6 +124,7 @@ void SkiaDisplayList::reset() {
mMutableImages.clear();
mVectorDrawables.clear();
+ mAnimatedImages.clear();
mChildFunctors.clear();
mChildNodes.clear();