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

Unified Diff: cc/resources/layer_tiling_data.cc

Issue 235753002: cc: Give TilingData a Rect instead of a Size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Git cl format Created 6 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
« no previous file with comments | « cc/resources/layer_tiling_data.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/layer_tiling_data.cc
diff --git a/cc/resources/layer_tiling_data.cc b/cc/resources/layer_tiling_data.cc
index ccbb6d0148194cc6ea8d8ee2f2b44cadabcf9e99..b8d80bc37607ff9032d559c8128b451e59bee96e 100644
--- a/cc/resources/layer_tiling_data.cc
+++ b/cc/resources/layer_tiling_data.cc
@@ -17,7 +17,7 @@ scoped_ptr<LayerTilingData> LayerTilingData::Create(const gfx::Size& tile_size,
LayerTilingData::LayerTilingData(const gfx::Size& tile_size,
BorderTexelOption border)
- : tiling_data_(tile_size, gfx::Size(), border == HAS_BORDER_TEXELS) {
+ : tiling_data_(tile_size, gfx::Rect(), border == HAS_BORDER_TEXELS) {
SetTileSize(tile_size);
}
@@ -112,9 +112,9 @@ Region LayerTilingData::OpaqueRegionInContentRect(
return opaque_region;
}
-void LayerTilingData::SetBounds(const gfx::Size& size) {
- tiling_data_.SetTotalSize(size);
- if (size.IsEmpty()) {
+void LayerTilingData::SetTilingRect(const gfx::Rect& tiling_rect) {
+ tiling_data_.SetTilingRect(tiling_rect);
+ if (tiling_rect.IsEmpty()) {
tiles_.clear();
return;
}
@@ -122,8 +122,7 @@ void LayerTilingData::SetBounds(const gfx::Size& size) {
// Any tiles completely outside our new bounds are invalid and should be
// dropped.
int left, top, right, bottom;
- ContentRectToTileIndices(
- gfx::Rect(size), &left, &top, &right, &bottom);
+ ContentRectToTileIndices(tiling_rect, &left, &top, &right, &bottom);
std::vector<TileMapKey> invalid_tile_keys;
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
if (it->first.first > right || it->first.second > bottom)
« no previous file with comments | « cc/resources/layer_tiling_data.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698