1#ifndef SkShape_DEFINED 2#define SkShape_DEFINED 3 4#include "SkFlattenable.h" 5 6class SkCanvas; 7class SkMatrix; 8class SkWStream; 9 10class SkShape : public SkFlattenable { 11public: 12 SkShape(); 13 virtual ~SkShape(); 14 15 void draw(SkCanvas*); 16 17 /** Draw the shape translated by (dx,dy), which is applied before the 18 shape's matrix (if any). 19 */ 20 void drawXY(SkCanvas*, SkScalar dx, SkScalar dy); 21 22 /** Draw the shape with the specified matrix, applied before the shape's 23 matrix (if any). 24 */ 25 void drawMatrix(SkCanvas*, const SkMatrix&); 26 27 // overrides 28 virtual Factory getFactory(); 29 virtual void flatten(SkFlattenableWriteBuffer&); 30 31 // public for Registrar 32 static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); 33 34protected: 35 virtual void onDraw(SkCanvas*); 36 37 SkShape(SkFlattenableReadBuffer&); 38 39private: 40 41 typedef SkFlattenable INHERITED; 42}; 43 44#endif 45