Virtualize SkGLContext with subclasses SkNativeGLContext and SkMesaGLContext, allow both in gm
Review URL: http://codereview.appspot.com/5307045/



git-svn-id: http://skia.googlecode.com/svn/trunk@2499 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/Test.cpp b/tests/Test.cpp
index 55d884d..d91eeed 100644
--- a/tests/Test.cpp
+++ b/tests/Test.cpp
@@ -8,7 +8,7 @@
 #include "Test.h"
 
 #include "GrContext.h"
-#include "SkGLContext.h"
+#include "SkNativeGLContext.h"
 #include "SkTLazy.h"
 
 using namespace skiatest;
@@ -79,13 +79,14 @@
 
 GrContext* GpuTest::GetContext() {
     // preserve this order, we want gGrContext destroyed after gEGLContext
-    static SkTLazy<SkGLContext> gGLContext;
+    static SkTLazy<SkNativeGLContext> gGLContext;
     static SkAutoTUnref<GrContext> gGrContext;
 
     if (NULL == gGrContext.get()) {
         gGLContext.init();
         if (gGLContext.get()->init(800, 600)) {
-            gGrContext.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, NULL));
+            GrPlatform3DContext ctx = reinterpret_cast<GrPlatform3DContext>(gGLContext.get()->gl());
+            gGrContext.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, ctx));
         }
     }
     return gGrContext.get();