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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 int border_texels() const { return border_texels_; } | 40 int border_texels() const { return border_texels_; } |
41 void SetHasBorderTexels(bool has_border_texels); | 41 void SetHasBorderTexels(bool has_border_texels); |
42 void SetBorderTexels(int border_texels); | 42 void SetBorderTexels(int border_texels); |
43 | 43 |
44 bool has_empty_bounds() const { return !num_tiles_x_ || !num_tiles_y_; } | 44 bool has_empty_bounds() const { return !num_tiles_x_ || !num_tiles_y_; } |
45 int num_tiles_x() const { return num_tiles_x_; } | 45 int num_tiles_x() const { return num_tiles_x_; } |
46 int num_tiles_y() const { return num_tiles_y_; } | 46 int num_tiles_y() const { return num_tiles_y_; } |
47 // Return the tile index whose non-border texels include src_position. | 47 // Return the tile index whose non-border texels include src_position. |
48 int TileXIndexFromSrcCoord(int src_position) const; | 48 int TileXIndexFromSrcCoord(int src_position) const; |
49 int TileYIndexFromSrcCoord(int src_position) const; | 49 int TileYIndexFromSrcCoord(int src_position) const; |
| 50 // Return the absolute tile index, assuming tiling size to be infinite in all |
| 51 // quadrants. |
| 52 int TileAbsoluteXIndexFromSrcCoord(int src_position) const; |
| 53 int TileAbsoluteYIndexFromSrcCoord(int src_position) const; |
50 // Return the lowest tile index whose border texels include src_position. | 54 // Return the lowest tile index whose border texels include src_position. |
51 int FirstBorderTileXIndexFromSrcCoord(int src_position) const; | 55 int FirstBorderTileXIndexFromSrcCoord(int src_position) const; |
52 int FirstBorderTileYIndexFromSrcCoord(int src_position) const; | 56 int FirstBorderTileYIndexFromSrcCoord(int src_position) const; |
53 // Return the highest tile index whose border texels include src_position. | 57 // Return the highest tile index whose border texels include src_position. |
54 int LastBorderTileXIndexFromSrcCoord(int src_position) const; | 58 int LastBorderTileXIndexFromSrcCoord(int src_position) const; |
55 int LastBorderTileYIndexFromSrcCoord(int src_position) const; | 59 int LastBorderTileYIndexFromSrcCoord(int src_position) const; |
56 // Return the tile indices around the given rect. | 60 // Return the tile indices around the given rect. |
57 IndexRect TileAroundIndexRect(const gfx::Rect& center_rect) const; | 61 IndexRect TileAroundIndexRect(const gfx::Rect& center_rect) const; |
58 | 62 |
59 gfx::Rect ExpandRectIgnoringBordersToTileBounds(const gfx::Rect& rect) const; | 63 gfx::Rect ExpandRectIgnoringBordersToTileBounds(const gfx::Rect& rect) const; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 int border_texels_; | 176 int border_texels_; |
173 | 177 |
174 // These are computed values. | 178 // These are computed values. |
175 int num_tiles_x_; | 179 int num_tiles_x_; |
176 int num_tiles_y_; | 180 int num_tiles_y_; |
177 }; | 181 }; |
178 | 182 |
179 } // namespace cc | 183 } // namespace cc |
180 | 184 |
181 #endif // CC_BASE_TILING_DATA_H_ | 185 #endif // CC_BASE_TILING_DATA_H_ |
OLD | NEW |