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

Unified Diff: cc/test/test_context_provider.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 | « cc/test/test_context_provider.h ('k') | cc/test/test_in_process_context_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 4c24fe1efebaaa4bcdc376212aa606f4345270fb..bf85ea3a7d735f413479a31c0c060ffce841d117 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 {
@@ -69,6 +69,10 @@ bool TestContextProvider::BindToCurrentThread() {
return true;
}
+void TestContextProvider::DetachFromThread() {
+ context_thread_checker_.DetachFromThread();
+}
+
ContextProvider::Capabilities TestContextProvider::ContextCapabilities() {
DCHECK(bound_);
DCHECK(context_thread_checker_.CalledOnValidThread());
@@ -95,14 +99,21 @@ 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();
}
+void TestContextProvider::SetupLock() {
+}
+
+base::Lock* TestContextProvider::GetLock() {
+ return &context_lock_;
+}
+
bool TestContextProvider::IsContextLost() {
DCHECK(bound_);
DCHECK(context_thread_checker_.CalledOnValidThread());
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_in_process_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698