summaryrefslogtreecommitdiff
path: root/libs/hwui
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DisplayListOp.h28
-rw-r--r--libs/hwui/DisplayListRenderer.cpp17
-rw-r--r--libs/hwui/DisplayListRenderer.h4
3 files changed, 49 insertions, 0 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 5ff7b7f00465..cb3ef9b962a1 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -1105,6 +1105,34 @@ private:
float mRy;
};
+class DrawRoundRectPropsOp : public DrawOp {
+public:
+ DrawRoundRectPropsOp(float* left, float* top, float* right, float* bottom,
+ float *rx, float *ry, const SkPaint* paint)
+ : DrawOp(paint), mLeft(left), mTop(top), mRight(right), mBottom(bottom),
+ mRx(rx), mRy(ry) {}
+
+ virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
+ return renderer.drawRoundRect(*mLeft, *mTop, *mRight, *mBottom,
+ *mRx, *mRy, getPaint(renderer));
+ }
+
+ virtual void output(int level, uint32_t logFlags) const {
+ OP_LOG("Draw RoundRect Props " RECT_STRING ", rx %f, ry %f",
+ *mLeft, *mTop, *mRight, *mBottom, *mRx, *mRy);
+ }
+
+ virtual const char* name() { return "DrawRoundRectProps"; }
+
+private:
+ float* mLeft;
+ float* mTop;
+ float* mRight;
+ float* mBottom;
+ float* mRx;
+ float* mRy;
+};
+
class DrawCircleOp : public DrawStrokableOp {
public:
DrawCircleOp(float x, float y, float radius, const SkPaint* paint)
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 7ee83e609d10..1f7092147686 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -275,6 +275,23 @@ status_t DisplayListRenderer::drawRoundRect(float left, float top, float right,
return DrawGlInfo::kStatusDone;
}
+status_t DisplayListRenderer::drawRoundRect(
+ CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top,
+ CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
+ CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
+ CanvasPropertyPaint* paint) {
+ mDisplayListData->refProperty(left);
+ mDisplayListData->refProperty(top);
+ mDisplayListData->refProperty(right);
+ mDisplayListData->refProperty(bottom);
+ mDisplayListData->refProperty(rx);
+ mDisplayListData->refProperty(ry);
+ mDisplayListData->refProperty(paint);
+ addDrawOp(new (alloc()) DrawRoundRectPropsOp(&left->value, &top->value,
+ &right->value, &bottom->value, &rx->value, &ry->value, &paint->value));
+ return DrawGlInfo::kStatusDone;
+}
+
status_t DisplayListRenderer::drawCircle(float x, float y, float radius, const SkPaint* paint) {
paint = refPaint(paint);
addDrawOp(new (alloc()) DrawCircleOp(x, y, radius, paint));
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index e9c937cbeb0c..3a3fc3af9f0f 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -123,6 +123,10 @@ public:
virtual status_t drawRects(const float* rects, int count, const SkPaint* paint);
virtual status_t drawRoundRect(float left, float top, float right, float bottom,
float rx, float ry, const SkPaint* paint);
+ virtual status_t drawRoundRect(CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top,
+ CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
+ CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
+ CanvasPropertyPaint* paint);
virtual status_t drawCircle(float x, float y, float radius, const SkPaint* paint);
virtual status_t drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint);