blob: ab92ff6b3e4198f6e708c9b7e42034b5ed669f4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#ifndef skiagm_DEFINED
#define skiagm_DEFINED
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRefCnt.h"
#include "SkSize.h"
#include "SkString.h"
#include "SkTRegistry.h"
namespace skiagm {
static inline SkISize make_isize(int w, int h) {
SkISize sz;
sz.set(w, h);
return sz;
}
class GM {
public:
GM();
virtual ~GM();
void draw(SkCanvas*);
SkISize getISize() { return this->onISize(); }
const char* shortName() {
if (fShortName.size() == 0) {
fShortName = this->onShortName();
}
return fShortName.c_str();
}
protected:
virtual void onDraw(SkCanvas*) = 0;
virtual SkISize onISize() = 0;
virtual SkString onShortName() = 0;
private:
SkString fShortName;
};
typedef SkTRegistry<GM*, void*> GMRegistry;
}
#endif
|