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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 23694031: Fix race conditions in window snapshot code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated enne and jbauman's feedback. Created 7 years, 3 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 dea57577216875db94ac4e155cb3def7d83c48c7..4e1d455d35026fb154da8b3f83b5b5e9d04b2602 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -109,7 +109,8 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
partial_texture_update_requests_(0),
in_paint_layer_contents_(false),
total_frames_used_for_lcd_text_metrics_(0),
- tree_id_(s_next_tree_id++) {
+ tree_id_(s_next_tree_id++),
+ next_commit_forces_redraw_(false) {
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
s_num_layer_tree_instances++;
@@ -299,11 +300,17 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
DCHECK(!host_impl->pending_tree());
host_impl->CreatePendingTree();
sync_tree = host_impl->pending_tree();
+ if (next_commit_forces_redraw_)
+ sync_tree->ForceRedrawNextActivation();
} else {
+ if (next_commit_forces_redraw_)
+ host_impl->SetFullRootLayerDamage();
contents_texture_manager_->ReduceMemory(host_impl->resource_provider());
sync_tree = host_impl->active_tree();
}
+ next_commit_forces_redraw_ = false;
+
sync_tree->set_source_frame_number(source_frame_number());
if (needs_full_tree_sync_)
@@ -542,6 +549,10 @@ void LayerTreeHost::SetNextCommitWaitsForActivation() {
proxy_->SetNextCommitWaitsForActivation();
}
+void LayerTreeHost::SetNextCommitForcesRedraw() {
+ next_commit_forces_redraw_ = true;
+}
+
void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) {
DCHECK(proxy_->IsMainThread());

Powered by Google App Engine
This is Rietveld 408576698