aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-05 14:08:25 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-04-05 14:08:25 +0000
commit62ab7addb06bbc5b93460eaf2f70a9f8399308d3 (patch)
tree09f8bdb41248f55ca441adb88b20258e73ec1075 /include
parent569e0435af62bdb88a662fa0592f75673a17afd9 (diff)
export SkDraw::ComputeRectType() and share that with SkGpuDevice
git-svn-id: http://skia.googlecode.com/svn/trunk@1055 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDraw.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index 76a9093a54..b751be0d22 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -85,6 +85,24 @@ public:
SkMaskFilter* filter, const SkMatrix* filterMatrix,
SkMask* mask, SkMask::CreateMode mode);
+ enum RectType {
+ kHair_RectType,
+ kFill_RectType,
+ kStroke_RectType,
+ kPath_RectType
+ };
+
+ /**
+ * Based on the paint's style, strokeWidth, and the matrix, classify how
+ * to draw the rect. If no special-case is available, returns
+ * kPath_RectType.
+ *
+ * Iff RectType == kStroke_RectType, then strokeSize is set to the device
+ * width and height of the stroke.
+ */
+ static RectType ComputeRectType(const SkPaint&, const SkMatrix&,
+ SkPoint* strokeSize);
+
private:
void drawText_asPaths(const char text[], size_t byteLength,
SkScalar x, SkScalar y, const SkPaint&) const;