summaryrefslogtreecommitdiff
path: root/libs/hwui/RecordingCanvas.cpp
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2016-05-17 16:50:31 -0700
committerDoris Liu <tianliu@google.com>2016-06-09 10:27:59 -0700
commit718cd3eb70703c43f29ca37907bbf0e153d8cca0 (patch)
treecf1d4ce2d7c0a2ca19289257d3a8538ecfbaf8cb /libs/hwui/RecordingCanvas.cpp
parenta2da20d3344010b8f3ca6cc5fea265984662959c (diff)
Handle hidden RT VectorDrawable animators
This CL changes the target of VD specific animators to VectorDrawable, instead of RenderNode. The benefit of doing so is that animators can now detect whether the animation is meaningful by checking whether their VD target is in the display list. If not, that means the VD is not drawing for the current frame, in which case we can be smarter and more power efficient by removing the animator from the list and posting a delayed onFinished listener callback. By setting VD as the animation target, when an ImageView decides to update its drawable from one AVD to something else, we'll be able to detect that the previous AVD is no longer in the display list, and stop providing animation pulse to the stale AVD, which is something we couldn't do previously. This change also handles the case where one AVD instance could be drawn in two different views. Bug: 27441375 Change-Id: Iaad1ed09cfd526276b95db0dd695275c28e074e8
Diffstat (limited to 'libs/hwui/RecordingCanvas.cpp')
-rw-r--r--libs/hwui/RecordingCanvas.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index b49f9b529989..b35c92612a42 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -440,8 +440,8 @@ void RecordingCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
}
void RecordingCanvas::drawVectorDrawable(VectorDrawableRoot* tree) {
- mDisplayList->pushStagingFunctors.push_back(tree->getFunctor());
mDisplayList->ref(tree);
+ mDisplayList->vectorDrawables.push_back(tree);
addOp(alloc().create_trivial<VectorDrawableOp>(
tree,
Rect(tree->stagingProperties()->getBounds()),