• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef SkShape_DEFINED
2 #define SkShape_DEFINED
3 
4 #include "SkFlattenable.h"
5 
6 class SkCanvas;
7 class SkMatrix;
8 class SkWStream;
9 
10 class SkShape : public SkFlattenable {
11 public:
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 
34 protected:
35     virtual void onDraw(SkCanvas*);
36 
37     SkShape(SkFlattenableReadBuffer&);
38 
39 private:
40 
41     typedef SkFlattenable INHERITED;
42 };
43 
44 #endif
45