Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 9565c57a4d259e37350e903de9a3cd8b78b015e5..ef4bcbfd2c182f31936b00d580625bee727b0bc3 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -120,9 +120,6 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
next_activation_forces_redraw_ = false; |
} |
- target_tree->SetLatencyInfo(latency_info_); |
- latency_info_.Clear(); |
- |
target_tree->PassSwapPromises(&swap_promise_list_); |
target_tree->SetPageScaleFactorAndLimits( |
@@ -464,8 +461,6 @@ void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) { |
pending_tree->SetCurrentlyScrollingLayer( |
LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), |
currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0)); |
- pending_tree->SetLatencyInfo(latency_info_); |
- latency_info_.Clear(); |
} |
static void DidBecomeActiveRecursive(LayerImpl* layer) { |
@@ -699,16 +694,18 @@ void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { |
scrollable_viewport_size - original_viewport_size); |
} |
-void LayerTreeImpl::SetLatencyInfo(const ui::LatencyInfo& latency_info) { |
- latency_info_.MergeWith(latency_info); |
-} |
- |
-const ui::LatencyInfo& LayerTreeImpl::GetLatencyInfo() { |
- return latency_info_; |
-} |
- |
-void LayerTreeImpl::ClearLatencyInfo() { |
- latency_info_.Clear(); |
+// TODO(miletus): The merge here is a temporary hack. Should change the |
+// function to be |
+// TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) |
+// Once we remove the LatencyInfo merge in the gpu side. |
+void LayerTreeImpl::TakeLatencyInfo(ui::LatencyInfo* latency_info) { |
danakj
2013/11/26 19:17:53
Why isn't this going through the DidSwap() method?
Yufeng Shen (Slow to review)
2013/11/27 20:05:33
Removed.
Changed the DidSwap() signature to be
vi
|
+ ScopedPtrVector<SwapPromise>::iterator it = swap_promise_list_.begin(); |
+ for (; it != swap_promise_list_.end(); it++) { |
+ if ((*it) && ((*it)->type() == SwapPromise::SWAP_PROMISE_LATENCY_INFO)) { |
+ latency_info->MergeWith( |
+ (static_cast<LatencyInfoSwapPromise*>(*it))->GetLatencyInfo()); |
+ } |
+ } |
} |
void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |