summaryrefslogtreecommitdiffstats
path: root/cc/resources/layer_tiling_data.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-16 06:10:27 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-16 06:10:27 +0000
commita108f5db4fd7067fc19763db044606f0cef491cd (patch)
tree02ef60d990369bf8972389c6eae883b147b6d57f /cc/resources/layer_tiling_data.cc
parentfb7c8ae00299feab2716e06762dff7535b70cfa4 (diff)
downloadchromium_src-a108f5db4fd7067fc19763db044606f0cef491cd.zip
chromium_src-a108f5db4fd7067fc19763db044606f0cef491cd.tar.gz
chromium_src-a108f5db4fd7067fc19763db044606f0cef491cd.tar.bz2
cc: Give TilingData back a Size instead of a Rect.
This is a semi-revert of https://codereview.chromium.org/235753002/. Since it seems that we are not using the ability of TilingData to have a non-zero origin, having a Rect is not needed and less clear what is going on. R=ernstm@chromium.org BUG=362668,386998 Review URL: https://codereview.chromium.org/389973004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/layer_tiling_data.cc')
-rw-r--r--cc/resources/layer_tiling_data.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/cc/resources/layer_tiling_data.cc b/cc/resources/layer_tiling_data.cc
index b8d80bc..fe3f4c5 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::Rect(), border == HAS_BORDER_TEXELS) {
+ : tiling_data_(tile_size, gfx::Size(), border == HAS_BORDER_TEXELS) {
SetTileSize(tile_size);
}
@@ -112,9 +112,9 @@ Region LayerTilingData::OpaqueRegionInContentRect(
return opaque_region;
}
-void LayerTilingData::SetTilingRect(const gfx::Rect& tiling_rect) {
- tiling_data_.SetTilingRect(tiling_rect);
- if (tiling_rect.IsEmpty()) {
+void LayerTilingData::SetTilingSize(const gfx::Size& tiling_size) {
+ tiling_data_.SetTilingSize(tiling_size);
+ if (tiling_size.IsEmpty()) {
tiles_.clear();
return;
}
@@ -122,7 +122,8 @@ void LayerTilingData::SetTilingRect(const gfx::Rect& tiling_rect) {
// Any tiles completely outside our new bounds are invalid and should be
// dropped.
int left, top, right, bottom;
- ContentRectToTileIndices(tiling_rect, &left, &top, &right, &bottom);
+ ContentRectToTileIndices(
+ gfx::Rect(tiling_size), &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)