00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SkStroke_DEFINED
00018 #define SkStroke_DEFINED
00019
00020 #include "SkPoint.h"
00021 #include "SkPaint.h"
00022
00023 struct SkRect;
00024 class SkPath;
00025
00026 #define SK_DefaultStrokeWidth SK_Scalar1
00027 #define SK_DefaultMiterLimit SkIntToScalar(4)
00028
00029
00036 class SkStroke {
00037 public:
00038 SkStroke();
00039 SkStroke(const SkPaint&);
00040 SkStroke(const SkPaint&, SkScalar width);
00041
00042 SkPaint::Cap getCap() const { return (SkPaint::Cap)fCap; }
00043 void setCap(SkPaint::Cap);
00044
00045 SkPaint::Join getJoin() const { return (SkPaint::Join)fJoin; }
00046 void setJoin(SkPaint::Join);
00047
00048 void setMiterLimit(SkScalar);
00049 void setWidth(SkScalar);
00050
00051 bool getDoFill() const { return SkToBool(fDoFill); }
00052 void setDoFill(bool doFill) { fDoFill = SkToU8(doFill); }
00053
00054 void strokeLine(const SkPoint& start, const SkPoint& end, SkPath*) const;
00055 void strokeRect(const SkRect& rect, SkPath*) const;
00056 void strokeOval(const SkRect& oval, SkPath*) const;
00057 void strokeRRect(const SkRect& rect, SkScalar rx, SkScalar ry, SkPath*) const;
00058 void strokePath(const SkPath& path, SkPath*) const;
00059
00061
00062 private:
00063 SkScalar fWidth, fMiterLimit;
00064 uint8_t fCap, fJoin;
00065 SkBool8 fDoFill;
00066
00067 friend class SkPaint;
00068 };
00069
00070 #endif
00071