diff options
| author | Romain Guy <romainguy@google.com> | 2011-01-19 21:54:02 -0800 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2011-01-19 21:55:10 -0800 |
| commit | 01d58e43ede5ca98cbebdd166f9b0c545032c01b (patch) | |
| tree | 6d9976c551fd6ec9f104e5a849c0ad743946af6c /libs/hwui/DisplayListRenderer.cpp | |
| parent | 9335f5b2fde244614184f45d29cc574d1ba8cbba (diff) | |
| download | frameworks_base-01d58e43ede5ca98cbebdd166f9b0c545032c01b.zip frameworks_base-01d58e43ede5ca98cbebdd166f9b0c545032c01b.tar.gz frameworks_base-01d58e43ede5ca98cbebdd166f9b0c545032c01b.tar.bz2 | |
Add rounded rects and circles support to OpenGLRenderer.
Change-Id: I6cedf2b495d58de7c0437096809fa9e4518a1b8c
Diffstat (limited to 'libs/hwui/DisplayListRenderer.cpp')
| -rw-r--r-- | libs/hwui/DisplayListRenderer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index ade85e5..a74a95f 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -103,6 +103,8 @@ const char* DisplayList::OP_NAMES[] = { "DrawPatch", "DrawColor", "DrawRect", + "DrawRoundRect", + "DrawCircle", "DrawPath", "DrawLines", "DrawText", @@ -332,6 +334,15 @@ void DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) { renderer.drawRect(getFloat(), getFloat(), getFloat(), getFloat(), getPaint()); } break; + case DrawRoundRect: { + renderer.drawRoundRect(getFloat(), getFloat(), getFloat(), getFloat(), + getFloat(), getFloat(), getPaint()); + } + break; + case DrawCircle: { + renderer.drawCircle(getFloat(), getFloat(), getFloat(), getPaint()); + } + break; case DrawPath: { renderer.drawPath(getPath(), getPaint()); } @@ -601,6 +612,21 @@ void DisplayListRenderer::drawRect(float left, float top, float right, float bot addPaint(paint); } +void DisplayListRenderer::drawRoundRect(float left, float top, float right, float bottom, + float rx, float ry, SkPaint* paint) { + addOp(DisplayList::DrawRoundRect); + addBounds(left, top, right, bottom); + addPoint(rx, ry); + addPaint(paint); +} + +void DisplayListRenderer::drawCircle(float x, float y, float radius, SkPaint* paint) { + addOp(DisplayList::DrawCircle); + addPoint(x, y); + addFloat(radius); + addPaint(paint); +} + void DisplayListRenderer::drawPath(SkPath* path, SkPaint* paint) { addOp(DisplayList::DrawPath); addPath(path); |
