Index: cc/resources/tile_task_worker_pool_perftest.cc |
diff --git a/cc/resources/tile_task_worker_pool_perftest.cc b/cc/resources/tile_task_worker_pool_perftest.cc |
index 2c64029c1e8dc0154d28a5634b2df1ec490dd655..e6f4356e3ac48c5939f3de25c8d69f1cf515d7e7 100644 |
--- a/cc/resources/tile_task_worker_pool_perftest.cc |
+++ b/cc/resources/tile_task_worker_pool_perftest.cc |
@@ -27,6 +27,8 @@ |
#include "testing/gtest/include/gtest/gtest.h" |
#include "testing/perf/perf_test.h" |
#include "third_party/khronos/GLES2/gl2.h" |
+#include "third_party/skia/include/gpu/GrContext.h" |
+#include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
namespace cc { |
namespace { |
@@ -77,7 +79,15 @@ class PerfContextProvider : public ContextProvider { |
gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } |
gpu::ContextSupport* ContextSupport() override { return &support_; } |
class GrContext* GrContext() override { |
- return NULL; |
+ 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()))); |
+ return gr_context_.get(); |
} |
bool IsContextLost() override { return false; } |
void VerifyContexts() override {} |
@@ -91,6 +101,7 @@ class PerfContextProvider : public ContextProvider { |
~PerfContextProvider() override {} |
scoped_ptr<PerfGLES2Interface> context_gl_; |
+ skia::RefPtr<class GrContext> gr_context_; |
TestContextSupport support_; |
}; |