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

Unified Diff: cc/test/fake_picture_pile_impl.cc

Issue 196023015: Revert of cc: Replace recorded region with direct map lookup (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_picture_pile_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_picture_pile_impl.cc
diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc
index 4bcf4b094266de0bc9a48f10d787f79e0edfba5b..bb60034e9a069882e8381be7e2b295162f53d623 100644
--- a/cc/test/fake_picture_pile_impl.cc
+++ b/cc/test/fake_picture_pile_impl.cc
@@ -23,12 +23,11 @@
pile->tiling().SetTotalSize(layer_bounds);
pile->tiling().SetMaxTextureSize(tile_size);
pile->SetTileGridSize(ImplSidePaintingSettings().default_tile_size);
- pile->recorded_viewport_ = gfx::Rect(layer_bounds);
- pile->has_any_recordings_ = true;
for (int x = 0; x < pile->tiling().num_tiles_x(); ++x) {
for (int y = 0; y < pile->tiling().num_tiles_y(); ++y)
pile->AddRecordingAt(x, y);
}
+ pile->UpdateRecordedRegion();
return pile;
}
@@ -39,37 +38,29 @@
pile->tiling().SetTotalSize(layer_bounds);
pile->tiling().SetMaxTextureSize(tile_size);
pile->SetTileGridSize(ImplSidePaintingSettings().default_tile_size);
- pile->recorded_viewport_ = gfx::Rect();
- pile->has_any_recordings_ = false;
+ pile->UpdateRecordedRegion();
return pile;
}
scoped_refptr<FakePicturePileImpl>
-FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
+FakePicturePileImpl::CreatePileWithRecordedRegion(
const gfx::Size& tile_size,
- const gfx::Size& layer_bounds) {
+ const gfx::Size& layer_bounds,
+ const Region& recorded_region) {
scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl());
pile->tiling().SetTotalSize(layer_bounds);
pile->tiling().SetMaxTextureSize(tile_size);
pile->SetTileGridSize(ImplSidePaintingSettings().default_tile_size);
- // This simulates a false positive for this flag.
- pile->recorded_viewport_ = gfx::Rect();
- pile->has_any_recordings_ = true;
+ pile->SetRecordedRegionForTesting(recorded_region);
return pile;
}
-scoped_refptr<FakePicturePileImpl>
-FakePicturePileImpl::CreateInfiniteFilledPile() {
+scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreatePile() {
scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl());
gfx::Size size(std::numeric_limits<int>::max(),
std::numeric_limits<int>::max());
pile->Resize(size);
- pile->tiling().SetTotalSize(size);
- pile->tiling().SetMaxTextureSize(size);
- pile->SetTileGridSize(size);
- pile->recorded_viewport_ = gfx::Rect(size);
- pile->has_any_recordings_ = true;
- pile->AddRecordingAt(0, 0);
+ pile->recorded_region_ = Region(gfx::Rect(size));
return pile;
}
@@ -89,7 +80,7 @@
picture_map_[std::pair<int, int>(x, y)].SetPicture(picture);
EXPECT_TRUE(HasRecordingAt(x, y));
- has_any_recordings_ = true;
+ UpdateRecordedRegion();
}
void FakePicturePileImpl::RemoveRecordingAt(int x, int y) {
@@ -102,6 +93,8 @@
return;
picture_map_.erase(std::pair<int, int>(x, y));
EXPECT_FALSE(HasRecordingAt(x, y));
+
+ UpdateRecordedRegion();
}
void FakePicturePileImpl::RerecordPile() {
« no previous file with comments | « cc/test/fake_picture_pile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698