diff options
author | 2009-05-27 01:20:10 +0000 | |
---|---|---|
committer | 2009-05-27 01:20:10 +0000 | |
commit | aa5a7db64a7cb5d1d2b03dadb85e7052dd61879a (patch) | |
tree | 6dbfa87614238f36f91969ba07858d9082ff3704 /include/effects/SkRectShape.h | |
parent | c3a8c5fb385dca5c57f8002e5331360f21c1a61f (diff) |
move shapes subclasses into effects
git-svn-id: http://skia.googlecode.com/svn/trunk@188 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkRectShape.h')
-rw-r--r-- | include/effects/SkRectShape.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/effects/SkRectShape.h b/include/effects/SkRectShape.h new file mode 100644 index 0000000000..dfc07e95c7 --- /dev/null +++ b/include/effects/SkRectShape.h @@ -0,0 +1,55 @@ +#ifndef SkRectShape_DEFINED +#define SkRectShape_DEFINED + +#include "SkShape.h" +#include "SkPaint.h" +#include "SkSize.h" + +class SkPaintShape : public SkShape { +public: + SkPaintShape(); + + SkPaint& paint() { return fPaint; } + const SkPaint& paint() const { return fPaint; } + + // overrides + virtual void flatten(SkFlattenableWriteBuffer&); + +protected: + SkPaintShape(SkFlattenableReadBuffer& buffer); + +private: + SkPaint fPaint; + + typedef SkShape INHERITED; +}; + +class SkRectShape : public SkPaintShape { +public: + SkRectShape(); + + void setRect(const SkRect&); + void setOval(const SkRect&); + void setCircle(SkScalar x, SkScalar y, SkScalar radius); + void setRRect(const SkRect&, SkScalar rx, SkScalar ry); + + // overrides + virtual Factory getFactory(); + virtual void flatten(SkFlattenableWriteBuffer&); + +protected: + SkRectShape(SkFlattenableReadBuffer&); + + // overrides + virtual void onDraw(SkCanvas*); + +private: + SkRect fBounds; + SkSize fRadii; + + static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); + + typedef SkPaintShape INHERITED; +}; + +#endif |