summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmiura <vmiura@chromium.org>2015-02-12 15:12:08 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-12 23:12:54 +0000
commit0482d0a69bef58b3da6db1acd2c7dd6785816042 (patch)
tree3baf255851f6bc34a4e989387020e58fc8a141df
parentd5563ca044b42b5de51bb317ac1ee61e95cfbaa6 (diff)
downloadchromium_src-0482d0a69bef58b3da6db1acd2c7dd6785816042.zip
chromium_src-0482d0a69bef58b3da6db1acd2c7dd6785816042.tar.gz
chromium_src-0482d0a69bef58b3da6db1acd2c7dd6785816042.tar.bz2
cc: Update TestContextProvider to use SkNullGLContext.
Currently TCP uses GrGLCreateNullInterface() to create a null interface. This has limitations as multiple NullInterfaces on a single thread share the same state, and the state can't be re-bound to different threads. Updating to use SkNullGLContext which addresses the threading issues and behaves like GrContextForWebGraphicsContext3D() in terms of binding. This is required for test support for threaded GPU rasterization. BUG=454500 Review URL: https://codereview.chromium.org/924603002 Cr-Commit-Position: refs/heads/master@{#316075}
-rw-r--r--cc/test/test_context_provider.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 4c24fe1..61d33a6 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -13,7 +13,7 @@
#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"
+#include "third_party/skia/include/gpu/gl/SkNullGLContext.h"
namespace cc {
@@ -95,11 +95,11 @@ class GrContext* TestContextProvider::GrContext() {
if (gr_context_)
return gr_context_.get();
- skia::RefPtr<const GrGLInterface> null_interface =
- skia::AdoptRef(GrGLCreateNullInterface());
+ skia::RefPtr<class SkGLContext> gl_context =
+ skia::AdoptRef(SkNullGLContext::Create(kNone_GrGLStandard));
+ gl_context->makeCurrent();
gr_context_ = skia::AdoptRef(GrContext::Create(
- kOpenGL_GrBackend,
- reinterpret_cast<GrBackendContext>(null_interface.get())));
+ kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(gl_context->gl())));
return gr_context_.get();
}