blob: 23d98e16fb4ae7c5eeab74f444266a321cd90ee3 [file] [log] [blame]
reed@android.com00dae862009-06-10 15:38:48 +00001#ifndef skiagm_DEFINED
2#define skiagm_DEFINED
3
reed@android.comdd0ac282009-06-20 02:38:16 +00004#include "SkCanvas.h"
5#include "SkPaint.h"
reed@android.com00dae862009-06-10 15:38:48 +00006#include "SkRefCnt.h"
reed@android.comdd0ac282009-06-20 02:38:16 +00007#include "SkSize.h"
reed@android.com00dae862009-06-10 15:38:48 +00008#include "SkString.h"
9#include "SkTRegistry.h"
10
11namespace skiagm {
reed@android.comdd0ac282009-06-20 02:38:16 +000012
13 static SkISize make_isize(int w, int h) {
14 SkISize sz;
15 sz.set(w, h);
16 return sz;
17 }
reed@android.com00dae862009-06-10 15:38:48 +000018
19 class GM {
20 public:
21 GM();
22 virtual ~GM();
23
24 void draw(SkCanvas*);
reed@android.comdd0ac282009-06-20 02:38:16 +000025 SkISize getISize() { return this->onISize(); }
reed@android.com00dae862009-06-10 15:38:48 +000026
27 protected:
28 virtual void onDraw(SkCanvas*) {}
reed@android.comdd0ac282009-06-20 02:38:16 +000029 virtual SkISize onISize() { return make_isize(0, 0); }
reed@android.com00dae862009-06-10 15:38:48 +000030 };
31
32 typedef SkTRegistry<GM*, void*> GMRegistry;
33}
34
35#endif