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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1232573005: cc: Make sure we don't insert or remove layers during painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« cc/layers/layer.cc ('K') | « cc/trees/layer_tree_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 918d5db58fc8c1d738e4e025f2985a9b896f10b9..5969a16006af73f915831d609d272abda2523012 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -118,6 +118,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params)
shared_bitmap_manager_(params->shared_bitmap_manager),
gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager),
task_graph_runner_(params->task_graph_runner),
+ in_update_(false),
surface_id_namespace_(0u),
next_surface_sequence_(1u) {
DCHECK(task_graph_runner_);
@@ -796,6 +797,7 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
for (const auto& layer : update_layer_list)
layer->SavePaintProperties();
+ in_update_ = true;
base::AutoReset<bool> painting(&in_paint_layer_contents_, true);
bool did_paint_content = false;
for (const auto& layer : update_layer_list) {
@@ -806,6 +808,7 @@ bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) {
content_is_suitable_for_gpu_rasterization_ &=
layer->IsSuitableForGpuRasterization();
}
+ in_update_ = false;
return did_paint_content;
}
« cc/layers/layer.cc ('K') | « cc/trees/layer_tree_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698