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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2185823005: Make RenderViewImpl::OnForceRedraw more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index f295efcfaca6ea2c8cdaf8b5fbe7946151a5bcca..9884ada54294cbf2e6f7631577a5b365b6b2c46d 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -517,6 +517,11 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->PassSwapPromises(&swap_promise_list_);
+ for (auto& swap_promise : forced_redraw_swap_promises_) {
+ host_impl->QueueForcedRedrawSwapPromise(std::move(swap_promise));
+ }
+ forced_redraw_swap_promises_.clear();
+
sync_tree->set_top_controls_shrink_blink_size(
top_controls_shrink_blink_size_);
sync_tree->set_top_controls_height(top_controls_height_);
@@ -749,6 +754,7 @@ void LayerTreeHost::SetNextCommitWaitsForActivation() {
void LayerTreeHost::SetNextCommitForcesRedraw() {
next_commit_forces_redraw_ = true;
proxy_->SetNeedsUpdateLayers();
+ NotifySwapPromiseMonitorsOfSetNeedsForcedRedraw();
}
void LayerTreeHost::SetAnimationEvents(
@@ -1285,12 +1291,23 @@ void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() {
(*it)->OnSetNeedsCommitOnMain();
}
+void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsForcedRedraw() {
+ std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
+ for (; it != swap_promise_monitor_.end(); it++)
+ (*it)->OnSetNeedsForcedRedrawOnMain();
+}
+
void LayerTreeHost::QueueSwapPromise(
std::unique_ptr<SwapPromise> swap_promise) {
DCHECK(swap_promise);
swap_promise_list_.push_back(std::move(swap_promise));
}
+void LayerTreeHost::QueueForcedRedrawSwapPromise(
+ std::unique_ptr<SwapPromise> swap_promise) {
+ forced_redraw_swap_promises_.push_back(std::move(swap_promise));
+}
+
void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
for (const auto& swap_promise : swap_promise_list_)
swap_promise->DidNotSwap(reason);

Powered by Google App Engine
This is Rietveld 408576698