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

Unified Diff: cc/tiled_layer_unittest.cc

Issue 11644035: cc: Invalidate the full tiled layer when contents scale changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« cc/tiled_layer.cc ('K') | « cc/tiled_layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiled_layer_unittest.cc
diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc
index 7fb252f0013f0218a0c97d749dd220e93990a738..dd636ef60f915512ea4411a20e43b4f52ab43841 100644
--- a/cc/tiled_layer_unittest.cc
+++ b/cc/tiled_layer_unittest.cc
@@ -788,11 +788,12 @@ TEST_F(TiledLayerTest, verifyInvalidationWhenContentsScaleChanges)
EXPECT_FALSE(layerImpl->hasResourceIdForTileAt(1, 0));
EXPECT_FALSE(layerImpl->hasResourceIdForTileAt(1, 1));
- // Change the contents scale and verify that the content rectangle requiring painting
- // is not scaled.
+ layer->setNeedsDisplayRect(gfx::Rect());
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(), layer->lastNeedsDisplayRect());
+
+ // Change the contents scale.
layer->updateContentsScale(2);
layer->drawProperties().visible_content_rect = gfx::Rect(0, 0, 200, 200);
- EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 100, 100), layer->lastNeedsDisplayRect());
// The impl side should get 2x2 tiles now.
layer->setTexturePriorities(m_priorityCalculator);
@@ -805,6 +806,10 @@ TEST_F(TiledLayerTest, verifyInvalidationWhenContentsScaleChanges)
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(1, 0));
EXPECT_TRUE(layerImpl->hasResourceIdForTileAt(1, 1));
+ // Verify that changing the contents scale caused invalidation, and
+ // that the layer-space rectangle requiring painting is not scaled.
+ EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 100, 100), layer->lastNeedsDisplayRect());
+
// Invalidate the entire layer again, but do not paint. All tiles should be gone now from the
// impl side.
layer->setNeedsDisplay();
« cc/tiled_layer.cc ('K') | « cc/tiled_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698