summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorbsalomon <bsalomon@google.com>2016-03-25 14:59:32 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 22:02:12 +0000
commit8799bb02c20d52878bde3eb9e2e33138919233ac (patch)
tree02a5f2e3883c57ad99c0761999f4e013c703db46 /cc
parenta614eb3fe5fba327416aac6ee990bda0f4a6654f (diff)
downloadchromium_src-8799bb02c20d52878bde3eb9e2e33138919233ac.zip
chromium_src-8799bb02c20d52878bde3eb9e2e33138919233ac.tar.gz
chromium_src-8799bb02c20d52878bde3eb9e2e33138919233ac.tar.bz2
Directly use GrGLInterface in cc tests rather than SkNullGLContext.
This unblocks removal of SkGLContext and its subclasses from the Skia lib. Using the null GrGLInterface here used to be problematic because its implementation stored its state globally, assuming there was only one instance. This is no longer the case. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1829363003 Cr-Commit-Position: refs/heads/master@{#383375}
Diffstat (limited to 'cc')
-rw-r--r--cc/test/test_context_provider.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 734ef79..fd67a99 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -16,7 +16,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/SkNullGLContext.h"
+#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
namespace cc {
@@ -112,10 +112,11 @@ class GrContext* TestContextProvider::GrContext() {
if (gr_context_)
return gr_context_.get();
- scoped_ptr<class SkGLContext> gl_context(SkNullGLContext::Create());
- gl_context->makeCurrent();
+ skia::RefPtr<const GrGLInterface> gl_interface =
+ skia::AdoptRef(GrGLCreateNullInterface());
gr_context_ = skia::AdoptRef(GrContext::Create(
- kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(gl_context->gl())));
+ kOpenGL_GrBackend,
+ reinterpret_cast<GrBackendContext>(gl_interface.get())));
// If GlContext is already lost, also abandon the new GrContext.
if (ContextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR)