Loading libs/hwui/DisplayListCanvas.cpp +1 −6 Original line number Original line Diff line number Diff line Loading @@ -415,12 +415,7 @@ void DisplayListCanvas::drawPoints(const float* points, int count, const SkPaint void DisplayListCanvas::drawVectorDrawable(VectorDrawableRoot* tree) { void DisplayListCanvas::drawVectorDrawable(VectorDrawableRoot* tree) { mDisplayList->ref(tree); mDisplayList->ref(tree); const SkBitmap& bitmap = tree->getBitmapUpdateIfDirty(); addDrawOp(new (alloc()) DrawVectorDrawableOp(tree)); 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, void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count, Loading libs/hwui/DisplayListOp.h +25 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "UvMapper.h" #include "UvMapper.h" #include "utils/LinearAllocator.h" #include "utils/LinearAllocator.h" #include "utils/PaintUtils.h" #include "utils/PaintUtils.h" #include "VectorDrawable.h" #include <algorithm> #include <algorithm> Loading Loading @@ -1107,6 +1108,30 @@ private: float* mRadius; float* mRadius; }; }; class DrawVectorDrawableOp : public DrawOp { public: DrawVectorDrawableOp(VectorDrawableRoot* tree) : DrawOp(nullptr), mTree(tree) {} virtual void applyDraw(OpenGLRenderer& renderer, Rect& dirty) override { const SkBitmap& bitmap = mTree->getBitmapUpdateIfDirty(); SkPaint* paint = mTree->getPaint(); const SkRect bounds = mTree->getBounds(); renderer.drawBitmap(&bitmap, Rect(0, 0, bitmap.width(), bitmap.height()), bounds, paint); } virtual void output(int level, uint32_t logFlags) const override { OP_LOG("Draw Vector Drawable %p", mTree); } virtual const char* name() override { return "DrawVectorDrawable"; } private: VectorDrawableRoot* mTree; }; class DrawOvalOp : public DrawStrokableOp { class DrawOvalOp : public DrawStrokableOp { public: public: DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint) DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint) Loading Loading
libs/hwui/DisplayListCanvas.cpp +1 −6 Original line number Original line Diff line number Diff line Loading @@ -415,12 +415,7 @@ void DisplayListCanvas::drawPoints(const float* points, int count, const SkPaint void DisplayListCanvas::drawVectorDrawable(VectorDrawableRoot* tree) { void DisplayListCanvas::drawVectorDrawable(VectorDrawableRoot* tree) { mDisplayList->ref(tree); mDisplayList->ref(tree); const SkBitmap& bitmap = tree->getBitmapUpdateIfDirty(); addDrawOp(new (alloc()) DrawVectorDrawableOp(tree)); 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, void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count, Loading
libs/hwui/DisplayListOp.h +25 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include "UvMapper.h" #include "UvMapper.h" #include "utils/LinearAllocator.h" #include "utils/LinearAllocator.h" #include "utils/PaintUtils.h" #include "utils/PaintUtils.h" #include "VectorDrawable.h" #include <algorithm> #include <algorithm> Loading Loading @@ -1107,6 +1108,30 @@ private: float* mRadius; float* mRadius; }; }; class DrawVectorDrawableOp : public DrawOp { public: DrawVectorDrawableOp(VectorDrawableRoot* tree) : DrawOp(nullptr), mTree(tree) {} virtual void applyDraw(OpenGLRenderer& renderer, Rect& dirty) override { const SkBitmap& bitmap = mTree->getBitmapUpdateIfDirty(); SkPaint* paint = mTree->getPaint(); const SkRect bounds = mTree->getBounds(); renderer.drawBitmap(&bitmap, Rect(0, 0, bitmap.width(), bitmap.height()), bounds, paint); } virtual void output(int level, uint32_t logFlags) const override { OP_LOG("Draw Vector Drawable %p", mTree); } virtual const char* name() override { return "DrawVectorDrawable"; } private: VectorDrawableRoot* mTree; }; class DrawOvalOp : public DrawStrokableOp { class DrawOvalOp : public DrawStrokableOp { public: public: DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint) DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint) Loading