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

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

Issue 14092003: Add compositor support for the LatencyInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« cc/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 gfx::Vector2dF(0.f, top_controls_manager_->controls_top_offset()); 1007 gfx::Vector2dF(0.f, top_controls_manager_->controls_top_offset());
1008 metadata.location_bar_content_translation = 1008 metadata.location_bar_content_translation =
1009 gfx::Vector2dF(0.f, top_controls_manager_->content_top_offset()); 1009 gfx::Vector2dF(0.f, top_controls_manager_->content_top_offset());
1010 metadata.overdraw_bottom_height = overdraw_bottom_height_; 1010 metadata.overdraw_bottom_height = overdraw_bottom_height_;
1011 } 1011 }
1012 1012
1013 if (!RootScrollLayer()) 1013 if (!RootScrollLayer())
1014 return metadata; 1014 return metadata;
1015 1015
1016 metadata.root_scroll_offset = RootScrollLayer()->TotalScrollOffset(); 1016 metadata.root_scroll_offset = RootScrollLayer()->TotalScrollOffset();
1017 metadata.latency_info = latency_info_;
1017 1018
1018 return metadata; 1019 return metadata;
1019 } 1020 }
1020 1021
1021 bool LayerTreeHostImpl::AllowPartialSwap() const { 1022 bool LayerTreeHostImpl::AllowPartialSwap() const {
1022 // We don't track damage on the HUD layer (it interacts with damage tracking 1023 // We don't track damage on the HUD layer (it interacts with damage tracking
1023 // visualizations), so disable partial swaps to make the HUD layer display 1024 // visualizations), so disable partial swaps to make the HUD layer display
1024 // properly. 1025 // properly.
1025 return !debug_state_.ShowHudRects(); 1026 return !debug_state_.ShowHudRects();
1026 } 1027 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 return renderer_ && renderer_->IsContextLost(); 1107 return renderer_ && renderer_->IsContextLost();
1107 } 1108 }
1108 1109
1109 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const { 1110 const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
1110 return renderer_->Capabilities(); 1111 return renderer_->Capabilities();
1111 } 1112 }
1112 1113
1113 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { 1114 bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
1114 if (frame.has_no_damage) 1115 if (frame.has_no_damage)
1115 return false; 1116 return false;
1116 return renderer_->SwapBuffers(); 1117 bool result = renderer_->SwapBuffers(latency_info_);
1118 latency_info_.Clear();
1119 return result;
1120 }
1121
1122 void LayerTreeHostImpl::SetLatencyInfo(const LatencyInfo& latency_info) {
1123 latency_info_.MergeWith(latency_info);
1117 } 1124 }
1118 1125
1119 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) { 1126 void LayerTreeHostImpl::EnableVSyncNotification(bool enable) {
1120 if (output_surface_) 1127 if (output_surface_)
1121 output_surface_->EnableVSyncNotification(enable); 1128 output_surface_->EnableVSyncNotification(enable);
1122 } 1129 }
1123 1130
1124 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const { 1131 gfx::Size LayerTreeHostImpl::DeviceViewportSize() const {
1125 return device_viewport_size(); 1132 return device_viewport_size();
1126 } 1133 }
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 } 2093 }
2087 2094
2088 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2095 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2089 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2096 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2090 paint_time_counter_->ClearHistory(); 2097 paint_time_counter_->ClearHistory();
2091 2098
2092 debug_state_ = debug_state; 2099 debug_state_ = debug_state;
2093 } 2100 }
2094 2101
2095 } // namespace cc 2102 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698