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

Unified Diff: cc/picture_layer_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: Avoid project more agressively. Don't save state for tile prio if we didn't compute tile prio. Created 7 years, 10 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/picture_layer_impl.cc
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index fc0e9d0952ba72ff45a05da559b6c6cb73c815de..2b94fd2cc5939d11babaa7802d7773b7b5de918b 100644
--- a/cc/picture_layer_impl.cc
+++ b/cc/picture_layer_impl.cc
@@ -216,10 +216,22 @@ void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const {
}
void PictureLayerImpl::updateTilePriorities() {
+ if (!tilings_->num_tilings())
+ return;
+
int current_source_frame_number = layerTreeImpl()->source_frame_number();
double current_frame_time =
(layerTreeImpl()->CurrentFrameTime() - base::TimeTicks()).InSecondsF();
+ bool has_tiling_that_needs_update = false;
+ for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
+ if (tilings_->tiling_at(i)->needs_update_tile_priorities(
+ current_source_frame_number, current_frame_time))
+ has_tiling_that_needs_update = true;
+ }
+ if (!has_tiling_that_needs_update)
+ return;
+
gfx::Transform current_screen_space_transform =
screenSpaceTransform();
@@ -504,6 +516,7 @@ PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
DCHECK(contents_scale >= layerTreeImpl()->settings().minimumContentsScale);
PictureLayerTiling* tiling = tilings_->AddTiling(contents_scale);
+ layerTreeImpl()->set_needs_update_tile_priorities();
const Region& recorded = pile_->recorded_region();
DCHECK(!recorded.IsEmpty());
« cc/layer_tree_impl.cc ('K') | « cc/layer_tree_impl.cc ('k') | cc/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698