summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaDisplayList.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index aa14699ae4c2..82179a37f5be 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -93,12 +93,18 @@ bool SkiaDisplayList::prepareListAndChildren(
bool isDirty = false;
for (auto& animatedImage : mAnimatedImages) {
+ nsecs_t timeTilNextFrame = TreeInfo::Out::kNoAnimatedImageDelay;
// If any animated image in the display list needs updated, then damage the node.
- if (animatedImage->isDirty()) {
+ if (animatedImage->isDirty(&timeTilNextFrame)) {
isDirty = true;
}
- if (animatedImage->isRunning()) {
- info.out.hasAnimations = true;
+
+ if (animatedImage->isRunning() &&
+ timeTilNextFrame != TreeInfo::Out::kNoAnimatedImageDelay) {
+ auto& delay = info.out.animatedImageDelay;
+ if (delay == TreeInfo::Out::kNoAnimatedImageDelay || timeTilNextFrame < delay) {
+ delay = timeTilNextFrame;
+ }
}
}