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

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

Issue 1292773003: Queue latency info swap promises in a separate already-active queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing EndArray() Created 5 years, 4 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
« cc/trees/layer_tree_impl.h ('K') | « cc/trees/layer_tree_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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 if (!it.represents_itself()) 1024 if (!it.represents_itself())
1025 continue; 1025 continue;
1026 TracedValue::AppendIDRef(*it, state); 1026 TracedValue::AppendIDRef(*it, state);
1027 } 1027 }
1028 state->EndArray(); 1028 state->EndArray();
1029 1029
1030 state->BeginArray("swap_promise_trace_ids"); 1030 state->BeginArray("swap_promise_trace_ids");
1031 for (auto* swap_promise : swap_promise_list_) 1031 for (auto* swap_promise : swap_promise_list_)
1032 state->AppendDouble(swap_promise->TraceId()); 1032 state->AppendDouble(swap_promise->TraceId());
1033 state->EndArray(); 1033 state->EndArray();
1034
1035 state->BeginArray("active_tree_swap_promise_trace_ids");
1036 for (auto* swap_promise : active_tree_swap_promise_list_)
1037 state->AppendDouble(swap_promise->TraceId());
1038 state->EndArray();
1034 } 1039 }
1035 1040
1036 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( 1041 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
1037 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { 1042 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
1038 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) 1043 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate)
1039 return; 1044 return;
1040 1045
1041 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; 1046 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
1042 1047
1043 if (root_layer_scroll_offset_delegate_) { 1048 if (root_layer_scroll_offset_delegate_) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 inner_viewport_offset); 1106 inner_viewport_offset);
1102 1107
1103 UpdateRootScrollOffsetDelegate(); 1108 UpdateRootScrollOffsetDelegate();
1104 } 1109 }
1105 1110
1106 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { 1111 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
1107 DCHECK(swap_promise); 1112 DCHECK(swap_promise);
1108 swap_promise_list_.push_back(swap_promise.Pass()); 1113 swap_promise_list_.push_back(swap_promise.Pass());
1109 } 1114 }
1110 1115
1116 void LayerTreeImpl::QueueActiveTreeSwapPromise(
1117 scoped_ptr<SwapPromise> swap_promise) {
1118 DCHECK(swap_promise);
1119 active_tree_swap_promise_list_.push_back(swap_promise.Pass());
1120 }
1121
1111 void LayerTreeImpl::PassSwapPromises( 1122 void LayerTreeImpl::PassSwapPromises(
1112 ScopedPtrVector<SwapPromise>* new_swap_promise) { 1123 ScopedPtrVector<SwapPromise>* new_swap_promise) {
1113 swap_promise_list_.insert_and_take(swap_promise_list_.end(), 1124 BreakSwapPromises(SwapPromise::SWAP_FAILS);
danakj 2015/08/14 17:47:39 add a comment explaining what's going on? doesn't
Tobias Sargeant 2015/08/18 11:22:15 Yes, you're right. Corrected now.
1114 new_swap_promise); 1125 swap_promise_list_.swap(*new_swap_promise);
1115 new_swap_promise->clear();
1116 } 1126 }
1117 1127
1118 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { 1128 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
1119 for (auto* swap_promise : swap_promise_list_) 1129 for (auto* swap_promise : swap_promise_list_)
1120 swap_promise->DidSwap(metadata); 1130 swap_promise->DidSwap(metadata);
1121 swap_promise_list_.clear(); 1131 swap_promise_list_.clear();
1132 for (auto* swap_promise : active_tree_swap_promise_list_)
1133 swap_promise->DidSwap(metadata);
1134 active_tree_swap_promise_list_.clear();
1122 } 1135 }
1123 1136
1124 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1137 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1125 for (auto* swap_promise : swap_promise_list_) 1138 for (auto* swap_promise : swap_promise_list_)
1126 swap_promise->DidNotSwap(reason); 1139 swap_promise->DidNotSwap(reason);
1127 swap_promise_list_.clear(); 1140 swap_promise_list_.clear();
1141 for (auto* swap_promise : active_tree_swap_promise_list_)
1142 swap_promise->DidNotSwap(reason);
1143 active_tree_swap_promise_list_.clear();
1128 } 1144 }
1129 1145
1130 void LayerTreeImpl::DidModifyTilePriorities() { 1146 void LayerTreeImpl::DidModifyTilePriorities() {
1131 layer_tree_host_impl_->DidModifyTilePriorities(); 1147 layer_tree_host_impl_->DidModifyTilePriorities();
1132 } 1148 }
1133 1149
1134 void LayerTreeImpl::set_ui_resource_request_queue( 1150 void LayerTreeImpl::set_ui_resource_request_queue(
1135 const UIResourceRequestQueue& queue) { 1151 const UIResourceRequestQueue& queue) {
1136 ui_resource_request_queue_ = queue; 1152 ui_resource_request_queue_ = queue;
1137 } 1153 }
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 const gfx::BoxF& box, 1764 const gfx::BoxF& box,
1749 gfx::BoxF* bounds) const { 1765 gfx::BoxF* bounds) const {
1750 *bounds = gfx::BoxF(); 1766 *bounds = gfx::BoxF();
1751 return layer_tree_host_impl_->animation_host() 1767 return layer_tree_host_impl_->animation_host()
1752 ? layer_tree_host_impl_->animation_host() 1768 ? layer_tree_host_impl_->animation_host()
1753 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 1769 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1754 : true; 1770 : true;
1755 } 1771 }
1756 1772
1757 } // namespace cc 1773 } // namespace cc
OLDNEW
« cc/trees/layer_tree_impl.h ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698