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

Unified Diff: webkit/compositor_bindings/web_layer_tree_view_impl.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: webkit/compositor_bindings/web_layer_tree_view_impl.cc
diff --git a/webkit/compositor_bindings/web_layer_tree_view_impl.cc b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
index 99bbb200712c5a51ce67560d5435d39fbf51382c..37d7fc2c9331dc46e107938068120f9b0b4d95cd 100644
--- a/webkit/compositor_bindings/web_layer_tree_view_impl.cc
+++ b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
@@ -18,6 +18,7 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewClient.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
#include "web_layer_impl.h"
#include "web_to_ccinput_handler_adapter.h"
@@ -282,6 +283,28 @@ void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success)
m_client->didRecreateOutputSurface(success);
}
+WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::offscreenContext3dForMainThread()
+{
+ return WebSharedGraphicsContext3D::mainThreadContext();
+}
+
+WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::offscreenContext3dForCompositorThread()
+{
+ if (!WebSharedGraphicsContext3D::haveCompositorThreadContext() && !WebSharedGraphicsContext3D::createCompositorThreadContext())
+ return NULL;
+ return WebSharedGraphicsContext3D::compositorThreadContext();
+}
+
+GrContext* WebLayerTreeViewImpl::offscreenGrContextForMainThread()
+{
+ return WebSharedGraphicsContext3D::mainThreadGrContext();
+}
+
+GrContext* WebLayerTreeViewImpl::offscreenGrContextForCompositorThread()
+{
+ return WebSharedGraphicsContext3D::compositorThreadGrContext();
+}
+
scoped_ptr<InputHandler> WebLayerTreeViewImpl::createInputHandler()
{
scoped_ptr<InputHandler> ret;

Powered by Google App Engine
This is Rietveld 408576698