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"); |
} |