aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-09 21:26:11 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-09 21:26:11 +0000
commit0a09d7195b8d9945e5c9c76cc4cfe6ef65d6d390 (patch)
treec45daab7ffc6c83198376c64719b9762a7cddcd2 /include
parent149e9a107c356b0151433fb23c2b1c8d0634947c (diff)
Implement drawDRRect for GPU
BUG=skia:2259 R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/220233011 git-svn-id: http://skia.googlecode.com/svn/trunk@14118 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h16
-rw-r--r--include/gpu/SkGpuDevice.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index b625389b67..c88f469ca0 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -457,9 +457,19 @@ public:
* @param rrect the roundrect to draw
* @param stroke the stroke information (width, join, cap)
*/
- void drawRRect(const GrPaint& paint,
- const SkRRect& rrect,
- const SkStrokeRec& stroke);
+ void drawRRect(const GrPaint& paint, const SkRRect& rrect, const SkStrokeRec& stroke);
+
+ /**
+ * Shortcut for drawing an SkPath consisting of nested rrects using a paint.
+ * Does not support stroking. The result is undefined if outer does not contain
+ * inner.
+ *
+ * @param paint describes how to color pixels.
+ * @param outer the outer roundrect
+ * @param inner the inner roundrect
+ */
+ void drawDRRect(const GrPaint& paint, const SkRRect& outer, const SkRRect& inner);
+
/**
* Draws a path.
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index d7d797a102..a8231914e4 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -91,6 +91,8 @@ public:
const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkDraw&, const SkRRect& r,
const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawDRRect(const SkDraw& draw, const SkRRect& outer,
+ const SkRRect& inner, const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkDraw&, const SkRect& oval,
const SkPaint& paint) SK_OVERRIDE;
virtual void drawPath(const SkDraw&, const SkPath& path,