summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaPipeline.cpp
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2018-01-26 11:03:54 -0500
committerLeon Scroggins III <scroggo@google.com>2018-01-29 21:08:18 -0500
commit5b7f426ff04820f81877ccb696bf6245dede89e7 (patch)
tree8609bad328fc4a720ef2c880680bffe4bb3074f1 /libs/hwui/pipeline/skia/SkiaPipeline.cpp
parent86356ec7a688f703242b7529b920de2207050704 (diff)
Use a separate thread to decode AnimatedImageDrawable
Bug: 63908092 Test: Manual: Ie18811ba29a1db163aca08472b04ae185e9344f0 Depends on https://skia-review.googlesource.com/#/c/skia/+/101544. That change removes the Skia class's time checks, and leaving it up to the client to keep track of the time. In this case, the client wants to keep track of the time because it only wants to update while it is being drawn. If it goes off screen (for example), it will just resume where it left off when it returns on screen. This allows for smooth animations. If an AnimatedImageDrawable is being drawn to a SkiaRecordingCanvas, decode on the new (lazily-created) AnimatedImageThread. When running, always decode one frame ahead on the AnimatedImageThread so that it will be ready when it is time to display. During prepareTree, update the time and check whether there is a new frame ready to draw or the next frame needs to be decoded. In either case, return true. The next frame to be decoded will be triggered by onDraw. Change-Id: If447976e9df417060a950f658dbca9cf7980dd02
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaPipeline.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 534782a5dc02..9db39d954e4c 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -40,7 +40,6 @@ uint8_t SkiaPipeline::mSpotShadowAlpha = 0;
Vector3 SkiaPipeline::mLightCenter = {FLT_MIN, FLT_MIN, FLT_MIN};
SkiaPipeline::SkiaPipeline(RenderThread& thread) : mRenderThread(thread) {
- mAnimatedImageDrawables.reserve(30);
mVectorDrawables.reserve(30);
}
@@ -327,15 +326,6 @@ void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& cli
ATRACE_NAME("flush commands");
surface->getCanvas()->flush();
-
- // TODO move to another method
- if (!mAnimatedImageDrawables.empty()) {
- ATRACE_NAME("Update AnimatedImageDrawables");
- for (auto animatedImage : mAnimatedImageDrawables) {
- animatedImage->scheduleUpdate(getTaskManager());
- }
- mAnimatedImageDrawables.clear();
- }
}
namespace {