Index: cc/test/test_in_process_context_provider.cc |
diff --git a/cc/test/test_in_process_context_provider.cc b/cc/test/test_in_process_context_provider.cc |
index 579a2e87199fd8b5428134083955a6c24c1af90c..eff0b2c008a37ea1224ccd47b42a8386800aefd2 100644 |
--- a/cc/test/test_in_process_context_provider.cc |
+++ b/cc/test/test_in_process_context_provider.cc |
@@ -85,8 +85,6 @@ static void BindGrContextCallback(const GrGLInterface* interface) { |
TestInProcessContextProvider* context_provider = |
reinterpret_cast<TestInProcessContextProvider*>(interface->fCallbackData); |
- // Make sure the gles2 library is initialized first on exactly one thread. |
- g_gles2_initializer.Get(); |
gles2::SetGLContext(context_provider->ContextGL()); |
} |
@@ -94,6 +92,11 @@ class GrContext* TestInProcessContextProvider::GrContext() { |
if (gr_context_) |
return gr_context_.get(); |
+ // The GrGLInterface factory will make GL calls using the C GLES2 interface. |
+ // Make sure the gles2 library is initialized first on exactly one thread. |
+ g_gles2_initializer.Get(); |
+ gles2::SetGLContext(ContextGL()); |
+ |
skia::RefPtr<GrGLInterface> interface = |
skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding()); |
interface->fCallback = BindGrContextCallback; |