aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gmmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/gmmain.cpp')
-rw-r--r--gm/gmmain.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 1587a9ac7b..373356e117 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -482,6 +482,13 @@ static const ConfigData gRec[] = {
#endif
};
+namespace skiagm {
+static GrContext* gGrContext;
+GrContext* GetGr() {
+ return gGrContext;
+}
+}
+
int main(int argc, char * const argv[]) {
SkAutoGraphics ag;
@@ -533,10 +540,9 @@ int main(int argc, char * const argv[]) {
maxH = SkMax32(size.height(), maxH);
}
// setup a GL context for drawing offscreen
- GrContext* context = NULL;
SkEGLContext eglContext;
if (eglContext.init(maxW, maxH)) {
- context = GrContext::CreateGLShaderContext();
+ gGrContext = GrContext::CreateGLShaderContext();
}
@@ -558,7 +564,7 @@ int main(int argc, char * const argv[]) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) {
bool testSuccess = test_drawing(gm, gRec[i],
- writePath, readPath, diffPath, context,
+ writePath, readPath, diffPath, gGrContext,
&forwardRenderedBitmap);
overallSuccess &= testSuccess;