aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gm.h
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-16 20:42:15 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-16 20:42:15 +0000
commit62b50b7bb8395f9bc281a4d0ed20acc4813f1445 (patch)
tree5af9e93540690a23e482c36632bbf4effaec5da7 /gm/gm.h
parent1cf02a8adffd096dff0eecabc1d3ee66ec18f911 (diff)
Have GMs read the GrContext via a setter/getter rather than a global.
GetGr's current global state makes things rather tricky to run GPU GMs in parallel (DM). This API change will let me feed the right GrContext to the right GM in DM. I'm not planning on changing the status quo in GM-the-tool: the new getters and setters still just return the same global. BUG=skia:1590 R=bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/23567032 git-svn-id: http://skia.googlecode.com/svn/trunk@11306 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/gm.h')
-rw-r--r--gm/gm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gm/gm.h b/gm/gm.h
index 6cd97b5a2b..2886f8c243 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,10 @@ namespace skiagm {
fCanvasIsDeferred = isDeferred;
}
+#if SK_SUPPORT_GPU
+ static GrContext* GetGr(/*very nearly const*/ SkCanvas*);
+#endif
+
protected:
static SkString gResourcePath;