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

Unified Diff: cc/layers/tiled_layer.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made DrawsContent non-virtual Created 6 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
Index: cc/layers/tiled_layer.cc
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 56df6f716ac25c61551ddd6da75437c9a9bece23..251bca9874db6e29686a3662e0b13373221ce1a0 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -155,27 +155,26 @@ void TiledLayer::UpdateBounds() {
for (Region::Iterator new_rects(new_tiling_rect); new_rects.has_rect();
new_rects.next())
InvalidateContentRect(new_rects.rect());
+ UpdateDrawsContent(true);
}
void TiledLayer::SetTileSize(const gfx::Size& size) {
tiler_->SetTileSize(size);
+ UpdateDrawsContent(true);
}
void TiledLayer::SetBorderTexelOption(
LayerTilingData::BorderTexelOption border_texel_option) {
tiler_->SetBorderTexelOption(border_texel_option);
+ UpdateDrawsContent(true);
}
-bool TiledLayer::DrawsContent() const {
- if (!ContentsScalingLayer::DrawsContent())
- return false;
-
+void TiledLayer::UpdateDrawsContent(bool draws_content) {
bool has_more_than_one_tile =
- tiler_->num_tiles_x() > 1 || tiler_->num_tiles_y() > 1;
- if (tiling_option_ == NEVER_TILE && has_more_than_one_tile)
- return false;
-
- return true;
+ (tiler_->num_tiles_x() > 1) || (tiler_->num_tiles_y() > 1);
+ ContentsScalingLayer::UpdateDrawsContent(
+ draws_content &&
+ !(tiling_option_ == NEVER_TILE && has_more_than_one_tile));
}
void TiledLayer::ReduceMemoryUsage() {
« cc/layers/layer.cc ('K') | « cc/layers/tiled_layer.h ('k') | cc/layers/ui_resource_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698