diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 00:09:27 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 00:09:27 +0000 |
commit | 8f95c562479b3be9776e77b597d72b464bb447a5 (patch) | |
tree | bb2e57273abf25f5bba3989aceb32c3bf3c6bb6b /cc/tiled_layer_unittest.cc | |
parent | a2b9b1d31541665ff0961c11c80684b73c597bd3 (diff) | |
download | chromium_src-8f95c562479b3be9776e77b597d72b464bb447a5.zip chromium_src-8f95c562479b3be9776e77b597d72b464bb447a5.tar.gz chromium_src-8f95c562479b3be9776e77b597d72b464bb447a5.tar.bz2 |
cc: Invalidate the full tiled layer when contents scale changes.
Previously we invalidated only the area outside of the previous
bounds, but this is incorrect when changing the scale.
The verifyInvalidationWhenContentsScaleChanges test was not actually
testing to make sure invalidation happened, so fixed the test to do
its job.
Tests:
TiledLayerTest.verifyInvalidationWhenContentsScaleChanges
BUG=166715
R=enne
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11644035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/tiled_layer_unittest.cc')
-rw-r--r-- | cc/tiled_layer_unittest.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc index 7fb252f..dd636ef 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(); |