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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 all indices whose bounds + border intersect with |rect|. |
90 class CC_EXPORT Iterator : public BaseIterator { | 90 class CC_EXPORT Iterator : public BaseIterator { |
91 public: | 91 public: |
92 Iterator(const TilingData* tiling_data, gfx::Rect rect); | 92 Iterator(const TilingData* tiling_data, const gfx::Rect& tiling_rect); |
93 Iterator& operator++(); | 93 Iterator& operator++(); |
94 | 94 |
95 private: | 95 private: |
96 int left_; | 96 int left_; |
97 int right_; | 97 int right_; |
98 int bottom_; | 98 int bottom_; |
99 }; | 99 }; |
100 | 100 |
101 // Iterate through all indices whose bounds + border intersect with | 101 // Iterate through all indices whose bounds + border intersect with |
102 // |consider| but which also do not intersect with |ignore|. | 102 // |consider| but which also do not intersect with |ignore|. |
103 class CC_EXPORT DifferenceIterator : public BaseIterator { | 103 class CC_EXPORT DifferenceIterator : public BaseIterator { |
104 public: | 104 public: |
105 DifferenceIterator( | 105 DifferenceIterator( |
106 const TilingData* tiling_data, | 106 const TilingData* tiling_data, |
107 gfx::Rect consider, | 107 const gfx::Rect& consider_rect, |
108 gfx::Rect ignore); | 108 const gfx::Rect& ignore_rect); |
109 DifferenceIterator& operator++(); | 109 DifferenceIterator& operator++(); |
110 | 110 |
111 private: | 111 private: |
112 bool in_ignore_rect() const { | 112 bool in_ignore_rect() const { |
113 return index_x_ >= ignore_left_ && index_x_ <= ignore_right_ && | 113 return index_x_ >= ignore_left_ && index_x_ <= ignore_right_ && |
114 index_y_ >= ignore_top_ && index_y_ <= ignore_bottom_; | 114 index_y_ >= ignore_top_ && index_y_ <= ignore_bottom_; |
115 } | 115 } |
116 | 116 |
117 int consider_left_; | 117 int consider_left_; |
118 int consider_top_; | 118 int consider_top_; |
(...skipping 20 matching lines...) Expand all Loading... |
139 int border_texels_; | 139 int border_texels_; |
140 | 140 |
141 // These are computed values. | 141 // These are computed values. |
142 int num_tiles_x_; | 142 int num_tiles_x_; |
143 int num_tiles_y_; | 143 int num_tiles_y_; |
144 }; | 144 }; |
145 | 145 |
146 } // namespace cc | 146 } // namespace cc |
147 | 147 |
148 #endif // CC_BASE_TILING_DATA_H_ | 148 #endif // CC_BASE_TILING_DATA_H_ |
OLD | NEW |