Index: gm/gm.h |
diff --git a/gm/gm.h b/gm/gm.h |
index bb20c9cf59e4cb5f54bd4955e9ac37afb04fc7e3..4da688c7ffe86343aabe67f97a24c97c7729ee52 100644 |
--- a/gm/gm.h |
+++ b/gm/gm.h |
@@ -53,6 +53,15 @@ namespace skiagm { |
kAsBench_Flag = 1 << 10, // Run the GM as a benchmark in the bench tool |
}; |
+ enum Mode { |
+ kGM_Mode, |
+ kSample_Mode, |
+ kBench_Mode, |
+ }; |
+ |
+ void setMode(Mode mode) { fMode = mode; } |
+ Mode getMode() const { return fMode; } |
+ |
void draw(SkCanvas*); |
void drawBackground(SkCanvas*); |
void drawContent(SkCanvas*); |
@@ -101,10 +110,10 @@ namespace skiagm { |
fCanvasIsDeferred = isDeferred; |
} |
- const SkMatrix& getStarterMatrix() { return fStarterMatrix; } |
- void setStarterMatrix(const SkMatrix& matrix) { |
- fStarterMatrix = matrix; |
- } |
+ const SkMatrix& getStarterMatrix() { return fStarterMatrix; } |
+ void setStarterMatrix(const SkMatrix& matrix) { |
+ fStarterMatrix = matrix; |
+ } |
protected: |
static SkString gResourcePath; |
@@ -118,6 +127,7 @@ namespace skiagm { |
virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } |
private: |
+ Mode fMode; |
SkString fShortName; |
SkColor fBGColor; |
bool fCanvasIsDeferred; // work-around problem in srcmode.cpp |