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

Unified Diff: cc/test/fake_picture_pile_impl.cc

Issue 196343005: cc: Replace recorded region with direct map lookup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partial invalidation test case 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 bb60034e9a069882e8381be7e2b295162f53d623..4bcf4b094266de0bc9a48f10d787f79e0edfba5b 100644
--- a/cc/test/fake_picture_pile_impl.cc
+++ b/cc/test/fake_picture_pile_impl.cc
@@ -23,11 +23,12 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile(
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;
}
@@ -38,29 +39,37 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile(
pile->tiling().SetTotalSize(layer_bounds);
pile->tiling().SetMaxTextureSize(tile_size);
pile->SetTileGridSize(ImplSidePaintingSettings().default_tile_size);
- pile->UpdateRecordedRegion();
+ pile->recorded_viewport_ = gfx::Rect();
+ pile->has_any_recordings_ = false;
return pile;
}
scoped_refptr<FakePicturePileImpl>
-FakePicturePileImpl::CreatePileWithRecordedRegion(
+FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
const gfx::Size& tile_size,
- const gfx::Size& layer_bounds,
- const Region& recorded_region) {
+ const gfx::Size& layer_bounds) {
scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl());
pile->tiling().SetTotalSize(layer_bounds);
pile->tiling().SetMaxTextureSize(tile_size);
pile->SetTileGridSize(ImplSidePaintingSettings().default_tile_size);
- pile->SetRecordedRegionForTesting(recorded_region);
+ // This simulates a false positive for this flag.
+ pile->recorded_viewport_ = gfx::Rect();
+ pile->has_any_recordings_ = true;
return pile;
}
-scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreatePile() {
+scoped_refptr<FakePicturePileImpl>
+FakePicturePileImpl::CreateInfiniteFilledPile() {
scoped_refptr<FakePicturePileImpl> pile(new FakePicturePileImpl());
gfx::Size size(std::numeric_limits<int>::max(),
std::numeric_limits<int>::max());
pile->Resize(size);
- pile->recorded_region_ = Region(gfx::Rect(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);
return pile;
}
@@ -80,7 +89,7 @@ void FakePicturePileImpl::AddRecordingAt(int x, int y) {
picture_map_[std::pair<int, int>(x, y)].SetPicture(picture);
EXPECT_TRUE(HasRecordingAt(x, y));
- UpdateRecordedRegion();
+ has_any_recordings_ = true;
}
void FakePicturePileImpl::RemoveRecordingAt(int x, int y) {
@@ -93,8 +102,6 @@ void FakePicturePileImpl::RemoveRecordingAt(int x, int y) {
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