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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 2869513002: cc: Clear checker-image tracking on navigation and visibility changes. (Closed)
Patch Set: missed pending invalidations Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (next_commit_forces_recalculate_raster_scales_) { 294 if (next_commit_forces_recalculate_raster_scales_) {
295 sync_tree->ForceRecalculateRasterScales(); 295 sync_tree->ForceRecalculateRasterScales();
296 next_commit_forces_recalculate_raster_scales_ = false; 296 next_commit_forces_recalculate_raster_scales_ = false;
297 } 297 }
298 298
299 sync_tree->set_source_frame_number(SourceFrameNumber()); 299 sync_tree->set_source_frame_number(SourceFrameNumber());
300 300
301 if (needs_full_tree_sync_) 301 if (needs_full_tree_sync_)
302 TreeSynchronizer::SynchronizeTrees(root_layer(), sync_tree); 302 TreeSynchronizer::SynchronizeTrees(root_layer(), sync_tree);
303 303
304 // Track the navigation state before pushing properties since it overwrites
305 // the |content_source_id_| on the sync tree.
306 bool did_navigate = content_source_id_ != sync_tree->content_source_id();
307 if (did_navigate)
308 host_impl->ClearImageCacheOnNavigation();
309
304 PushPropertiesTo(sync_tree); 310 PushPropertiesTo(sync_tree);
305 311
306 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises()); 312 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises());
307 313
308 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 314 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
309 host_impl->SetContentIsSuitableForGpuRasterization( 315 host_impl->SetContentIsSuitableForGpuRasterization(
310 content_is_suitable_for_gpu_rasterization_); 316 content_is_suitable_for_gpu_rasterization_);
311 RecordGpuRasterizationHistogram(host_impl); 317 RecordGpuRasterizationHistogram(host_impl);
312 318
313 host_impl->SetViewportSize(device_viewport_size_); 319 host_impl->SetViewportSize(device_viewport_size_);
314 sync_tree->SetDeviceScaleFactor(device_scale_factor_); 320 sync_tree->SetDeviceScaleFactor(device_scale_factor_);
315 host_impl->SetDebugState(debug_state_); 321 host_impl->SetDebugState(debug_state_);
316 322
317 if (did_navigate_) {
318 did_navigate_ = false;
319 host_impl->ClearImageCacheOnNavigation();
320 }
321
322 sync_tree->set_ui_resource_request_queue( 323 sync_tree->set_ui_resource_request_queue(
323 ui_resource_manager_->TakeUIResourcesRequests()); 324 ui_resource_manager_->TakeUIResourcesRequests());
324 325
325 { 326 {
326 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties"); 327 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties");
327 328
328 TreeSynchronizer::PushLayerProperties(this, sync_tree); 329 TreeSynchronizer::PushLayerProperties(this, sync_tree);
329 330
330 // This must happen after synchronizing property trees and after pushing 331 // This must happen after synchronizing property trees and after pushing
331 // properties, which updates the clobber_active_value flag. 332 // properties, which updates the clobber_active_value flag.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 } 872 }
872 873
873 if (hud_layer_.get()) 874 if (hud_layer_.get())
874 hud_layer_->RemoveFromParent(); 875 hud_layer_->RemoveFromParent();
875 876
876 // Reset gpu rasterization tracking. 877 // Reset gpu rasterization tracking.
877 // This flag is sticky until a new tree comes along. 878 // This flag is sticky until a new tree comes along.
878 ResetGpuRasterizationTracking(); 879 ResetGpuRasterizationTracking();
879 880
880 SetNeedsFullTreeSync(); 881 SetNeedsFullTreeSync();
881 did_navigate_ = true;
882 } 882 }
883 883
884 void LayerTreeHost::RegisterViewportLayers( 884 void LayerTreeHost::RegisterViewportLayers(
885 scoped_refptr<Layer> overscroll_elasticity_layer, 885 scoped_refptr<Layer> overscroll_elasticity_layer,
886 scoped_refptr<Layer> page_scale_layer, 886 scoped_refptr<Layer> page_scale_layer,
887 scoped_refptr<Layer> inner_viewport_scroll_layer, 887 scoped_refptr<Layer> inner_viewport_scroll_layer,
888 scoped_refptr<Layer> outer_viewport_scroll_layer) { 888 scoped_refptr<Layer> outer_viewport_scroll_layer) {
889 DCHECK(!inner_viewport_scroll_layer || 889 DCHECK(!inner_viewport_scroll_layer ||
890 inner_viewport_scroll_layer != outer_viewport_scroll_layer); 890 inner_viewport_scroll_layer != outer_viewport_scroll_layer);
891 overscroll_elasticity_layer_ = overscroll_elasticity_layer; 891 overscroll_elasticity_layer_ = overscroll_elasticity_layer;
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { 1439 void LayerTreeHost::SetNeedsDisplayOnAllLayers() {
1440 for (auto* layer : *this) 1440 for (auto* layer : *this)
1441 layer->SetNeedsDisplay(); 1441 layer->SetNeedsDisplay();
1442 } 1442 }
1443 1443
1444 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { 1444 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) {
1445 has_copy_request_ = has_copy_request; 1445 has_copy_request_ = has_copy_request;
1446 } 1446 }
1447 1447
1448 } // namespace cc 1448 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698