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

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: cc::ContextProvider 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 7954175feea775ff47621cde2141af9af49b1bd5..75598825173c415af1e5c26a671207e8e4a5a21d 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -29,6 +29,7 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
#include "ui/gfx/android/java_bitmap.h"
#include "webkit/glue/webthread_impl.h"
+#include "webkit/gpu/context_provider.h"
piman 2013/02/22 02:54:07 You probably meant to fix this and some other inst
danakj 2013/02/22 03:04:49 oops missed that, thanks.
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
namespace gfx {
@@ -326,6 +327,31 @@ void CompositorImpl::scheduleComposite() {
client_->ScheduleComposite();
}
+class NullContextProvider : public webkit::gpu::ContextProvider {
+ // TODO(danakj): Get a context through ImageTransportSurfaceAndroid.
+ virtual bool InitializeOnMainThread() { return false; }
+ virtual bool BindToCurrentThread() { return false; }
+ virtual WebKit::WebGraphicsContext3D* Context3d() { return NULL; }
+ virtual class GrContext* GrContext() { return NULL; }
+ virtual void VerifyContexts() {}
+ protected:
+ virtual ~NullContextProvider() {}
+};
+
+scoped_refptr<webkit::gpu::ContextProvider>
+CompositorImpl::OffscreenContextProviderForMainThread() {
+ if (!null_offscreen_context_provider_)
+ null_offscreen_context_provider_ = new NullContextProvider();
+ return null_offscreen_context_provider_;
+}
+
+scoped_refptr<webkit::gpu::ContextProvider>
+CompositorImpl::OffscreenContextProviderForCompositorThread() {
+ if (!null_offscreen_context_provider_)
+ null_offscreen_context_provider_ = new NullContextProvider();
+ return null_offscreen_context_provider_;
+}
+
void CompositorImpl::OnViewContextSwapBuffersPosted() {
TRACE_EVENT0("compositor", "CompositorImpl::OnViewContextSwapBuffersPosted");
}

Powered by Google App Engine
This is Rietveld 408576698