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

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: Null check before deref offscreenContextProvider 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..3ee6f693c7ae86f3a906900d45e20b3e553a7adb 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "cc/context_provider.h"
#include "cc/input_handler.h"
#include "cc/layer.h"
#include "cc/layer_tree_host.h"
@@ -326,6 +327,38 @@ void CompositorImpl::scheduleComposite() {
client_->ScheduleComposite();
}
+class NullContextProvider : public cc::ContextProvider {
+ 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<cc::ContextProvider>
+CompositorImpl::OffscreenContextProviderForMainThread() {
+ // There is no support for offscreen contexts, or compositor filters that
+ // would require them in this compositor instance. If they are needed,]
piman 2013/02/22 03:16:39 nit: typo ']'
danakj 2013/02/22 03:23:09 *^_^*
+ // then implement a context provider that provides contexts from
+ // ImageTransportSurfaceAndroid.
+ if (!null_offscreen_context_provider_)
+ null_offscreen_context_provider_ = new NullContextProvider();
+ return null_offscreen_context_provider_;
+}
+
+scoped_refptr<cc::ContextProvider>
+CompositorImpl::OffscreenContextProviderForCompositorThread() {
+ // There is no support for offscreen contexts, or compositor filters that
+ // would require them in this compositor instance. If they are needed,]
piman 2013/02/22 03:16:39 nit: typo ']'
+ // then implement a context provider that provides contexts from
+ // ImageTransportSurfaceAndroid.
+ if (!null_offscreen_context_provider_)
+ null_offscreen_context_provider_ = new NullContextProvider();
+ return null_offscreen_context_provider_;
+}
+
void CompositorImpl::OnViewContextSwapBuffersPosted() {
TRACE_EVENT0("compositor", "CompositorImpl::OnViewContextSwapBuffersPosted");
}
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | content/browser/renderer_host/image_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698