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, |
| 92 service, |
91 g_factory.Get().GetOffscreenContextProviderForCompositorThread()); | 93 g_factory.Get().GetOffscreenContextProviderForCompositorThread()); |
92 if (success) | 94 if (success) |
93 g_factory.Get().CompositorInitializedHardwareDraw(); | 95 g_factory.Get().CompositorInitializedHardwareDraw(); |
94 return success; | 96 return success; |
95 } | 97 } |
96 | 98 |
97 void SynchronousCompositorImpl::ReleaseHwDraw() { | 99 void SynchronousCompositorImpl::ReleaseHwDraw() { |
98 DCHECK(CalledOnValidThread()); | 100 DCHECK(CalledOnValidThread()); |
99 DCHECK(output_surface_); | 101 DCHECK(output_surface_); |
100 output_surface_->ReleaseHwDraw(); | 102 output_surface_->ReleaseHwDraw(); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 g_factory.Get(); // Ensure it's initialized. | 270 g_factory.Get(); // Ensure it's initialized. |
269 SynchronousCompositorImpl::CreateForWebContents(contents); | 271 SynchronousCompositorImpl::CreateForWebContents(contents); |
270 } | 272 } |
271 if (SynchronousCompositorImpl* instance = | 273 if (SynchronousCompositorImpl* instance = |
272 SynchronousCompositorImpl::FromWebContents(contents)) { | 274 SynchronousCompositorImpl::FromWebContents(contents)) { |
273 instance->SetClient(client); | 275 instance->SetClient(client); |
274 } | 276 } |
275 } | 277 } |
276 | 278 |
277 } // namespace content | 279 } // namespace content |
OLD | NEW |