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

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: Created 6 years, 4 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
« no previous file with comments | « cc/layers/tiled_layer.h ('k') | cc/layers/ui_resource_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/tiled_layer.cc
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 6656405a72dbd001457d7a356b73365d1eacecf0..c1937e49f7e51693ed1e52f1d4f44fd98977c0b7 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -154,27 +154,26 @@ void TiledLayer::UpdateBounds() {
for (Region::Iterator new_rects(new_region); new_rects.has_rect();
new_rects.next())
InvalidateContentRect(new_rects.rect());
+ UpdateDrawsContent(HasDrawableContent());
}
void TiledLayer::SetTileSize(const gfx::Size& size) {
tiler_->SetTileSize(size);
+ UpdateDrawsContent(HasDrawableContent());
}
void TiledLayer::SetBorderTexelOption(
LayerTilingData::BorderTexelOption border_texel_option) {
tiler_->SetBorderTexelOption(border_texel_option);
+ UpdateDrawsContent(HasDrawableContent());
}
-bool TiledLayer::DrawsContent() const {
- if (!ContentsScalingLayer::DrawsContent())
- return false;
-
+bool TiledLayer::HasDrawableContent() const {
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;
+ (tiler_->num_tiles_x() > 1) || (tiler_->num_tiles_y() > 1);
- return true;
+ return !(tiling_option_ == NEVER_TILE && has_more_than_one_tile) &&
+ ContentsScalingLayer::HasDrawableContent();
}
void TiledLayer::ReduceMemoryUsage() {
« no previous file with comments | « 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