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

Unified Diff: cc/base/tiling_data.h

Issue 2350563002: cc: Implement IndexRect for encapsulating tile indices. (Closed)
Patch Set: review comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/index_rect_unittest.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/tiling_data.h
diff --git a/cc/base/tiling_data.h b/cc/base/tiling_data.h
index 3c3937db81541378eb71cdae42ca419e07af0bf0..184f94705d7d968641dc94c19ac8ffb058b5b6c7 100644
--- a/cc/base/tiling_data.h
+++ b/cc/base/tiling_data.h
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "cc/base/cc_export.h"
+#include "cc/base/index_rect.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
@@ -95,9 +96,7 @@ class CC_EXPORT TilingData {
Iterator& operator++();
private:
- int left_;
- int right_;
- int bottom_;
+ IndexRect index_rect_;
};
class CC_EXPORT BaseDifferenceIterator : public BaseIterator {
@@ -108,23 +107,9 @@ class CC_EXPORT TilingData {
const gfx::Rect& ignore_rect);
bool HasConsiderRect() const;
- bool in_consider_rect() const {
- return index_x_ >= consider_left_ && index_x_ <= consider_right_ &&
- index_y_ >= consider_top_ && index_y_ <= consider_bottom_;
- }
- bool in_ignore_rect() const {
- return index_x_ >= ignore_left_ && index_x_ <= ignore_right_ &&
- index_y_ >= ignore_top_ && index_y_ <= ignore_bottom_;
- }
- int consider_left_;
- int consider_top_;
- int consider_right_;
- int consider_bottom_;
- int ignore_left_;
- int ignore_top_;
- int ignore_right_;
- int ignore_bottom_;
+ IndexRect consider_index_rect_;
+ IndexRect ignore_index_rect_;
};
// Iterate through all indices whose bounds (not including borders) intersect
@@ -151,13 +136,6 @@ class CC_EXPORT TilingData {
SpiralDifferenceIterator& operator++();
private:
- bool valid_column() const {
- return index_x_ >= consider_left_ && index_x_ <= consider_right_;
- }
- bool valid_row() const {
- return index_y_ >= consider_top_ && index_y_ <= consider_bottom_;
- }
-
int current_step_count() const {
return (direction_ == UP || direction_ == DOWN) ? vertical_step_count_
: horizontal_step_count_;
@@ -187,17 +165,6 @@ class CC_EXPORT TilingData {
ReverseSpiralDifferenceIterator& operator++();
private:
- bool in_around_rect() const {
- return index_x_ >= around_left_ && index_x_ <= around_right_ &&
- index_y_ >= around_top_ && index_y_ <= around_bottom_;
- }
- bool valid_column() const {
- return index_x_ >= consider_left_ && index_x_ <= consider_right_;
- }
- bool valid_row() const {
- return index_y_ >= consider_top_ && index_y_ <= consider_bottom_;
- }
-
int current_step_count() const {
return (direction_ == UP || direction_ == DOWN) ? vertical_step_count_
: horizontal_step_count_;
@@ -206,10 +173,7 @@ class CC_EXPORT TilingData {
bool needs_direction_switch() const;
void switch_direction();
- int around_left_;
- int around_top_;
- int around_right_;
- int around_bottom_;
+ IndexRect around_index_rect_;
enum Direction { LEFT, UP, RIGHT, DOWN };
« no previous file with comments | « cc/base/index_rect_unittest.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698