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

Unified Diff: cc/base/tiling_data.cc

Issue 294163009: cc: Expand invalidation to full tile when recording is missing for the tile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pictureslow: complicated. Created 6 years, 6 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.cc
diff --git a/cc/base/tiling_data.cc b/cc/base/tiling_data.cc
index a52c940767634396090d94e3fb0fc9be72e1bd82..66d4b7551e2af21c5dd18b8e36bc562479882133 100644
--- a/cc/base/tiling_data.cc
+++ b/cc/base/tiling_data.cc
@@ -139,7 +139,7 @@ int TilingData::LastBorderTileYIndexFromSrcCoord(int src_position) const {
}
gfx::Rect TilingData::ExpandRectToTileBoundsWithBorders(
- const gfx::Rect rect) const {
+ const gfx::Rect& rect) const {
enne (OOO) 2014/06/17 00:02:54 OOPS. Thanks!
if (!rect.Intersects(tiling_rect_) || has_empty_bounds())
return gfx::Rect();
int index_x = FirstBorderTileXIndexFromSrcCoord(rect.x());
@@ -150,9 +150,21 @@ gfx::Rect TilingData::ExpandRectToTileBoundsWithBorders(
gfx::Rect rect_top_left(TileBoundsWithBorder(index_x, index_y));
gfx::Rect rect_bottom_right(TileBoundsWithBorder(index_right, index_bottom));
- gfx::Rect expanded(rect_top_left);
- expanded.Union(rect_bottom_right);
- return expanded;
+ return gfx::UnionRects(rect_top_left, rect_bottom_right);
+}
+
+gfx::Rect TilingData::ExpandRectToTileBounds(const gfx::Rect& rect) const {
+ if (!rect.Intersects(tiling_rect_) || has_empty_bounds())
+ return gfx::Rect();
+ int index_x = FirstBorderTileXIndexFromSrcCoord(rect.x());
+ int index_y = FirstBorderTileYIndexFromSrcCoord(rect.y());
+ int index_right = LastBorderTileXIndexFromSrcCoord(rect.right());
enne (OOO) 2014/06/17 00:02:54 What happened to your "I need a -1 here" thought?
danakj 2014/06/17 18:51:34 Was going to fix both in a separate CL, but I've g
+ int index_bottom = LastBorderTileYIndexFromSrcCoord(rect.bottom());
+
+ gfx::Rect rect_top_left(TileBounds(index_x, index_y));
+ gfx::Rect rect_bottom_right(TileBounds(index_right, index_bottom));
+
+ return gfx::UnionRects(rect_top_left, rect_bottom_right);
}
gfx::Rect TilingData::TileBounds(int i, int j) const {
« no previous file with comments | « cc/base/tiling_data.h ('k') | cc/layers/picture_layer.cc » ('j') | cc/resources/picture_pile.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698