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

Side by Side Diff: gm/gm.h

Issue 346453002: Refactor how we handle resources path in Tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix rebase conflict Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « gm/filterindiabox.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef skiagm_DEFINED 8 #ifndef skiagm_DEFINED
9 #define skiagm_DEFINED 9 #define skiagm_DEFINED
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return matrix; 83 return matrix;
84 } 84 }
85 85
86 SkColor getBGColor() const { return fBGColor; } 86 SkColor getBGColor() const { return fBGColor; }
87 void setBGColor(SkColor); 87 void setBGColor(SkColor);
88 88
89 // helper: fill a rect in the specified color based on the 89 // helper: fill a rect in the specified color based on the
90 // GM's getISize bounds. 90 // GM's getISize bounds.
91 void drawSizeBounds(SkCanvas*, SkColor); 91 void drawSizeBounds(SkCanvas*, SkColor);
92 92
93 static void SetResourcePath(const char*);
94 static SkString GetResourcePath();
95
96 bool isCanvasDeferred() const { return fCanvasIsDeferred; } 93 bool isCanvasDeferred() const { return fCanvasIsDeferred; }
97 void setCanvasIsDeferred(bool isDeferred) { 94 void setCanvasIsDeferred(bool isDeferred) {
98 fCanvasIsDeferred = isDeferred; 95 fCanvasIsDeferred = isDeferred;
99 } 96 }
100 97
101 const SkMatrix& getStarterMatrix() { return fStarterMatrix; } 98 const SkMatrix& getStarterMatrix() { return fStarterMatrix; }
102 void setStarterMatrix(const SkMatrix& matrix) { 99 void setStarterMatrix(const SkMatrix& matrix) {
103 fStarterMatrix = matrix; 100 fStarterMatrix = matrix;
104 } 101 }
105 102
106 protected: 103 protected:
107 static const char* gResourcePath;
108
109 virtual void onOnceBeforeDraw() {} 104 virtual void onOnceBeforeDraw() {}
110 virtual void onDraw(SkCanvas*) = 0; 105 virtual void onDraw(SkCanvas*) = 0;
111 virtual void onDrawBackground(SkCanvas*); 106 virtual void onDrawBackground(SkCanvas*);
112 virtual SkISize onISize() = 0; 107 virtual SkISize onISize() = 0;
113 virtual SkString onShortName() = 0; 108 virtual SkString onShortName() = 0;
114 virtual uint32_t onGetFlags() const { return 0; } 109 virtual uint32_t onGetFlags() const { return 0; }
115 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); } 110 virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); }
116 111
117 private: 112 private:
118 Mode fMode; 113 Mode fMode;
119 SkString fShortName; 114 SkString fShortName;
120 SkColor fBGColor; 115 SkColor fBGColor;
121 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp 116 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
122 bool fHaveCalledOnceBeforeDraw; 117 bool fHaveCalledOnceBeforeDraw;
123 SkMatrix fStarterMatrix; 118 SkMatrix fStarterMatrix;
124 }; 119 };
125 120
126 typedef SkTRegistry<GM*(*)(void*)> GMRegistry; 121 typedef SkTRegistry<GM*(*)(void*)> GMRegistry;
127 } 122 }
128 123
129 #endif 124 #endif
OLDNEW
« no previous file with comments | « gm/filterindiabox.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698