| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void done() { | 79 void done() { |
| 80 index_x_ = -1; | 80 index_x_ = -1; |
| 81 index_y_ = -1; | 81 index_y_ = -1; |
| 82 } | 82 } |
| 83 | 83 |
| 84 const TilingData* tiling_data_; | 84 const TilingData* tiling_data_; |
| 85 int index_x_; | 85 int index_x_; |
| 86 int index_y_; | 86 int index_y_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // Iterate through all indices whose bounds + border intersect with |rect|. | 89 // Iterate through tiles whose bounds + optional border intersect with |rect|. |
| 90 class CC_EXPORT Iterator : public BaseIterator { | 90 class CC_EXPORT Iterator : public BaseIterator { |
| 91 public: | 91 public: |
| 92 Iterator(); | 92 Iterator(); |
| 93 Iterator(const TilingData* tiling_data, const gfx::Rect& tiling_rect); | 93 Iterator(const TilingData* tiling_data, |
| 94 const gfx::Rect& tiling_rect, |
| 95 bool include_borders); |
| 94 Iterator& operator++(); | 96 Iterator& operator++(); |
| 95 | 97 |
| 96 private: | 98 private: |
| 97 int left_; | 99 int left_; |
| 98 int right_; | 100 int right_; |
| 99 int bottom_; | 101 int bottom_; |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 // Iterate through all indices whose bounds + border intersect with | 104 // Iterate through all indices whose bounds + border intersect with |
| 103 // |consider| but which also do not intersect with |ignore|. | 105 // |consider| but which also do not intersect with |ignore|. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 int border_texels_; | 197 int border_texels_; |
| 196 | 198 |
| 197 // These are computed values. | 199 // These are computed values. |
| 198 int num_tiles_x_; | 200 int num_tiles_x_; |
| 199 int num_tiles_y_; | 201 int num_tiles_y_; |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace cc | 204 } // namespace cc |
| 203 | 205 |
| 204 #endif // CC_BASE_TILING_DATA_H_ | 206 #endif // CC_BASE_TILING_DATA_H_ |
| OLD | NEW |