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 "content/browser/android/in_process/synchronous_compositor_factory_impl .h" | 10 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 DCHECK(output_surface_); | 133 DCHECK(output_surface_); |
134 | 134 |
135 return output_surface_->DemandDrawSw(canvas); | 135 return output_surface_->DemandDrawSw(canvas); |
136 } | 136 } |
137 | 137 |
138 void SynchronousCompositorImpl::SetMemoryPolicy( | 138 void SynchronousCompositorImpl::SetMemoryPolicy( |
139 const SynchronousCompositorMemoryPolicy& policy) { | 139 const SynchronousCompositorMemoryPolicy& policy) { |
140 DCHECK(CalledOnValidThread()); | 140 DCHECK(CalledOnValidThread()); |
141 DCHECK(output_surface_); | 141 DCHECK(output_surface_); |
142 | 142 |
143 return output_surface_->SetMemoryPolicy(policy); | 143 output_surface_->SetMemoryPolicy(policy); |
boliu
2014/04/18 16:13:09
Do this separately to avoid having to have a conte
| |
144 } | 144 } |
145 | 145 |
146 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() { | 146 void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() { |
147 if (input_handler_) | 147 if (input_handler_) |
148 input_handler_->OnRootLayerDelegatedScrollOffsetChanged(); | 148 input_handler_->OnRootLayerDelegatedScrollOffsetChanged(); |
149 } | 149 } |
150 | 150 |
151 void SynchronousCompositorImpl::DidBindOutputSurface( | 151 void SynchronousCompositorImpl::DidBindOutputSurface( |
152 SynchronousCompositorOutputSurface* output_surface) { | 152 SynchronousCompositorOutputSurface* output_surface) { |
153 DCHECK(CalledOnValidThread()); | 153 DCHECK(CalledOnValidThread()); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 g_factory.Get(); // Ensure it's initialized. | 285 g_factory.Get(); // Ensure it's initialized. |
286 SynchronousCompositorImpl::CreateForWebContents(contents); | 286 SynchronousCompositorImpl::CreateForWebContents(contents); |
287 } | 287 } |
288 if (SynchronousCompositorImpl* instance = | 288 if (SynchronousCompositorImpl* instance = |
289 SynchronousCompositorImpl::FromWebContents(contents)) { | 289 SynchronousCompositorImpl::FromWebContents(contents)) { |
290 instance->SetClient(client); | 290 instance->SetClient(client); |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 } // namespace content | 294 } // namespace content |
OLD | NEW |