From 62b50b7bb8395f9bc281a4d0ed20acc4813f1445 Mon Sep 17 00:00:00 2001 From: "mtklein@google.com" Date: Mon, 16 Sep 2013 20:42:15 +0000 Subject: 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 --- gm/gm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gm/gm.h') 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; -- cgit v1.2.3