OLD | NEW |
---|---|
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/tiling_data.h" | 5 #include "cc/tiling_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/gfx/vector2d.h" | 10 #include "ui/gfx/vector2d.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 int top = (!y_index || num_tiles_y_ == 1) ? 0 : border_texels_; | 249 int top = (!y_index || num_tiles_y_ == 1) ? 0 : border_texels_; |
250 | 250 |
251 return gfx::Vector2d(left, top); | 251 return gfx::Vector2d(left, top); |
252 } | 252 } |
253 | 253 |
254 void TilingData::RecomputeNumTiles() { | 254 void TilingData::RecomputeNumTiles() { |
255 num_tiles_x_ = ComputeNumTiles(max_texture_size_.width(), total_size_.width(), border_texels_); | 255 num_tiles_x_ = ComputeNumTiles(max_texture_size_.width(), total_size_.width(), border_texels_); |
256 num_tiles_y_ = ComputeNumTiles(max_texture_size_.height(), total_size_.height( ), border_texels_); | 256 num_tiles_y_ = ComputeNumTiles(max_texture_size_.height(), total_size_.height( ), border_texels_); |
257 } | 257 } |
258 | 258 |
259 gfx::Size TilingData::TileStride() const { | |
260 gfx::Size tile_grid_size = max_texture_size_; | |
261 tile_grid_size.Enlarge(- 2 * border_texels_, - 2 * border_texels_); | |
danakj
2013/02/11 17:12:46
Does the TileGrid assume border pixels are on the
| |
262 return tile_grid_size; | |
263 } | |
264 | |
259 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data) | 265 TilingData::BaseIterator::BaseIterator(const TilingData* tiling_data) |
260 : tiling_data_(tiling_data), | 266 : tiling_data_(tiling_data), |
261 index_x_(-1), | 267 index_x_(-1), |
262 index_y_(-1) { | 268 index_y_(-1) { |
263 } | 269 } |
264 | 270 |
265 TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect) | 271 TilingData::Iterator::Iterator(const TilingData* tiling_data, gfx::Rect rect) |
266 : BaseIterator(tiling_data), | 272 : BaseIterator(tiling_data), |
267 left_(-1), | 273 left_(-1), |
268 right_(-1), | 274 right_(-1), |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 } | 395 } |
390 | 396 |
391 if (index_y_ > consider_bottom_) | 397 if (index_y_ > consider_bottom_) |
392 done(); | 398 done(); |
393 } | 399 } |
394 | 400 |
395 return *this; | 401 return *this; |
396 } | 402 } |
397 | 403 |
398 } // namespace cc | 404 } // namespace cc |
OLD | NEW |