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..106847b2043cb62e2dc684d78e8517ee7f8f9295 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::CreateEmptyPileThatThinksItHasTiles( |
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() { |