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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 60513007: Add SwapPromise support to LayerTreeHost and LayerTreeImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add OVERRIDE to TestSwapPromise::DidNotSwap Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 15bd750b13e24e02122ecaeb8df7579b692fe4cf..ea3218d536450a5bdf8847322613798ad681af68 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -122,6 +122,9 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
target_tree->SetLatencyInfo(latency_info_);
latency_info_.Clear();
+
+ target_tree->PassSwapPromises(&swap_promise_list_);
+
target_tree->SetPageScaleFactorAndLimits(
page_scale_factor(), min_page_scale_factor(), max_page_scale_factor());
target_tree->SetPageScaleDelta(
@@ -708,6 +711,32 @@ void LayerTreeImpl::ClearLatencyInfo() {
latency_info_.Clear();
}
+void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
+ DCHECK(swap_promise);
+ if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber)
+ BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW);
+ swap_promise_list_.push_back(swap_promise.Pass());
+}
+
+void LayerTreeImpl::PassSwapPromises(
+ ScopedPtrVector<SwapPromise>* new_swap_promise) {
+ swap_promise_list_.insert_and_take(swap_promise_list_.end(),
+ *new_swap_promise);
+ new_swap_promise->clear();
+}
+
+void LayerTreeImpl::FinishSwapPromises() {
+ for (size_t i = 0; i < swap_promise_list_.size(); i++)
+ swap_promise_list_[i]->DidSwap();
+ swap_promise_list_.clear();
+}
+
+void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
+ for (size_t i = 0; i < swap_promise_list_.size(); i++)
+ swap_promise_list_[i]->DidNotSwap(reason);
+ swap_promise_list_.clear();
+}
+
void LayerTreeImpl::DidModifyTilePriorities() {
layer_tree_host_impl_->DidModifyTilePriorities();
}
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698