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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1126963006: Move VISUAL_STATE promise to activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Current state (presubmit warnings, cc_unittests tests failing) Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 25f48d6fb4a4c466f1e42ecb83223389ec13d19b..55652c65d6132d238c017170aac25f327cc1f4c7 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -70,7 +70,8 @@ LayerTreeImpl::LayerTreeImpl(
}
LayerTreeImpl::~LayerTreeImpl() {
- BreakSwapPromises(SwapPromise::SWAP_FAILS);
+ promises_.OnDidNotActivate(Promise::DidNotActivate::ACTIVATION_FAILS);
+ promises_.OnDidNotSwap(Promise::DidNotSwap::SWAP_FAILS);
// Need to explicitly clear the tree prior to destroying this so that
// the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
@@ -199,7 +200,7 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
next_activation_forces_redraw_ = false;
}
- target_tree->PassSwapPromises(&swap_promise_list_);
+ target_tree->PassPromises(&promises_);
target_tree->set_top_controls_shrink_blink_size(
top_controls_shrink_blink_size_);
@@ -989,9 +990,11 @@ void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const {
}
state->EndArray();
- state->BeginArray("swap_promise_trace_ids");
- for (size_t i = 0; i < swap_promise_list_.size(); i++)
- state->AppendDouble(swap_promise_list_[i]->TraceId());
+ state->BeginArray("promise_trace_ids");
+ std::vector<int64> trace_ids;
+ promises_.GetTraceIds(&trace_ids);
+ for (size_t i = 0; i < trace_ids.size(); i++)
+ state->AppendDouble(trace_ids[i]);
state->EndArray();
}
@@ -1065,28 +1068,28 @@ void LayerTreeImpl::DistributeRootScrollOffset() {
UpdateRootScrollOffsetDelegate();
}
-void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
- DCHECK(swap_promise);
- swap_promise_list_.push_back(swap_promise.Pass());
+void LayerTreeImpl::PassPromises(PromiseList* other) {
+ promises_.PassPromises(other);
}
-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::QueuePromise(scoped_ptr<Promise> promise) {
+ promises_.QueuePromise(promise.Pass());
+}
+
+void LayerTreeImpl::BreakSwapPromises(Promise::DidNotSwap::Reason reason) {
+ promises_.OnDidNotSwap(reason);
}
void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
- for (size_t i = 0; i < swap_promise_list_.size(); i++)
- swap_promise_list_[i]->DidSwap(metadata);
- swap_promise_list_.clear();
+ promises_.OnDidSwap(metadata);
+}
+
+void LayerTreeImpl::BreakActivationPromises(Promise::DidNotActivate::Reason reason) {
+ promises_.OnDidNotActivate(reason);
}
-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::FinishActivationPromises(CompositorFrameMetadata* metadata) {
+ promises_.OnDidActivate(metadata);
}
void LayerTreeImpl::DidModifyTilePriorities() {

Powered by Google App Engine
This is Rietveld 408576698