| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 // We always need to commit after changing the memory policy because the new | 902 // We always need to commit after changing the memory policy because the new |
| 903 // limit can result in more or less content having texture allocated for it. | 903 // limit can result in more or less content having texture allocated for it. |
| 904 client_->SetNeedsCommitOnImplThread(); | 904 client_->SetNeedsCommitOnImplThread(); |
| 905 } | 905 } |
| 906 | 906 |
| 907 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase, | 907 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase, |
| 908 base::TimeDelta interval) { | 908 base::TimeDelta interval) { |
| 909 client_->OnVSyncParametersChanged(timebase, interval); | 909 client_->OnVSyncParametersChanged(timebase, interval); |
| 910 } | 910 } |
| 911 | 911 |
| 912 void LayerTreeHostImpl::DidVSync(base::TimeTicks frame_time) { |
| 913 client_->DidVSync(frame_time); |
| 914 } |
| 915 |
| 912 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck( | 916 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck( |
| 913 const CompositorFrameAck& ack) { | 917 const CompositorFrameAck& ack) { |
| 914 if (!renderer_) | 918 if (!renderer_) |
| 915 return; | 919 return; |
| 916 | 920 |
| 917 // TODO(piman): We may need to do some validation on this ack before | 921 // TODO(piman): We may need to do some validation on this ack before |
| 918 // processing it. | 922 // processing it. |
| 919 renderer_->ReceiveCompositorFrameAck(ack); | 923 renderer_->ReceiveCompositorFrameAck(ack); |
| 920 } | 924 } |
| 921 | 925 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 } | 1023 } |
| 1020 | 1024 |
| 1021 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { | 1025 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { |
| 1022 return renderer_->Capabilities(); | 1026 return renderer_->Capabilities(); |
| 1023 } | 1027 } |
| 1024 | 1028 |
| 1025 bool LayerTreeHostImpl::SwapBuffers() { | 1029 bool LayerTreeHostImpl::SwapBuffers() { |
| 1026 return renderer_->SwapBuffers(); | 1030 return renderer_->SwapBuffers(); |
| 1027 } | 1031 } |
| 1028 | 1032 |
| 1033 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) { |
| 1034 if (output_surface_) |
| 1035 output_surface_->EnableVSyncNotification(enable); |
| 1036 } |
| 1037 |
| 1029 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { | 1038 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { |
| 1030 return device_viewport_size(); | 1039 return device_viewport_size(); |
| 1031 } | 1040 } |
| 1032 | 1041 |
| 1033 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { | 1042 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { |
| 1034 gfx::SizeF dip_size = | 1043 gfx::SizeF dip_size = |
| 1035 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor()); | 1044 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor()); |
| 1036 | 1045 |
| 1037 // The clip layer should be used if non-overlay scrollbars may exist since | 1046 // The clip layer should be used if non-overlay scrollbars may exist since |
| 1038 // it adjusts for them. | 1047 // it adjusts for them. |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 debug_state_ = debug_state; | 2031 debug_state_ = debug_state; |
| 2023 } | 2032 } |
| 2024 | 2033 |
| 2025 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, | 2034 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, |
| 2026 int commit_number) { | 2035 int commit_number) { |
| 2027 DCHECK(debug_state_.continuous_painting); | 2036 DCHECK(debug_state_.continuous_painting); |
| 2028 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); | 2037 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); |
| 2029 } | 2038 } |
| 2030 | 2039 |
| 2031 } // namespace cc | 2040 } // namespace cc |
| OLD | NEW |