almost there on gm (need to fix image writes/reads/compares)
move SkAutoGraphics into SkGraphics.h
add [] operators to SkString
git-svn-id: http://skia.googlecode.com/svn/trunk@228 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gm.h b/gm/gm.h
index 23d98e1..ab92ff6 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -10,7 +10,7 @@
namespace skiagm {
- static SkISize make_isize(int w, int h) {
+ static inline SkISize make_isize(int w, int h) {
SkISize sz;
sz.set(w, h);
return sz;
@@ -23,10 +23,20 @@
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*) {}
- virtual SkISize onISize() { return make_isize(0, 0); }
+ virtual void onDraw(SkCanvas*) = 0;
+ virtual SkISize onISize() = 0;
+ virtual SkString onShortName() = 0;
+
+ private:
+ SkString fShortName;
};
typedef SkTRegistry<GM*, void*> GMRegistry;