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

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: gm test 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..239b219d4589380077ef8af8ee8b0cf71217b7ba 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -11,6 +11,7 @@
#include "SkBitmap.h"
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
+#include "SkCommandLineFlags.h"
#include "SkPaint.h"
#include "SkSize.h"
#include "SkString.h"
@@ -20,6 +21,8 @@
#include "GrContext.h"
#endif
+DECLARE_bool(forcePerspectiveMatrix);
+
#define DEF_GM(code) \
static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \
static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_));
@@ -74,6 +77,13 @@ namespace skiagm {
// Most GMs will return the identity matrix, but some PDFs tests
// require setting the initial transform.
SkMatrix getInitialTransform() const {
reed1 2013/09/23 18:48:40 I think we could generalize this guy a little for
edisonn 2013/09/23 19:38:04 Done.
+ if (FLAGS_forcePerspectiveMatrix) {
+ SkMatrix perspective;
+ perspective.setIdentity();
+ perspective.setPerspY(SkScalarDiv(SK_Scalar1, SkIntToScalar(1000)));
+ perspective.setSkewX(SkScalarDiv(SkIntToScalar(8), SkIntToScalar(25)));
+ return perspective;
+ }
return this->onGetInitialTransform();
}
« 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