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

Unified Diff: Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

Issue 9697001: Merge 109263 - [chromium] Don't let invalidation for next frame prevent tile upload (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 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 | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (revision 110452)
+++ Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (working copy)
@@ -282,7 +282,103 @@
}
}
+TEST(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint)
+{
+ OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
+ RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+ FakeTextureAllocator textureAllocator;
+ CCTextureUpdater updater(&textureAllocator);
+
+ // The tile size is 100x100, so this invalidates and then paints two tiles.
+ // However, during the paint, we invalidate one of the tiles. This should
+ // not prevent the tile from being pushed.
+ layer->setBounds(IntSize(100, 200));
+ layer->invalidateRect(IntRect(0, 0, 100, 200));
+ layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get());
+ layer->prepareToUpdate(IntRect(0, 0, 100, 200));
+ layer->updateCompositorResources(0, updater);
+ layer->pushPropertiesTo(layerImpl.get());
+
+ // We should have both tiles on the impl side.
+ EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
+ EXPECT_TRUE(layerImpl->hasTileAt(0, 1));
+}
+
+TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer)
+{
+ OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
+ RefPtr<FakeTiledLayerChromium> layer1 = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ RefPtr<FakeTiledLayerChromium> layer2 = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTiledLayerImpl> layer1Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+ OwnPtr<FakeCCTiledLayerImpl> layer2Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+
+ FakeTextureAllocator textureAllocator;
+ CCTextureUpdater updater(&textureAllocator);
+
+ layer1->setBounds(IntSize(100, 200));
+ layer1->invalidateRect(IntRect(0, 0, 100, 200));
+ layer2->setBounds(IntSize(100, 200));
+ layer2->invalidateRect(IntRect(0, 0, 100, 200));
+
+ layer1->prepareToUpdate(IntRect(0, 0, 100, 200));
+
+ // Invalidate a tile on layer1
+ layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
+ layer2->prepareToUpdate(IntRect(0, 0, 100, 200));
+
+ layer1->updateCompositorResources(0, updater);
+ layer2->updateCompositorResources(0, updater);
+
+ layer1->pushPropertiesTo(layer1Impl.get());
+ layer2->pushPropertiesTo(layer2Impl.get());
+
+ // We should have both tiles on the impl side for all layers.
+ EXPECT_TRUE(layer1Impl->hasTileAt(0, 0));
+ EXPECT_TRUE(layer1Impl->hasTileAt(0, 1));
+ EXPECT_TRUE(layer2Impl->hasTileAt(0, 0));
+ EXPECT_TRUE(layer2Impl->hasTileAt(0, 1));
+}
+
+TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer)
+{
+ OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
+ RefPtr<FakeTiledLayerChromium> layer1 = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ RefPtr<FakeTiledLayerChromium> layer2 = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+ DebugScopedSetImplThread implThread;
+ OwnPtr<FakeCCTiledLayerImpl> layer1Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+ OwnPtr<FakeCCTiledLayerImpl> layer2Impl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+
+ FakeTextureAllocator textureAllocator;
+ CCTextureUpdater updater(&textureAllocator);
+
+ layer1->setBounds(IntSize(100, 200));
+ layer1->invalidateRect(IntRect(0, 0, 100, 200));
+ layer2->setBounds(IntSize(100, 200));
+ layer2->invalidateRect(IntRect(0, 0, 100, 200));
+
+ // Invalidate a tile on layer2
+ layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
+ layer1->prepareToUpdate(IntRect(0, 0, 100, 200));
+
+ layer2->prepareToUpdate(IntRect(0, 0, 100, 200));
+
+ layer1->updateCompositorResources(0, updater);
+ layer2->updateCompositorResources(0, updater);
+
+ layer1->pushPropertiesTo(layer1Impl.get());
+ layer2->pushPropertiesTo(layer2Impl.get());
+
+ // We should have both tiles on the impl side for all layers.
+ EXPECT_TRUE(layer1Impl->hasTileAt(0, 0));
+ EXPECT_TRUE(layer1Impl->hasTileAt(0, 1));
+ EXPECT_TRUE(layer2Impl->hasTileAt(0, 0));
+ EXPECT_TRUE(layer2Impl->hasTileAt(0, 1));
+}
+
TEST(TiledLayerChromiumTest, idlePaintOutOfMemory)
{
// The tile size is 100x100. Setup 5x5 tiles with one 1x1 visible tile in the center.
« no previous file with comments | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698