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

Unified Diff: gm/gm.h

Issue 23587029: gm: add a flag to force perspective usage in all gms (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add reset of matrix in GM constructor too Created 7 years, 3 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 | « no previous file | 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 3a651607414372639cea46cc6cb5472a08f4a0a7..bf1a41140d41eead562abedeeba77ee67ca26413 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -74,7 +74,9 @@ namespace skiagm {
// Most GMs will return the identity matrix, but some PDFs tests
// require setting the initial transform.
SkMatrix getInitialTransform() const {
- return this->onGetInitialTransform();
+ SkMatrix matrix = fStarterMatrix;
+ matrix.preConcat(this->onGetInitialTransform());
+ return matrix;
}
SkColor getBGColor() const { return fBGColor; }
@@ -106,6 +108,11 @@ namespace skiagm {
static GrContext* GetGr(/*very nearly const*/ SkCanvas*);
#endif
+ const SkMatrix& getStarterMatrix() { return fStarterMatrix; }
+ void setStarterMatrix(const SkMatrix& matrix) {
+ fStarterMatrix = matrix;
+ }
+
protected:
static SkString gResourcePath;
@@ -123,6 +130,7 @@ namespace skiagm {
bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
bool fHaveCalledOnceBeforeDraw;
bool fIgnoreFailures; // whether to file any failures as failure-ignored
+ SkMatrix fStarterMatrix;
};
typedef SkTRegistry<GM*(*)(void*)> GMRegistry;
« no previous file with comments | « no previous file | gm/gm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698