summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2016-02-04 16:16:27 -0800
committerDoris Liu <tianliu@google.com>2016-02-05 11:12:25 -0800
commitef062ebd20032efe697741d6c3dfd1faec54f590 (patch)
treea5b550adfd046ef3e0a155de55004e9c8d663200 /libs/hwui/VectorDrawable.cpp
parent766431aa57c16ece8842287a92b2e7208e3b8ac3 (diff)
Ref count the nodes in VectorDrawable
Also added API check so that for pre-N we ignore invalid VD animation, in order to avoid breaking old apps. Bug: 26975469 Bug: 26949340 Change-Id: I498539ad6a05de3d886e7dcdc8a167e78333ab11
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index 541c799f0149..2e3856fafb60 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -324,7 +324,7 @@ void Group::draw(SkCanvas* outCanvas, const SkMatrix& currentMatrix, float scale
// Save the current clip information, which is local to this group.
outCanvas->save();
// Draw the group tree in the same order as the XML file.
- for (Node* child : mChildren) {
+ for (auto& child : mChildren) {
child->draw(outCanvas, stackedMatrix, scaleX, scaleY);
}
// Restore the previous clip information.
@@ -361,7 +361,7 @@ void Group::getLocalMatrix(SkMatrix* outMatrix) {
}
void Group::addChild(Node* child) {
- mChildren.push_back(child);
+ mChildren.emplace_back(child);
}
bool Group::getProperties(float* outProperties, int length) {