Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: cc/resources/tile_task_worker_pool_perftest.cc

Issue 807193005: cc: cc_perftest was crashing due to lack of GrContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698