diff options
author | 2018-01-22 10:25:26 -0500 | |
---|---|---|
committer | 2018-01-24 13:11:39 +0000 | |
commit | 2d14213849d6df70d0fa80319ab4ffc08743a683 (patch) | |
tree | 7a0a91fc95fda72f4d7fd360db5eb1cd31989bc1 /libs/hwui/SkiaCanvas.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/SkiaCanvas.cpp')
-rw-r--r-- | libs/hwui/SkiaCanvas.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp index dc274cf50a52..b2edd3392873 100644 --- a/libs/hwui/SkiaCanvas.cpp +++ b/libs/hwui/SkiaCanvas.cpp @@ -725,18 +725,8 @@ void SkiaCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& chunk, floa mCanvas->drawImageLattice(image.get(), lattice, dst, addFilter(paint, &tmpPaint, colorFilter)); } -void SkiaCanvas::drawAnimatedImage(SkAnimatedImage* image, float left, float top, - const SkPaint* paint) { - sk_sp<SkPicture> pic(image->newPictureSnapshot()); - SkMatrix matrixStorage; - SkMatrix* matrix; - if (left == 0.0f && top == 0.0f) { - matrix = nullptr; - } else { - matrixStorage = SkMatrix::MakeTrans(left, top); - matrix = &matrixStorage; - } - mCanvas->drawPicture(pic.get(), matrix, paint); +double SkiaCanvas::drawAnimatedImage(AnimatedImageDrawable* imgDrawable) { + return imgDrawable->drawStaging(mCanvas); } void SkiaCanvas::drawVectorDrawable(VectorDrawableRoot* vectorDrawable) { |