Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 12674030: cc: Hook vsync time source to output surface (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 // We always need to commit after changing the memory policy because the new 901 // We always need to commit after changing the memory policy because the new
902 // limit can result in more or less content having texture allocated for it. 902 // limit can result in more or less content having texture allocated for it.
903 client_->SetNeedsCommitOnImplThread(); 903 client_->SetNeedsCommitOnImplThread();
904 } 904 }
905 905
906 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase, 906 void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase,
907 base::TimeDelta interval) { 907 base::TimeDelta interval) {
908 client_->OnVSyncParametersChanged(timebase, interval); 908 client_->OnVSyncParametersChanged(timebase, interval);
909 } 909 }
910 910
911 void LayerTreeHostImpl::DidVSync(base::TimeTicks frame_time) {
912 client_->DidVSync(frame_time);
913 }
914
911 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck( 915 void LayerTreeHostImpl::OnSendFrameToParentCompositorAck(
912 const CompositorFrameAck& ack) { 916 const CompositorFrameAck& ack) {
913 if (!renderer_) 917 if (!renderer_)
914 return; 918 return;
915 919
916 // TODO(piman): We may need to do some validation on this ack before 920 // TODO(piman): We may need to do some validation on this ack before
917 // processing it. 921 // processing it.
918 renderer_->ReceiveCompositorFrameAck(ack); 922 renderer_->ReceiveCompositorFrameAck(ack);
919 } 923 }
920 924
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 } 1022 }
1019 1023
1020 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { 1024 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
1021 return renderer_->Capabilities(); 1025 return renderer_->Capabilities();
1022 } 1026 }
1023 1027
1024 bool LayerTreeHostImpl::SwapBuffers() { 1028 bool LayerTreeHostImpl::SwapBuffers() {
1025 return renderer_->SwapBuffers(); 1029 return renderer_->SwapBuffers();
1026 } 1030 }
1027 1031
1032 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) {
1033 if (output_surface_)
1034 output_surface_->EnableVSyncNotification(enable);
1035 }
1036
1028 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { 1037 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const {
1029 return device_viewport_size(); 1038 return device_viewport_size();
1030 } 1039 }
1031 1040
1032 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { 1041 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const {
1033 gfx::SizeF dip_size = 1042 gfx::SizeF dip_size =
1034 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor()); 1043 gfx::ScaleSize(DeviceViewportSize(), 1.f / device_scale_factor());
1035 1044
1036 // The clip layer should be used if non-overlay scrollbars may exist since 1045 // The clip layer should be used if non-overlay scrollbars may exist since
1037 // it adjusts for them. 1046 // it adjusts for them.
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 debug_state_ = debug_state; 1974 debug_state_ = debug_state;
1966 } 1975 }
1967 1976
1968 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time, 1977 void LayerTreeHostImpl::SavePaintTime(const base::TimeDelta& total_paint_time,
1969 int commit_number) { 1978 int commit_number) {
1970 DCHECK(debug_state_.continuous_painting); 1979 DCHECK(debug_state_.continuous_painting);
1971 paint_time_counter_->SavePaintTime(total_paint_time, commit_number); 1980 paint_time_counter_->SavePaintTime(total_paint_time, commit_number);
1972 } 1981 }
1973 1982
1974 } // namespace cc 1983 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698