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

Unified Diff: ui/compositor/compositor.cc

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put OffscreenContext class in content/common/gpu/client for renderer Created 7 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: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 9e7c4d54496ee96db23b3253c0519a9e2c6d90a8..b55c43ab6f867238a93ca06226581aa27b383983 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -163,6 +163,26 @@ WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateOffscreenContext() {
return CreateContextCommon(NULL, true);
}
+WebKit::WebGraphicsContext3D* DefaultContextFactory::
+ OffscreenContextForMainThread() {
+ return NULL;
+}
+
+WebKit::WebGraphicsContext3D* DefaultContextFactory::
+ OffscreenContextForCompositorThread() {
+ return NULL;
+}
+
+GrContext* DefaultContextFactory::
+ OffscreenGrContextForMainThread() {
+ return NULL;
+}
+
+GrContext* DefaultContextFactory::
+ OffscreenGrContextForCompositorThread() {
+ return NULL;
+}
+
void DefaultContextFactory::RemoveCompositor(Compositor* compositor) {
}
@@ -521,6 +541,40 @@ scoped_ptr<cc::OutputSurface> Compositor::createOutputSurface() {
void Compositor::didRecreateOutputSurface(bool success) {
}
+WebKit::WebGraphicsContext3D*
+ Compositor::offscreenContext3dForMainThread() {
+ // TODO(danakj): Create an OffscreenContext out of a TestWebGraphicsContext3D
+ // and store it somewhere so we can get the GrContext out of it too.
+ if (g_test_compositor_enabled)
+ return NULL;
+ return ContextFactory::GetInstance()->
+ OffscreenContextForMainThread();
+}
+
+WebKit::WebGraphicsContext3D*
+ Compositor::offscreenContext3dForCompositorThread() {
+ // TODO(danakj): Create an OffscreenContext out of a TestWebGraphicsContext3D
+ // and store it somewhere so we can get the GrContext out of it too.
+ if (g_test_compositor_enabled)
+ return NULL;
+ return ContextFactory::GetInstance()->
+ OffscreenContextForCompositorThread();
+}
+
+GrContext* Compositor::offscreenGrContextForMainThread() {
+ if (g_test_compositor_enabled)
+ return NULL;
+ return ContextFactory::GetInstance()->
+ OffscreenGrContextForMainThread();
+}
+
+GrContext* Compositor::offscreenGrContextForCompositorThread() {
+ if (g_test_compositor_enabled)
+ return NULL;
+ return ContextFactory::GetInstance()->
+ OffscreenGrContextForCompositorThread();
+}
+
scoped_ptr<cc::InputHandler> Compositor::createInputHandler() {
return scoped_ptr<cc::InputHandler>();
}

Powered by Google App Engine
This is Rietveld 408576698