Chromium Code Reviews| Index: android_webview/browser/deferred_gpu_command_service.cc |
| diff --git a/android_webview/browser/deferred_gpu_command_service.cc b/android_webview/browser/deferred_gpu_command_service.cc |
| index 0bcb3afdcc3147d7d43f263160a4c435947b854d..c9fd4a86f7b3b064d9e70cd76874f7bb947309e0 100644 |
| --- a/android_webview/browser/deferred_gpu_command_service.cc |
| +++ b/android_webview/browser/deferred_gpu_command_service.cc |
| @@ -6,6 +6,7 @@ |
| #include "android_webview/browser/gl_view_renderer_manager.h" |
| #include "android_webview/browser/shared_renderer_state.h" |
| +#include "base/bind.h" |
| #include "base/lazy_instance.h" |
| #include "base/synchronization/lock.h" |
| #include "base/trace_event/trace_event.h" |
| @@ -15,8 +16,18 @@ |
| namespace android_webview { |
| namespace { |
| + |
| base::LazyInstance<scoped_refptr<DeferredGpuCommandService> > |
| g_service = LAZY_INSTANCE_INITIALIZER; |
| + |
| +content::SynchronousCompositor::ContextHolder GetContextHolder( |
| + bool need_share_group_with_parent, |
| + const blink::WebGraphicsContext3D::Attributes& attributes, |
| + bool is_offscreen) { |
| + content::SynchronousCompositor::ContextHolder holder; |
| + return holder; |
|
tfarina
2015/02/21 16:39:08
What I should put here?
boliu
2015/02/23 21:33:07
The this callback is replacing the CreateOffscreen
tfarina
2015/02/24 17:02:34
Done.
|
| +} |
| + |
| } // namespace |
| base::LazyInstance<base::ThreadLocalBoolean> ScopedAllowGL::allow_gl; |
| @@ -50,7 +61,8 @@ ScopedAllowGL::~ScopedAllowGL() { |
| void DeferredGpuCommandService::SetInstance() { |
| if (!g_service.Get().get()) { |
| g_service.Get() = new DeferredGpuCommandService; |
| - content::SynchronousCompositor::SetGpuService(g_service.Get()); |
| + content::SynchronousCompositor::SetCreateContextCallback( |
| + base::Bind(&GetContextHolder)); |
| } |
| } |