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

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

Issue 1013273003: cc: Force an update on tile size after viewport resize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attempt 3? Created 5 years, 9 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); 301 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
302 302
303 sync_tree()->set_needs_update_draw_properties(); 303 sync_tree()->set_needs_update_draw_properties();
304 304
305 if (settings_.impl_side_painting) { 305 if (settings_.impl_side_painting) {
306 // Impl-side painting needs an update immediately post-commit to have the 306 // Impl-side painting needs an update immediately post-commit to have the
307 // opportunity to create tilings. Other paths can call UpdateDrawProperties 307 // opportunity to create tilings. Other paths can call UpdateDrawProperties
308 // more lazily when needed prior to drawing. Because invalidations may 308 // more lazily when needed prior to drawing. Because invalidations may
309 // be coming from the main thread, it's safe to do an update for lcd text 309 // be coming from the main thread, it's safe to do an update for lcd text
310 // at this point and see if lcd text needs to be disabled on any layers. 310 // at this point and see if lcd text needs to be disabled on any layers.
311 bool update_lcd_text = true; 311 bool first_update_after_commit = true;
312 sync_tree()->UpdateDrawProperties(update_lcd_text); 312 sync_tree()->UpdateDrawProperties(first_update_after_commit);
313 // Start working on newly created tiles immediately if needed. 313 // Start working on newly created tiles immediately if needed.
314 if (tile_manager_ && tile_priorities_dirty_) 314 if (tile_manager_ && tile_priorities_dirty_)
315 PrepareTiles(); 315 PrepareTiles();
316 else 316 else
317 NotifyReadyToActivate(); 317 NotifyReadyToActivate();
318 } else { 318 } else {
319 // If we're not in impl-side painting, the tree is immediately considered 319 // If we're not in impl-side painting, the tree is immediately considered
320 // active. 320 // active.
321 ActivateSyncTree(); 321 ActivateSyncTree();
322 } 322 }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 TRACE_EVENT1("cc", 1041 TRACE_EVENT1("cc",
1042 "LayerTreeHostImpl::PrepareToDraw", 1042 "LayerTreeHostImpl::PrepareToDraw",
1043 "SourceFrameNumber", 1043 "SourceFrameNumber",
1044 active_tree_->source_frame_number()); 1044 active_tree_->source_frame_number());
1045 if (input_handler_client_) 1045 if (input_handler_client_)
1046 input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); 1046 input_handler_client_->ReconcileElasticOverscrollAndRootScroll();
1047 1047
1048 UMA_HISTOGRAM_CUSTOM_COUNTS( 1048 UMA_HISTOGRAM_CUSTOM_COUNTS(
1049 "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20); 1049 "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20);
1050 1050
1051 bool update_lcd_text = false; 1051 bool first_update_after_commit = false;
1052 bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); 1052 bool ok = active_tree_->UpdateDrawProperties(first_update_after_commit);
1053 DCHECK(ok) << "UpdateDrawProperties failed during draw"; 1053 DCHECK(ok) << "UpdateDrawProperties failed during draw";
1054 1054
1055 // This will cause NotifyTileStateChanged() to be called for any visible tiles 1055 // This will cause NotifyTileStateChanged() to be called for any visible tiles
1056 // that completed, which will add damage to the frame for them so they appear 1056 // that completed, which will add damage to the frame for them so they appear
1057 // as part of the current frame being drawn. 1057 // as part of the current frame being drawn.
1058 if (tile_manager_) 1058 if (tile_manager_)
1059 tile_manager_->UpdateVisibleTiles(global_tile_state_); 1059 tile_manager_->UpdateVisibleTiles(global_tile_state_);
1060 1060
1061 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); 1061 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList();
1062 frame->render_passes.clear(); 1062 frame->render_passes.clear();
(...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after
3451 (*it)->OnSetNeedsRedrawOnImpl(); 3451 (*it)->OnSetNeedsRedrawOnImpl();
3452 } 3452 }
3453 3453
3454 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { 3454 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() {
3455 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3455 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3456 for (; it != swap_promise_monitor_.end(); it++) 3456 for (; it != swap_promise_monitor_.end(); it++)
3457 (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); 3457 (*it)->OnForwardScrollUpdateToMainThreadOnImpl();
3458 } 3458 }
3459 3459
3460 } // namespace cc 3460 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698