| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "cc/input/input_handler.h" | 9 #include "cc/input/input_handler.h" |
| 10 #include "cc/input/layer_scroll_offset_delegate.h" | 10 #include "cc/input/layer_scroll_offset_delegate.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 SetInputHandler(NULL); | 76 SetInputHandler(NULL); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void SynchronousCompositorImpl::SetClient( | 79 void SynchronousCompositorImpl::SetClient( |
| 80 SynchronousCompositorClient* compositor_client) { | 80 SynchronousCompositorClient* compositor_client) { |
| 81 DCHECK(CalledOnValidThread()); | 81 DCHECK(CalledOnValidThread()); |
| 82 compositor_client_ = compositor_client; | 82 compositor_client_ = compositor_client; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool SynchronousCompositorImpl::InitializeHwDraw( | 85 bool SynchronousCompositorImpl::InitializeHwDraw( |
| 86 scoped_refptr<gfx::GLSurface> surface) { | 86 scoped_refptr<gfx::GLSurface> surface, |
| 87 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { |
| 87 DCHECK(CalledOnValidThread()); | 88 DCHECK(CalledOnValidThread()); |
| 88 DCHECK(output_surface_); | 89 DCHECK(output_surface_); |
| 89 bool success = output_surface_->InitializeHwDraw( | 90 bool success = output_surface_->InitializeHwDraw( |
| 90 surface, | 91 surface, |
| 91 g_factory.Get().GetOffscreenContextProviderForCompositorThread()); | 92 service, |
| 93 g_factory.Get().GetOffscreenContextProviderForCompositorThread(), |
| 94 g_factory.Get().GetCompositorShareGroup()); |
| 92 if (success) | 95 if (success) |
| 93 g_factory.Get().CompositorInitializedHardwareDraw(); | 96 g_factory.Get().CompositorInitializedHardwareDraw(); |
| 94 return success; | 97 return success; |
| 95 } | 98 } |
| 96 | 99 |
| 97 void SynchronousCompositorImpl::ReleaseHwDraw() { | 100 void SynchronousCompositorImpl::ReleaseHwDraw() { |
| 98 DCHECK(CalledOnValidThread()); | 101 DCHECK(CalledOnValidThread()); |
| 99 DCHECK(output_surface_); | 102 DCHECK(output_surface_); |
| 100 output_surface_->ReleaseHwDraw(); | 103 output_surface_->ReleaseHwDraw(); |
| 101 g_factory.Get().CompositorReleasedHardwareDraw(); | 104 g_factory.Get().CompositorReleasedHardwareDraw(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 g_factory.Get(); // Ensure it's initialized. | 271 g_factory.Get(); // Ensure it's initialized. |
| 269 SynchronousCompositorImpl::CreateForWebContents(contents); | 272 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 270 } | 273 } |
| 271 if (SynchronousCompositorImpl* instance = | 274 if (SynchronousCompositorImpl* instance = |
| 272 SynchronousCompositorImpl::FromWebContents(contents)) { | 275 SynchronousCompositorImpl::FromWebContents(contents)) { |
| 273 instance->SetClient(client); | 276 instance->SetClient(client); |
| 274 } | 277 } |
| 275 } | 278 } |
| 276 | 279 |
| 277 } // namespace content | 280 } // namespace content |
| OLD | NEW |