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

Unified Diff: content/browser/renderer_host/compositor_impl_android.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: Back to a single OffscreenContext class 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: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index f65a8617902acc1d15f3f89dff721588b512632a..67bc9b40c5db8ece3311c6b707b2f631a11d7bc5 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -28,6 +28,7 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h"
#include "ui/gfx/android/java_bitmap.h"
#include "webkit/glue/webthread_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
@@ -340,6 +341,27 @@ scoped_ptr<cc::OutputSurface> CompositorImpl::createOutputSurface() {
}
}
+WebKit::WebGraphicsContext3D* CompositorImpl::
+ OffscreenContext3dForMainThread() {
+ return WebKit::WebSharedGraphicsContext3D::mainThreadContext();
+}
+
+WebKit::WebGraphicsContext3D* CompositorImpl::
+ OffscreenContext3dForCompositorThread() {
+ if (!WebKit::WebSharedGraphicsContext3D::haveCompositorThreadContext() &&
+ !WebKit::WebSharedGraphicsContext3D::createCompositorThreadContext())
+ return NULL;
+ return WebKit::WebSharedGraphicsContext3D::compositorThreadContext();
+}
+
+GrContext* CompositorImpl::OffscreenGrContextForMainThread() {
+ return WebKit::WebSharedGraphicsContext3D::mainThreadGrContext();
+}
+
+GrContext* CompositorImpl::OffscreenGrContextForCompositorThread() {
+ return WebKit::WebSharedGraphicsContext3D::compositorThreadGrContext();
+}
+
scoped_ptr<cc::InputHandler> CompositorImpl::createInputHandler() {
return scoped_ptr<cc::InputHandler>();
}

Powered by Google App Engine
This is Rietveld 408576698