0ad336f8c6
add flatten/unflatten to matrix git-svn-id: http://skia.googlecode.com/svn/trunk@242 2bbb7eff-a529-9590-31e7-b0007b416f81
45 lines
915 B
C++
45 lines
915 B
C++
#ifndef SkShape_DEFINED
|
|
#define SkShape_DEFINED
|
|
|
|
#include "SkFlattenable.h"
|
|
|
|
class SkCanvas;
|
|
class SkMatrix;
|
|
class SkWStream;
|
|
|
|
class SkShape : public SkFlattenable {
|
|
public:
|
|
SkShape();
|
|
virtual ~SkShape();
|
|
|
|
void draw(SkCanvas*);
|
|
|
|
/** Draw the shape translated by (dx,dy), which is applied before the
|
|
shape's matrix (if any).
|
|
*/
|
|
void drawXY(SkCanvas*, SkScalar dx, SkScalar dy);
|
|
|
|
/** Draw the shape with the specified matrix, applied before the shape's
|
|
matrix (if any).
|
|
*/
|
|
void drawMatrix(SkCanvas*, const SkMatrix&);
|
|
|
|
// overrides
|
|
virtual Factory getFactory();
|
|
virtual void flatten(SkFlattenableWriteBuffer&);
|
|
|
|
// public for Registrar
|
|
static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
|
|
|
|
protected:
|
|
virtual void onDraw(SkCanvas*);
|
|
|
|
SkShape(SkFlattenableReadBuffer&);
|
|
|
|
private:
|
|
|
|
typedef SkFlattenable INHERITED;
|
|
};
|
|
|
|
#endif
|