aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/graphics/SkStroke.h
diff options
context:
space:
mode:
authorGravatar croachrose <croachrose@2bbb7eff-a529-9590-31e7-b0007b416f81>2006-09-20 15:47:42 +0000
committerGravatar croachrose <croachrose@2bbb7eff-a529-9590-31e7-b0007b416f81>2006-09-20 15:47:42 +0000
commit0f87cd842dd46205d5252c35da6d2c869f3d2e98 (patch)
tree64ce18bd4c467883c56b72e32e92177ce6718941 /include/graphics/SkStroke.h
parent586101c79b0490b50623e76c71a5fd67d8d92b08 (diff)
Initial checkin of skia source in google codebase.
* reviewed by me! git-svn-id: http://skia.googlecode.com/svn/trunk@2 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/graphics/SkStroke.h')
-rw-r--r--include/graphics/SkStroke.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/graphics/SkStroke.h b/include/graphics/SkStroke.h
new file mode 100644
index 0000000000..8b148a4efc
--- /dev/null
+++ b/include/graphics/SkStroke.h
@@ -0,0 +1,58 @@
+#ifndef SkStroke_DEFINED
+#define SkStroke_DEFINED
+
+#include "SkPoint.h"
+#include "SkPaint.h"
+
+struct SkRect;
+class SkPath;
+
+#define SK_DefaultStrokeWidth SK_Scalar1
+#define SK_DefaultMiterLimit SkIntToScalar(4)
+
+
+/** \class SkStroke
+ SkStroke is the utility class that constructs paths by stroking
+ geometries (lines, rects, ovals, roundrects, paths). This is
+ invoked when a geometry or text is drawn in a canvas with the
+ kStroke_Mask bit set in the paint.
+*/
+class SkStroke {
+public:
+ SkStroke();
+ SkStroke(const SkPaint&);
+ SkStroke(const SkPaint&, SkScalar width); // width overrides paint.getStrokeWidth()
+
+ SkPaint::Cap getCap() const { return (SkPaint::Cap)fCap; }
+ void setCap(SkPaint::Cap);
+
+ SkPaint::Join getJoin() const { return (SkPaint::Join)fJoin; }
+ void setJoin(SkPaint::Join);
+
+// SkScalar getMiterLimit() const { return fMiterLimit; }
+ void setMiterLimit(SkScalar);
+
+// SkScalar getWidth() const { return fWidth; }
+ void setWidth(SkScalar);
+
+ bool getDoFill() const { return SkToBool(fDoFill); }
+ void setDoFill(bool doFill) { fDoFill = SkToU8(doFill); }
+
+ void strokeLine(const SkPoint& start, const SkPoint& end, SkPath*) const;
+ void strokeRect(const SkRect& rect, SkPath*) const;
+ void strokeOval(const SkRect& oval, SkPath*) const;
+ void strokeRRect(const SkRect& rect, SkScalar rx, SkScalar ry, SkPath*) const;
+ void strokePath(const SkPath& path, SkPath*) const;
+
+ ////////////////////////////////////////////////////////////////
+
+private:
+ SkScalar fWidth, fMiterLimit;
+ U8 fCap, fJoin;
+ SkBool8 fDoFill;
+
+ friend class SkPaint;
+};
+
+#endif
+