| 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 #ifndef CC_BASE_TILING_DATA_H_ | 5 #ifndef CC_BASE_TILING_DATA_H_ |
| 6 #define CC_BASE_TILING_DATA_H_ | 6 #define CC_BASE_TILING_DATA_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class RectF; |
| 16 class Vector2d; | 17 class Vector2d; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 | 21 |
| 21 class CC_EXPORT TilingData { | 22 class CC_EXPORT TilingData { |
| 22 public: | 23 public: |
| 23 TilingData(); | 24 TilingData(); |
| 24 TilingData(const gfx::Size& max_texture_size, | 25 TilingData(const gfx::Size& max_texture_size, |
| 25 const gfx::Size& tiling_size, | 26 const gfx::Size& tiling_size, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 54 gfx::Rect ExpandRectIgnoringBordersToTileBounds(const gfx::Rect& rect) const; | 55 gfx::Rect ExpandRectIgnoringBordersToTileBounds(const gfx::Rect& rect) const; |
| 55 gfx::Rect ExpandRectToTileBounds(const gfx::Rect& rect) const; | 56 gfx::Rect ExpandRectToTileBounds(const gfx::Rect& rect) const; |
| 56 | 57 |
| 57 gfx::Rect TileBounds(int i, int j) const; | 58 gfx::Rect TileBounds(int i, int j) const; |
| 58 gfx::Rect TileBoundsWithBorder(int i, int j) const; | 59 gfx::Rect TileBoundsWithBorder(int i, int j) const; |
| 59 int TilePositionX(int x_index) const; | 60 int TilePositionX(int x_index) const; |
| 60 int TilePositionY(int y_index) const; | 61 int TilePositionY(int y_index) const; |
| 61 int TileSizeX(int x_index) const; | 62 int TileSizeX(int x_index) const; |
| 62 int TileSizeY(int y_index) const; | 63 int TileSizeY(int y_index) const; |
| 63 | 64 |
| 65 gfx::RectF TexelExtent(int i, int j) const; |
| 66 |
| 64 // Difference between TileBound's and TileBoundWithBorder's origin(). | 67 // Difference between TileBound's and TileBoundWithBorder's origin(). |
| 65 gfx::Vector2d TextureOffset(int x_index, int y_index) const; | 68 gfx::Vector2d TextureOffset(int x_index, int y_index) const; |
| 66 | 69 |
| 67 class CC_EXPORT BaseIterator { | 70 class CC_EXPORT BaseIterator { |
| 68 public: | 71 public: |
| 69 operator bool() const { return index_x_ != -1 && index_y_ != -1; } | 72 operator bool() const { return index_x_ != -1 && index_y_ != -1; } |
| 70 | 73 |
| 71 int index_x() const { return index_x_; } | 74 int index_x() const { return index_x_; } |
| 72 int index_y() const { return index_y_; } | 75 int index_y() const { return index_y_; } |
| 73 std::pair<int, int> index() const { | 76 std::pair<int, int> index() const { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 int border_texels_; | 239 int border_texels_; |
| 237 | 240 |
| 238 // These are computed values. | 241 // These are computed values. |
| 239 int num_tiles_x_; | 242 int num_tiles_x_; |
| 240 int num_tiles_y_; | 243 int num_tiles_y_; |
| 241 }; | 244 }; |
| 242 | 245 |
| 243 } // namespace cc | 246 } // namespace cc |
| 244 | 247 |
| 245 #endif // CC_BASE_TILING_DATA_H_ | 248 #endif // CC_BASE_TILING_DATA_H_ |
| OLD | NEW |