Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: cc/base/tiling_data.h

Issue 183663003: cc: Add tiling raster tile iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/base/tiling_data.cc » ('j') | cc/base/tiling_data.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
92 Iterator(const TilingData* tiling_data, const gfx::Rect& tiling_rect); 93 Iterator(const TilingData* tiling_data, const gfx::Rect& tiling_rect);
93 Iterator& operator++(); 94 Iterator& operator++();
94 95
95 private: 96 private:
96 int left_; 97 int left_;
97 int right_; 98 int right_;
98 int bottom_; 99 int bottom_;
99 }; 100 };
100 101
101 // Iterate through all indices whose bounds + border intersect with 102 // Iterate through all indices whose bounds + border intersect with
(...skipping 20 matching lines...) Expand all
122 int ignore_top_; 123 int ignore_top_;
123 int ignore_right_; 124 int ignore_right_;
124 int ignore_bottom_; 125 int ignore_bottom_;
125 }; 126 };
126 127
127 // Iterate through all indices whose bounds + border intersect with 128 // Iterate through all indices whose bounds + border intersect with
128 // |consider| but which also do not intersect with |ignore|. The iterator 129 // |consider| but which also do not intersect with |ignore|. The iterator
129 // order is a counterclockwise spiral around the given center. 130 // order is a counterclockwise spiral around the given center.
130 class CC_EXPORT SpiralDifferenceIterator : public BaseIterator { 131 class CC_EXPORT SpiralDifferenceIterator : public BaseIterator {
131 public: 132 public:
133 SpiralDifferenceIterator();
132 SpiralDifferenceIterator(const TilingData* tiling_data, 134 SpiralDifferenceIterator(const TilingData* tiling_data,
133 const gfx::Rect& consider_rect, 135 const gfx::Rect& consider_rect,
134 const gfx::Rect& ignore_rect, 136 const gfx::Rect& ignore_rect,
135 const gfx::Rect& center_rect); 137 const gfx::Rect& center_rect);
136 SpiralDifferenceIterator& operator++(); 138 SpiralDifferenceIterator& operator++();
137 139
138 private: 140 private:
139 bool in_consider_rect() const { 141 bool in_consider_rect() const {
140 return index_x_ >= consider_left_ && index_x_ <= consider_right_ && 142 return index_x_ >= consider_left_ && index_x_ <= consider_right_ &&
141 index_y_ >= consider_top_ && index_y_ <= consider_bottom_; 143 index_y_ >= consider_top_ && index_y_ <= consider_bottom_;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 int border_texels_; 200 int border_texels_;
199 201
200 // These are computed values. 202 // These are computed values.
201 int num_tiles_x_; 203 int num_tiles_x_;
202 int num_tiles_y_; 204 int num_tiles_y_;
203 }; 205 };
204 206
205 } // namespace cc 207 } // namespace cc
206 208
207 #endif // CC_BASE_TILING_DATA_H_ 209 #endif // CC_BASE_TILING_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | cc/base/tiling_data.cc » ('j') | cc/base/tiling_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698