Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: gm/gm.h

Issue 148283017: Make GMs aware of what tool they're being run in. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: w to this->getMode() Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/convexpolyclip.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « gm/convexpolyclip.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698