aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-25 15:27:00 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-25 15:27:00 +0000
commitf2bfd54de32ffbcf90ddcd0e249aaebb1559d9c2 (patch)
tree1068c54781522b1908b5c94a3fb7645045eab0a0 /src/gpu/GrContext.cpp
parenteb02957a5ff4e7b639263b2071e5e2522c7bc4fa (diff)
Add GPU support for roundrects
This uses the OvalRenderer to render roundrects as "stretched ovals." It adds an additional shader that handles the straight edges of ellipsoid roundrects better, and uses the circle shader for roundrects where the two radii are the same. Only axis-aligned, simple roundrects are supported. Handles fill, stroke and hairline. R=bsalomon@google.com, robertphillips@google.com, reed@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/13852049 git-svn-id: http://skia.googlecode.com/svn/trunk@8859 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5d0465e65d..0dd0465af9 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -974,6 +974,22 @@ void GrContext::drawVertices(const GrPaint& paint,
///////////////////////////////////////////////////////////////////////////////
+void GrContext::drawRRect(const GrPaint& paint,
+ const SkRRect& rect,
+ const SkStrokeRec& stroke) {
+
+ GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW);
+ GrDrawState::AutoStageDisable atr(fDrawState);
+
+ if (!fOvalRenderer->drawSimpleRRect(target, this, paint, rect, stroke)) {
+ SkPath path;
+ path.addRRect(rect);
+ this->internalDrawPath(target, paint, path, stroke);
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
void GrContext::drawOval(const GrPaint& paint,
const GrRect& oval,
const SkStrokeRec& stroke) {