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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sper simple x2 Created 7 years, 8 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/trees/layer_tree_impl.h ('K') | « cc/trees/layer_tree_impl.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_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index eadc4043ab43621b06a0cc02fd7f4d000651856b..03a100e5ea1c7faed41f947b37f86d112c34e585 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -252,13 +252,7 @@ void LayerTreeImpl::UpdateSolidColorScrollbars() {
}
}
-struct UpdateTilePrioritiesForLayer {
- void operator()(LayerImpl *layer) {
- layer->UpdateTilePriorities();
- }
-};
-
-void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
+void LayerTreeImpl::UpdateDrawProperties() {
if (IsActiveTree() && RootScrollLayer() && RootClipLayer())
UpdateRootScrollLayerSizeDelta();
@@ -275,13 +269,6 @@ void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
RootClipLayer()->SetMasksToBounds(false);
}
- if (!needs_update_draw_properties_) {
- if (reason == UPDATE_ACTIVE_TREE_FOR_DRAW && root_layer())
- LayerTreeHostCommon::CallFunctionForSubtree<UpdateTilePrioritiesForLayer>(
- root_layer());
- return;
- }
-
needs_update_draw_properties_ = false;
render_surface_layer_list_.clear();
@@ -303,9 +290,12 @@ void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
"LayerTreeImpl::UpdateDrawProperties",
"IsActive",
IsActiveTree());
+
+ base::TimeTicks frame_time = CurrentFrameTime();
bool update_tile_priorities =
- reason == UPDATE_PENDING_TREE ||
- reason == UPDATE_ACTIVE_TREE_FOR_DRAW;
+ frame_time != frame_time_last_update_tile_priorities_;
+ frame_time_last_update_tile_priorities_ = frame_time;
+
LayerTreeHostCommon::CalculateDrawProperties(
root_layer(),
device_viewport_size(),
@@ -318,7 +308,7 @@ void LayerTreeImpl::UpdateDrawProperties(UpdateDrawPropertiesReason reason) {
}
DCHECK(!needs_update_draw_properties_) <<
- "calcDrawProperties should not set_needs_update_draw_properties()";
+ "CalcDrawProperties should not set_needs_update_draw_properties()";
}
static void ClearRenderSurfacesOnLayerImplRecursive(LayerImpl* current) {
@@ -382,6 +372,9 @@ void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pending_tree) {
int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0;
pending_tree->SetCurrentlyScrollingLayer(
LayerTreeHostCommon::FindLayerInSubtree(pending_tree->root_layer(), id));
+
+ frame_time_last_update_tile_priorities_ =
+ pending_tree->frame_time_last_update_tile_priorities_;
}
static void DidBecomeActiveRecursive(LayerImpl* layer) {
« cc/trees/layer_tree_impl.h ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698