| 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_TILING_DATA_H_ | 5 #ifndef CC_TILING_DATA_H_ |
| 6 #define CC_TILING_DATA_H_ | 6 #define CC_TILING_DATA_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/cc_export.h" | 10 #include "cc/cc_export.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 TilingData( | 27 TilingData( |
| 28 gfx::Size max_texture_size, | 28 gfx::Size max_texture_size, |
| 29 gfx::Size total_size, | 29 gfx::Size total_size, |
| 30 int border_texels); | 30 int border_texels); |
| 31 | 31 |
| 32 gfx::Size total_size() const { return total_size_; } | 32 gfx::Size total_size() const { return total_size_; } |
| 33 void SetTotalSize(const gfx::Size total_size); | 33 void SetTotalSize(const gfx::Size total_size); |
| 34 | 34 |
| 35 gfx::Size max_texture_size() const { return max_texture_size_; } | 35 gfx::Size max_texture_size() const { return max_texture_size_; } |
| 36 void SetMaxTextureSize(gfx::Size max_texture_size); | 36 void SetMaxTextureSize(gfx::Size max_texture_size); |
| 37 gfx::Size InnerTileSize() const { return inner_tile_size_; } |
| 37 | 38 |
| 38 int border_texels() const { return border_texels_; } | 39 int border_texels() const { return border_texels_; } |
| 39 void SetHasBorderTexels(bool has_border_texels); | 40 void SetHasBorderTexels(bool has_border_texels); |
| 40 void SetBorderTexels(int border_texels); | 41 void SetBorderTexels(int border_texels); |
| 41 | 42 |
| 42 bool has_empty_bounds() const { return !num_tiles_x_ || !num_tiles_y_; } | 43 bool has_empty_bounds() const { return !num_tiles_x_ || !num_tiles_y_; } |
| 43 int num_tiles_x() const { return num_tiles_x_; } | 44 int num_tiles_x() const { return num_tiles_x_; } |
| 44 int num_tiles_y() const { return num_tiles_y_; } | 45 int num_tiles_y() const { return num_tiles_y_; } |
| 45 // Return the tile index whose non-border texels include src_position. | 46 // Return the tile index whose non-border texels include src_position. |
| 46 int TileXIndexFromSrcCoord(int src_position) const; | 47 int TileXIndexFromSrcCoord(int src_position) const; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void AssertTile(int i, int j) const { | 124 void AssertTile(int i, int j) const { |
| 124 DCHECK_GE(i, 0); | 125 DCHECK_GE(i, 0); |
| 125 DCHECK_LT(i, num_tiles_x_); | 126 DCHECK_LT(i, num_tiles_x_); |
| 126 DCHECK_GE(j, 0); | 127 DCHECK_GE(j, 0); |
| 127 DCHECK_LT(j, num_tiles_y_); | 128 DCHECK_LT(j, num_tiles_y_); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void RecomputeNumTiles(); | 131 void RecomputeNumTiles(); |
| 131 | 132 |
| 132 gfx::Size max_texture_size_; | 133 gfx::Size max_texture_size_; |
| 134 gfx::Size inner_tile_size_; |
| 133 gfx::Size total_size_; | 135 gfx::Size total_size_; |
| 134 int border_texels_; | 136 int border_texels_; |
| 135 | 137 |
| 136 // These are computed values. | 138 // These are computed values. |
| 137 int num_tiles_x_; | 139 int num_tiles_x_; |
| 138 int num_tiles_y_; | 140 int num_tiles_y_; |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 } // namespace cc | 143 } // namespace cc |
| 142 | 144 |
| 143 #endif // CC_TILING_DATA_H_ | 145 #endif // CC_TILING_DATA_H_ |
| OLD | NEW |