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

Unified Diff: cc/layers/tiled_layer.cc

Issue 389973004: cc: Give TilingData back a Size instead of a Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tilingsize: comments 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
« no previous file with comments | « cc/layers/picture_layer_unittest.cc ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('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 56df6f716ac25c61551ddd6da75437c9a9bece23..6656405a72dbd001457d7a356b73365d1eacecf0 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -142,17 +142,16 @@ void TiledLayer::UpdateTileSizeAndTilingOption() {
}
void TiledLayer::UpdateBounds() {
- gfx::Rect old_tiling_rect = tiler_->tiling_rect();
- gfx::Rect new_tiling_rect = gfx::Rect(content_bounds());
- if (old_tiling_rect == new_tiling_rect)
+ gfx::Size old_tiling_size = tiler_->tiling_size();
+ gfx::Size new_tiling_size = content_bounds();
+ if (old_tiling_size == new_tiling_size)
return;
- tiler_->SetTilingRect(new_tiling_rect);
+ tiler_->SetTilingSize(new_tiling_size);
// Invalidate any areas that the new bounds exposes.
- Region old_region = old_tiling_rect;
- Region new_region = new_tiling_rect;
- new_tiling_rect.Subtract(old_tiling_rect);
- for (Region::Iterator new_rects(new_tiling_rect); new_rects.has_rect();
+ Region new_region =
+ SubtractRegions(gfx::Rect(new_tiling_size), gfx::Rect(old_tiling_size));
+ for (Region::Iterator new_rects(new_region); new_rects.has_rect();
new_rects.next())
InvalidateContentRect(new_rects.rect());
}
« no previous file with comments | « cc/layers/picture_layer_unittest.cc ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698