Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""
This reverts commit 5a11e8d0ba21624025b89ac63bbd18befa55be0e.
Change-Id: I7a48b59c4f930dad65ddc8590c25a12636244ea2
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index 7eaa785..3db14b5 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -16,11 +16,12 @@
#include "DisplayListCanvas.h"
-#include "ResourceCache.h"
#include "DeferredDisplayList.h"
#include "DeferredLayerUpdater.h"
#include "DisplayListOp.h"
+#include "ResourceCache.h"
#include "RenderNode.h"
+#include "VectorDrawable.h"
#include "utils/PaintUtils.h"
#include <SkCamera.h>
@@ -412,6 +413,16 @@
addDrawOp(new (alloc()) DrawPointsOp(points, count, refPaint(&paint)));
}
+void DisplayListCanvas::drawVectorDrawable(VectorDrawableRoot* tree) {
+ mDisplayList->ref(tree);
+ const SkBitmap& bitmap = tree->getBitmapUpdateIfDirty();
+ SkPaint* paint = tree->getPaint();
+ const SkRect bounds = tree->getBounds();
+ addDrawOp(new (alloc()) DrawBitmapRectOp(refBitmap(bitmap),
+ 0, 0, bitmap.width(), bitmap.height(),
+ bounds.left(), bounds.top(), bounds.right(), bounds.bottom(), refPaint(paint)));
+}
+
void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count,
const SkPath& path, float hOffset, float vOffset, const SkPaint& paint) {
if (!glyphs || count <= 0) return;