| 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 "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "cc/input/input_handler.h" | 10 #include "cc/input/input_handler.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 contents_->GetRenderWidgetHostView()); | 408 contents_->GetRenderWidgetHostView()); |
| 409 if (rwhv) | 409 if (rwhv) |
| 410 rwhv->SynchronousFrameMetadata(frame_metadata); | 410 rwhv->SynchronousFrameMetadata(frame_metadata); |
| 411 } | 411 } |
| 412 | 412 |
| 413 void SynchronousCompositorImpl::DidActivatePendingTree() { | 413 void SynchronousCompositorImpl::DidActivatePendingTree() { |
| 414 if (compositor_client_) | 414 if (compositor_client_) |
| 415 compositor_client_->DidUpdateContent(); | 415 compositor_client_->DidUpdateContent(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void SynchronousCompositorImpl::SetMaxScrollOffset( |
| 419 gfx::Vector2dF max_scroll_offset) { |
| 420 DCHECK(CalledOnValidThread()); |
| 421 if (compositor_client_) |
| 422 compositor_client_->SetMaxRootLayerScrollOffset(max_scroll_offset); |
| 423 } |
| 424 |
| 418 void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) { | 425 void SynchronousCompositorImpl::SetTotalScrollOffset(gfx::Vector2dF new_value) { |
| 419 DCHECK(CalledOnValidThread()); | 426 DCHECK(CalledOnValidThread()); |
| 420 if (compositor_client_) | 427 if (compositor_client_) { |
| 421 compositor_client_->SetTotalRootLayerScrollOffset(new_value); | 428 compositor_client_->SetTotalRootLayerScrollOffset(new_value); |
| 429 } |
| 422 } | 430 } |
| 423 | 431 |
| 424 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { | 432 gfx::Vector2dF SynchronousCompositorImpl::GetTotalScrollOffset() { |
| 425 DCHECK(CalledOnValidThread()); | 433 DCHECK(CalledOnValidThread()); |
| 426 if (compositor_client_) | 434 if (compositor_client_) |
| 427 return compositor_client_->GetTotalRootLayerScrollOffset(); | 435 return compositor_client_->GetTotalRootLayerScrollOffset(); |
| 428 return gfx::Vector2dF(); | 436 return gfx::Vector2dF(); |
| 429 } | 437 } |
| 430 | 438 |
| 431 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 439 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
| (...skipping 11 matching lines...) Expand all Loading... |
| 443 g_factory.Get(); // Ensure it's initialized. | 451 g_factory.Get(); // Ensure it's initialized. |
| 444 SynchronousCompositorImpl::CreateForWebContents(contents); | 452 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 445 } | 453 } |
| 446 if (SynchronousCompositorImpl* instance = | 454 if (SynchronousCompositorImpl* instance = |
| 447 SynchronousCompositorImpl::FromWebContents(contents)) { | 455 SynchronousCompositorImpl::FromWebContents(contents)) { |
| 448 instance->SetClient(client); | 456 instance->SetClient(client); |
| 449 } | 457 } |
| 450 } | 458 } |
| 451 | 459 |
| 452 } // namespace content | 460 } // namespace content |
| OLD | NEW |