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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (rwhv) | 205 if (rwhv) |
206 rwhv->SynchronousFrameMetadata(frame_metadata); | 206 rwhv->SynchronousFrameMetadata(frame_metadata); |
207 } | 207 } |
208 | 208 |
209 void SynchronousCompositorImpl::DidActivatePendingTree() { | 209 void SynchronousCompositorImpl::DidActivatePendingTree() { |
210 if (compositor_client_) | 210 if (compositor_client_) |
211 compositor_client_->DidUpdateContent(); | 211 compositor_client_->DidUpdateContent(); |
212 } | 212 } |
213 | 213 |
214 void SynchronousCompositorImpl::SetMaxScrollOffset( | 214 void SynchronousCompositorImpl::SetMaxScrollOffset( |
215 gfx::Vector2dF max_scroll_offset) { | 215 const gfx::Vector2dF& max_scroll_offset) { |
216 DCHECK(CalledOnValidThread()); | 216 DCHECK(CalledOnValidThread()); |
217 if (compositor_client_) | 217 if (compositor_client_) |
218 compositor_client_->SetMaxRootLayerScrollOffset(max_scroll_offset); | 218 compositor_client_->SetMaxRootLayerScrollOffset(max_scroll_offset); |
219 } | 219 } |
220 | 220 |
221 void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) { | 221 void SynchronousCompositorImpl::SetTotalScrollOffset( |
| 222 const gfx::Vector2dF& new_value) { |
222 DCHECK(CalledOnValidThread()); | 223 DCHECK(CalledOnValidThread()); |
223 if (compositor_client_) | 224 if (compositor_client_) |
224 compositor_client_->SetTotalRootLayerScrollOffset(new_value); | 225 compositor_client_->SetTotalRootLayerScrollOffset(new_value); |
225 } | 226 } |
226 | 227 |
227 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { | 228 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { |
228 DCHECK(CalledOnValidThread()); | 229 DCHECK(CalledOnValidThread()); |
229 if (compositor_client_) | 230 if (compositor_client_) |
230 return compositor_client_->GetTotalRootLayerScrollOffset(); | 231 return compositor_client_->GetTotalRootLayerScrollOffset(); |
231 return gfx::Vector2dF(); | 232 return gfx::Vector2dF(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 g_factory.Get(); // Ensure it's initialized. | 268 g_factory.Get(); // Ensure it's initialized. |
268 SynchronousCompositorImpl::CreateForWebContents(contents); | 269 SynchronousCompositorImpl::CreateForWebContents(contents); |
269 } | 270 } |
270 if (SynchronousCompositorImpl* instance = | 271 if (SynchronousCompositorImpl* instance = |
271 SynchronousCompositorImpl::FromWebContents(contents)) { | 272 SynchronousCompositorImpl::FromWebContents(contents)) { |
272 instance->SetClient(client); | 273 instance->SetClient(client); |
273 } | 274 } |
274 } | 275 } |
275 | 276 |
276 } // namespace content | 277 } // namespace content |
OLD | NEW |