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..ee3f9c1172c398cc5293a40e23747b6348a98b57 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,14 @@ class PerfContextProvider : public ContextProvider { |
gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } |
gpu::ContextSupport* ContextSupport() override { return &support_; } |
class GrContext* GrContext() override { |
tfarina
2014/12/20 00:59:25
class GrContext? I bet you don't need 'class' here
|
- return NULL; |
+ if (gr_context_) |
+ return gr_context_.get(); |
+ |
+ auto null_interface = skia::AdoptRef(GrGLCreateNullInterface()); |
tfarina
2014/12/20 00:59:25
s/auto/skia::RefPtr<GrContext> ?
vmpstr
2014/12/20 01:17:18
FWIW, It's as common knowledge that skia::AdoptRef
danakj
2014/12/20 06:45:00
I think "don't use auto for smart pointers" is a s
|
+ 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 +100,7 @@ class PerfContextProvider : public ContextProvider { |
~PerfContextProvider() override {} |
scoped_ptr<PerfGLES2Interface> context_gl_; |
+ skia::RefPtr<class GrContext> gr_context_; |
tfarina
2014/12/20 00:59:25
you don't need 'class' here, right?
|
TestContextSupport support_; |
}; |