Chromium Code Reviews| 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..3645cd045439be49934d898074c406ed0863080c 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/gl2ext.h" |
| #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" |
| #include "ui/gfx/android/java_bitmap.h" |
| +#include "ui/gl/context_provider.h" |
| #include "webkit/glue/webthread_impl.h" |
| #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| @@ -326,6 +327,31 @@ void CompositorImpl::scheduleComposite() { |
| client_->ScheduleComposite(); |
| } |
| +class NullContextProvider : public ui::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<ui::ContextProvider> |
| +CompositorImpl::OffscreenContextProviderForMainThread() { |
| + if (!null_offscreen_context_provider_) |
| + null_offscreen_context_provider_ = new NullContextProvider(); |
| + return null_offscreen_context_provider_; |
| +} |
| + |
| +scoped_refptr<ui::ContextProvider> |
| +CompositorImpl::OffscreenContextProviderForCompositorThread() { |
| + if (!null_offscreen_context_provider_) |
| + null_offscreen_context_provider_ = new NullContextProvider(); |
| + return null_offscreen_context_provider_; |
|
piman
2013/02/21 22:49:48
I assume that Android UI doesn't use filters right
danakj
2013/02/22 01:56:31
Right. And don't intend to use filters that will r
piman
2013/02/22 02:54:07
Worth a comment? "If you're trying to use filters
danakj
2013/02/22 03:04:49
ya, sure! the world won't blow cuz we nullcheck th
|
| +} |
| + |
| void CompositorImpl::OnViewContextSwapBuffersPosted() { |
| TRACE_EVENT0("compositor", "CompositorImpl::OnViewContextSwapBuffersPosted"); |
| } |