Commit 5d9960e7 authored by hendrikw's avatar hendrikw Committed by Commit bot

cc: cc_perftest was crashing due to lack of GrContext

TileTaskWorkerPoolPerfTests/TileTaskWorkerPoolPerfTest.ScheduleTasks/3 Failed
because GrContext was returning nullptr

BUG=

Review URL: https://codereview.chromium.org/807193005

Cr-Commit-Position: refs/heads/master@{#309330}
parent 8b0b42dd
......@@ -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_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment