diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkDevice.h | 3 | ||||
-rw-r--r-- | include/core/SkDrawFilter.h | 1 | ||||
-rw-r--r-- | include/gpu/GrContext.h | 11 | ||||
-rw-r--r-- | include/gpu/GrOvalRenderer.h | 12 | ||||
-rw-r--r-- | include/gpu/SkGpuDevice.h | 2 |
5 files changed, 26 insertions, 3 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 40931091c4..3d915d8b55 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -259,6 +259,9 @@ protected: const SkPaint& paint); virtual void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint); + virtual void drawRRect(const SkDraw&, const SkRRect& rr, + const SkPaint& paint); + /** * If pathIsMutable, then the implementation is allowed to cast path to a * non-const pointer and modify it in place (as an optimization). Canvas diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h index 6a50ca7ac6..52cbba9d20 100644 --- a/include/core/SkDrawFilter.h +++ b/include/core/SkDrawFilter.h @@ -31,6 +31,7 @@ public: kLine_Type, kBitmap_Type, kRect_Type, + kRRect_Type, kOval_Type, kPath_Type, kText_Type, diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 4d328d1379..d8a7f91d55 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -410,6 +410,17 @@ public: const SkMatrix* localMatrix = NULL); /** + * Draw a roundrect using a paint. + * + * @param paint describes how to color pixels. + * @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); + + /** * Draws a path. * * @param paint describes how to color pixels. diff --git a/include/gpu/GrOvalRenderer.h b/include/gpu/GrOvalRenderer.h index 7e46dac1f8..68e6070b45 100644 --- a/include/gpu/GrOvalRenderer.h +++ b/include/gpu/GrOvalRenderer.h @@ -20,18 +20,20 @@ class GrPaint; class SkStrokeRec; /* - * This class wraps helper functions that draw ovals (filled & stroked) + * This class wraps helper functions that draw ovals and roundrects (filled & stroked) */ class GrOvalRenderer : public GrRefCnt { public: SK_DECLARE_INST_COUNT(GrOvalRenderer) - GrOvalRenderer() {} - + GrOvalRenderer() : fRRectIndexBuffer(NULL) {} ~GrOvalRenderer() {} bool drawOval(GrDrawTarget* target, const GrContext* context, const GrPaint& paint, const GrRect& oval, const SkStrokeRec& stroke); + bool drawSimpleRRect(GrDrawTarget* target, GrContext* context, const GrPaint& paint, + const SkRRect& rrect, const SkStrokeRec& stroke); + private: bool drawEllipse(GrDrawTarget* target, const GrPaint& paint, const GrRect& ellipse, @@ -40,6 +42,10 @@ private: const GrRect& circle, const SkStrokeRec& stroke); + GrIndexBuffer* rRectIndexBuffer(GrGpu* gpu); + + GrIndexBuffer* fRRectIndexBuffer; + typedef GrRefCnt INHERITED; }; diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index 8aa7d4aac8..ab24703310 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -73,6 +73,8 @@ public: const SkPoint[], const SkPaint& paint) SK_OVERRIDE; virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) SK_OVERRIDE; + virtual void drawRRect(const SkDraw&, const SkRRect& r, + 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, |