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

Unified Diff: gm/gm.h

Issue 23567032: Have GMs read the GrContext via a setter/getter rather than a global. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: initialize fGr to NULL 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 | « gm/bleed.cpp ('k') | gm/gm.cpp » ('j') | gm/gmmain.cpp » ('J')
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 6cd97b5a2bd75fcd47c0d84bbb6f3c6b86b8f359..5aee00b9747626274f25f3d4bf424e0c99d9cdd4 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -16,6 +16,10 @@
#include "SkString.h"
#include "SkTRegistry.h"
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#endif
+
#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_));
@@ -93,6 +97,11 @@ namespace skiagm {
fCanvasIsDeferred = isDeferred;
}
+#if SK_SUPPORT_GPU
+ void setGr(GrContext* gr) { fGr = gr; }
+ GrContext* getGr() const { return fGr; }
+#endif
+
protected:
static SkString gResourcePath;
@@ -109,6 +118,9 @@ namespace skiagm {
SkColor fBGColor;
bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
bool fHaveCalledOnceBeforeDraw;
+#if SK_SUPPORT_GPU
+ GrContext* fGr; // Unowned.
+#endif
};
typedef SkTRegistry<GM*(*)(void*)> GMRegistry;
« no previous file with comments | « gm/bleed.cpp ('k') | gm/gm.cpp » ('j') | gm/gmmain.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698