diff options
author | Derek Sollenberger <djsollen@google.com> | 2018-01-22 10:25:26 -0500 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2018-01-24 13:11:39 +0000 |
commit | 2d14213849d6df70d0fa80319ab4ffc08743a683 (patch) | |
tree | 7a0a91fc95fda72f4d7fd360db5eb1cd31989bc1 /libs/hwui/pipeline/skia/SkiaPipeline.cpp | |
parent | e1350ba9ea74b5389c4bf154ca24c0f35bca56ad (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/SkiaPipeline.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaPipeline.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp index 9db39d954e4c..534782a5dc02 100644 --- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp @@ -40,6 +40,7 @@ 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); } @@ -326,6 +327,15 @@ 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 { |