From 8b2f5267f16c295f12faab810527cd6311997e34 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Sun, 23 Jan 2011 16:15:02 -0800 Subject: Add support for arcs. Change-Id: I96c057ff4eb1b464b03f132da0b85333777bee4f --- libs/hwui/OpenGLRenderer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 99c0600ae3eb..2467d8ef7943 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1396,6 +1396,21 @@ void OpenGLRenderer::drawOval(float left, float top, float right, float bottom, drawShape(left, top, texture, paint); } +void OpenGLRenderer::drawArc(float left, float top, float right, float bottom, + float startAngle, float sweepAngle, bool useCenter, SkPaint* paint) { + if (mSnapshot->isIgnored()) return; + + if (fabs(sweepAngle) >= 360.0f) { + drawOval(left, top, right, bottom, paint); + return; + } + + glActiveTexture(gTextureUnits[0]); + const PathTexture* texture = mCaches.arcShapeCache.getArc(right - left, bottom - top, + startAngle, sweepAngle, useCenter, paint); + drawShape(left, top, texture, paint); +} + void OpenGLRenderer::drawRectAsShape(float left, float top, float right, float bottom, SkPaint* paint) { if (mSnapshot->isIgnored()) return; -- cgit v1.2.3-59-g8ed1b