Index: cc/test/test_context_provider.cc |
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc |
index 4c24fe1efebaaa4bcdc376212aa606f4345270fb..2f3a6381afeb0ca3e56cdc379a1e7c8bb8a48a01 100644 |
--- a/cc/test/test_context_provider.cc |
+++ b/cc/test/test_context_provider.cc |
@@ -14,6 +14,7 @@ |
#include "cc/test/test_web_graphics_context_3d.h" |
#include "third_party/skia/include/gpu/GrContext.h" |
#include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
+#include "third_party/skia/include/gpu/gl/SkNullGLContext.h" |
namespace cc { |
@@ -69,6 +70,10 @@ bool TestContextProvider::BindToCurrentThread() { |
return true; |
} |
+void TestContextProvider::DetachFromThread() { |
+ context_thread_checker_.DetachFromThread(); |
+} |
+ |
ContextProvider::Capabilities TestContextProvider::ContextCapabilities() { |
DCHECK(bound_); |
DCHECK(context_thread_checker_.CalledOnValidThread()); |
@@ -95,11 +100,11 @@ class GrContext* TestContextProvider::GrContext() { |
if (gr_context_) |
return gr_context_.get(); |
- skia::RefPtr<const GrGLInterface> null_interface = |
- skia::AdoptRef(GrGLCreateNullInterface()); |
- gr_context_ = skia::AdoptRef(GrContext::Create( |
- kOpenGL_GrBackend, |
- reinterpret_cast<GrBackendContext>(null_interface.get()))); |
+ gl_context_ = skia::AdoptRef(SkNullGLContext::Create(kNone_GrGLStandard)); |
+ gl_context_->makeCurrent(); |
+ gr_context_ = skia::AdoptRef( |
+ GrContext::Create(kOpenGL_GrBackend, |
+ reinterpret_cast<GrBackendContext>(gl_context_->gl()))); |
return gr_context_.get(); |
} |