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

Unified Diff: cc/layers/picture_layer_impl_unittest.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/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 59bcfd97a457e876fc34bc6507d2d3798e11cd3e..e27a0e6f4ec532810bd4f6612fbaa8bf15600077 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -489,12 +489,10 @@ TEST_F(PictureLayerImplTest, AddTilesFromNewRecording) {
++iter) {
EXPECT_FALSE(iter.full_tile_geometry_rect().IsEmpty());
// Ensure there is a recording for this tile.
- gfx::Rect layer_rect = gfx::ScaleToEnclosingRect(
- iter.full_tile_geometry_rect(), 1.f / tiling->contents_scale());
- layer_rect.Intersect(gfx::Rect(layer_bounds));
-
- bool in_pending = pending_pile->recorded_region().Contains(layer_rect);
- bool in_active = active_pile->recorded_region().Contains(layer_rect);
+ bool in_pending = pending_pile->CanRaster(tiling->contents_scale(),
+ iter.full_tile_geometry_rect());
+ bool in_active = active_pile->CanRaster(tiling->contents_scale(),
+ iter.full_tile_geometry_rect());
if (in_pending && !in_active)
EXPECT_EQ(pending_pile, iter->picture_pile());
@@ -634,7 +632,7 @@ TEST_F(PictureLayerImplTest, CreateTilingsEvenIfTwinHasNone) {
gfx::Size layer_bounds(1300, 1900);
scoped_refptr<FakePicturePileImpl> empty_pile =
- FakePicturePileImpl::CreateFilledPile(tile_size, gfx::Size(1000, 0));
+ FakePicturePileImpl::CreateEmptyPile(tile_size, layer_bounds);
scoped_refptr<FakePicturePileImpl> valid_pile =
FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
@@ -1321,13 +1319,13 @@ TEST_F(PictureLayerImplTest, NothingRequiredIfActiveMissingTiles) {
gfx::Size tile_size(100, 100);
scoped_refptr<FakePicturePileImpl> pending_pile =
FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
- // An arbitrary bogus outside the layer recording. Enough for the layer to
- // think it can create tiles, but not in bounds so all tiles are null.
- Region active_recorded_region;
- active_recorded_region.Union(gfx::Rect(1000, 1000, 1, 1));
+ // This pile will create tilings, but has no recordings so will not create any
+ // tiles. This is attempting to simulate scrolling past the end of recorded
+ // content on the active layer, where the recordings are so far away that
+ // no tiles are created.
scoped_refptr<FakePicturePileImpl> active_pile =
- FakePicturePileImpl::CreatePileWithRecordedRegion(
- tile_size, layer_bounds, active_recorded_region);
+ FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings(
+ tile_size, layer_bounds);
SetupTrees(pending_pile, active_pile);
pending_layer_->set_fixed_tile_size(tile_size);
active_layer_->set_fixed_tile_size(tile_size);
@@ -1340,8 +1338,7 @@ TEST_F(PictureLayerImplTest, NothingRequiredIfActiveMissingTiles) {
EXPECT_EQ(active_layer_->HighResTiling()->AllTilesForTesting().size(), 0u);
// Since the active layer has no tiles at all, the pending layer doesn't
- // need content in order to activate. This is attempting to simulate
- // scrolling past the end of recorded content on the active layer.
+ // need content in order to activate.
pending_layer_->MarkVisibleResourcesAsRequired();
AssertNoTilesRequired(pending_layer_->HighResTiling());
AssertNoTilesRequired(pending_layer_->LowResTiling());
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698