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

Unified Diff: cc/test/test_context_provider.cc

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update raster skewport setting. Rebase and update test context provider to match latest Skia. 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
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..2f3a6381afeb0ca3e56cdc379a1e7c8bb8a48a01 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -14,6 +14,7 @@
#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 +70,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,11 +100,11 @@ class GrContext* TestContextProvider::GrContext() {
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())));
+ gl_context_ = skia::AdoptRef(SkNullGLContext::Create(kNone_GrGLStandard));
+ gl_context_->makeCurrent();
+ gr_context_ = skia::AdoptRef(
+ GrContext::Create(kOpenGL_GrBackend,
+ reinterpret_cast<GrBackendContext>(gl_context_->gl())));
return gr_context_.get();
}

Powered by Google App Engine
This is Rietveld 408576698