summaryrefslogtreecommitdiffstats
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
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}
-rw-r--r--cc/test/test_context_provider.cc9
-rw-r--r--third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp7
2 files changed, 8 insertions, 8 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)
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
index 2c21e79..ea48003 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
@@ -47,8 +47,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.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/GrGLTypes.h"
-#include "third_party/skia/include/gpu/gl/SkNullGLContext.h"
#include "wtf/RefPtr.h"
using testing::AnyNumber;
@@ -75,9 +75,8 @@ public:
: m_context3d(context3d)
, m_gl(gl)
{
- scoped_ptr<SkGLContext> glContext(SkNullGLContext::Create());
- glContext->makeCurrent();
- m_grContext = adoptRef(GrContext::Create(kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(glContext->gl())));
+ RefPtr<const GrGLInterface> glInterface = adoptRef(GrGLCreateNullInterface());
+ m_grContext = adoptRef(GrContext::Create(kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(glInterface.get())));
}
WebGraphicsContext3D* context3d() override