summaryrefslogtreecommitdiff
path: root/libs/hwui/FrameBuilder.cpp
diff options
context:
space:
mode:
author Doris Liu <tianliu@google.com> 2016-01-07 13:49:26 -0800
committer Doris Liu <tianliu@google.com> 2016-02-02 15:04:01 -0800
commitf276acd98457bcaabc9e79a17a736b3b484f005e (patch)
treeb9efee10194c520b09a4813f7b8074be9a2f99c8 /libs/hwui/FrameBuilder.cpp
parent650e3b70e4aa2fa9acf2f9c6ce211c4b46862c15 (diff)
VectorDrawable native rendering - Step 4 of MANY
This CL runs VectorDrawable animation on RenderThread. The changes in this CL include: - Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators. - Hook up the new animators with RenderThread - Add drawOp in RecordingCanvas for drawing VD so that during the animation on RenderThread, all the property changes on VD can be reflected on the screen. TODO: - Implement reverse and reset for AVD. Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
Diffstat (limited to 'libs/hwui/FrameBuilder.cpp')
-rw-r--r--libs/hwui/FrameBuilder.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp
index a45721249542..4740e1f13bda 100644
--- a/libs/hwui/FrameBuilder.cpp
+++ b/libs/hwui/FrameBuilder.cpp
@@ -19,6 +19,7 @@
#include "Canvas.h"
#include "LayerUpdateQueue.h"
#include "RenderNode.h"
+#include "VectorDrawable.h"
#include "renderstate/OffscreenBufferPool.h"
#include "utils/FatVector.h"
#include "utils/PaintUtils.h"
@@ -534,6 +535,18 @@ void FrameBuilder::deferBitmapRectOp(const BitmapRectOp& op) {
currentLayer().deferUnmergeableOp(mAllocator, bakedState, OpBatchType::Bitmap);
}
+void FrameBuilder::deferVectorDrawableOp(const VectorDrawableOp& op) {
+ const SkBitmap& bitmap = op.vectorDrawable->getBitmapUpdateIfDirty();
+ SkPaint* paint = op.vectorDrawable->getPaint();
+ const BitmapRectOp* resolvedOp = new (mAllocator) BitmapRectOp(op.unmappedBounds,
+ op.localMatrix,
+ op.localClip,
+ paint,
+ &bitmap,
+ Rect(bitmap.width(), bitmap.height()));
+ deferBitmapRectOp(*resolvedOp);
+}
+
void FrameBuilder::deferCirclePropsOp(const CirclePropsOp& op) {
// allocate a temporary oval op (with mAllocator, so it persists until render), so the
// renderer doesn't have to handle the RoundRectPropsOp type, and so state baking is simple.