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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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
« no previous file with comments | « cc/base/region.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »
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(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
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_
OLDNEW
« no previous file with comments | « cc/base/region.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698