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

Unified Diff: cc/base/tiling_data.h

Issue 2067213002: cc: Implement tile iteration order based on pyramid sequence. [old] Base URL: https://chromium.googlesource.com/chromium/src.git@tiling_data_fix
Patch Set: for review Created 4 years, 5 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
Index: cc/base/tiling_data.h
diff --git a/cc/base/tiling_data.h b/cc/base/tiling_data.h
index 2e392ce3e74da10b5778cfced59f3a50e60ce95d..dfe3080a488afc867a85dea7d0a474aa73eab438 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/pyramid_sequence.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
@@ -52,6 +53,10 @@ class CC_EXPORT TilingData {
// Return the highest tile index whose border texels include src_position.
int LastBorderTileXIndexFromSrcCoord(int src_position) const;
int LastBorderTileYIndexFromSrcCoord(int src_position) const;
+ // Return the real tile index considering the tiling size to be infinite in
+ // all quadrants.
+ int TileRealXIndexFromSrcCoord(int src_position) const;
+ int TileRealYIndexFromSrcCoord(int src_position) const;
gfx::Rect ExpandRectIgnoringBordersToTileBounds(const gfx::Rect& rect) const;
gfx::Rect ExpandRectToTileBounds(const gfx::Rect& rect) const;
@@ -150,32 +155,17 @@ class CC_EXPORT TilingData {
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect,
const gfx::Rect& center_rect);
- 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_;
- }
+ SpiralDifferenceIterator(const SpiralDifferenceIterator& other);
+ SpiralDifferenceIterator(SpiralDifferenceIterator&& other);
+ ~SpiralDifferenceIterator();
- int current_step_count() const {
- return (direction_ == UP || direction_ == DOWN) ? vertical_step_count_
- : horizontal_step_count_;
- }
-
- bool needs_direction_switch() const;
- void switch_direction();
+ SpiralDifferenceIterator& operator=(const SpiralDifferenceIterator& other);
+ SpiralDifferenceIterator& operator=(SpiralDifferenceIterator&& other);
- enum Direction { UP, LEFT, DOWN, RIGHT };
+ SpiralDifferenceIterator& operator++();
- Direction direction_;
- int delta_x_;
- int delta_y_;
- int current_step_;
- int horizontal_step_count_;
- int vertical_step_count_;
+ private:
+ TopDownPyramidSequence pyramid_sequence_;
};
class CC_EXPORT ReverseSpiralDifferenceIterator
@@ -186,41 +176,20 @@ class CC_EXPORT TilingData {
const gfx::Rect& consider_rect,
const gfx::Rect& ignore_rect,
const gfx::Rect& center_rect);
- ReverseSpiralDifferenceIterator& operator++();
+ ReverseSpiralDifferenceIterator(
+ const ReverseSpiralDifferenceIterator& other);
+ ReverseSpiralDifferenceIterator(ReverseSpiralDifferenceIterator&& other);
+ ~ReverseSpiralDifferenceIterator();
- 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_;
- }
-
- bool needs_direction_switch() const;
- void switch_direction();
-
- int around_left_;
- int around_top_;
- int around_right_;
- int around_bottom_;
+ ReverseSpiralDifferenceIterator& operator=(
+ const ReverseSpiralDifferenceIterator& other);
+ ReverseSpiralDifferenceIterator& operator=(
+ ReverseSpiralDifferenceIterator&& other);
- enum Direction { LEFT, UP, RIGHT, DOWN };
+ ReverseSpiralDifferenceIterator& operator++();
- Direction direction_;
- int delta_x_;
- int delta_y_;
- int current_step_;
- int horizontal_step_count_;
- int vertical_step_count_;
+ private:
+ BottomUpPyramidSequence pyramid_sequence_;
};
private:

Powered by Google App Engine
This is Rietveld 408576698