Index: cc/test/test_context_provider.cc |
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc |
index 626b587b3145261faa06cd9f653c7edd449e7dcb..bfa7433fcd6a7338a28f4deebf71ca5d2e2d2fae 100644 |
--- a/cc/test/test_context_provider.cc |
+++ b/cc/test/test_context_provider.cc |
@@ -12,6 +12,8 @@ |
#include "base/logging.h" |
#include "cc/test/test_gles2_interface.h" |
#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" |
namespace cc { |
@@ -115,8 +117,12 @@ class GrContext* TestContextProvider::GrContext() { |
DCHECK(bound_); |
DCHECK(context_thread_checker_.CalledOnValidThread()); |
- // TODO(danakj): Make a test GrContext that works with a test Context3d. |
- return NULL; |
+ if (!gr_context_) { |
+ gr_context_ = skia::AdoptRef(GrContext::Create( |
+ kOpenGL_GrBackend, |
+ reinterpret_cast<GrBackendContext>(GrGLCreateNullInterface()))); |
+ } |
+ return gr_context_.get(); |
} |
void TestContextProvider::MakeGrContextCurrent() {} |