diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp | 209 |
1 files changed, 117 insertions, 92 deletions
diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp index e39fe7e56..bab7168c4 100644 --- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp @@ -33,11 +33,12 @@ #include "FakeCCGraphicsContext.h" #include "FakeCCLayerTreeHostClient.h" #include "LayerPainterChromium.h" -#include "WebCompositor.h" #include "cc/CCOverdrawMetrics.h" #include "cc/CCRenderingStats.h" #include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread +#include "cc/CCTextureUpdateController.h" #include <gtest/gtest.h> +#include <public/WebCompositor.h> #include <public/WebTransformationMatrix.h> using namespace WebCore; @@ -57,7 +58,7 @@ class TestCCOcclusionTracker : public CCOcclusionTracker { public: TestCCOcclusionTracker() : CCOcclusionTracker(IntRect(0, 0, 1000, 1000), true) - , m_scissorRectInScreen(IntRect(0, 0, 1000, 1000)) + , m_layerClipRectInTarget(IntRect(0, 0, 1000, 1000)) { // Pretend we have visited a render surface. m_stack.append(StackObject()); @@ -66,10 +67,10 @@ public: void setOcclusion(const Region& occlusion) { m_stack.last().occlusionInScreen = occlusion; } protected: - virtual IntRect layerScissorRectInTargetSurface(const LayerChromium* layer) const { return m_scissorRectInScreen; } + virtual IntRect layerClipRectInTarget(const LayerChromium* layer) const OVERRIDE { return m_layerClipRectInTarget; } private: - IntRect m_scissorRectInScreen; + IntRect m_layerClipRectInTarget; }; class TiledLayerChromiumTest : public testing::Test { @@ -89,12 +90,12 @@ public: void updateTextures(int count = 500) { - m_updater.update(m_resourceProvider.get(), &m_copier, &m_uploader, count); + CCTextureUpdateController::updateTextures(m_resourceProvider.get(), &m_copier, &m_uploader, &m_queue, count); } public: OwnPtr<CCGraphicsContext> m_context; OwnPtr<CCResourceProvider> m_resourceProvider; - CCTextureUpdater m_updater; + CCTextureUpdateQueue m_queue; CCRenderingStats m_stats; FakeTextureCopier m_copier; FakeTextureUploader m_uploader; @@ -118,7 +119,7 @@ TEST_F(TiledLayerChromiumTest, pushDirtyTiles) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -131,7 +132,7 @@ TEST_F(TiledLayerChromiumTest, pushDirtyTiles) // ....but then only update one of them. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 100), 0, m_stats); layer->pushPropertiesTo(layerImpl.get()); // We should only have the first tile since the other tile was invalidated but not painted. @@ -149,13 +150,14 @@ TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles) // The tile size is 100x100, so this invalidates and then paints two tiles. layer->setBounds(IntSize(100, 200)); + layer->setDrawableContentRect(IntRect(0, 0, 100, 200)); layer->setVisibleContentRect(IntRect(0, 0, 100, 200)); layer->invalidateContentRect(IntRect(0, 0, 100, 200)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), &occluded, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -171,7 +173,7 @@ TEST_F(TiledLayerChromiumTest, pushOccludedDirtyTiles) layer->invalidateContentRect(IntRect(0, 0, 50, 50)); // ....but the area is occluded. occluded.setOcclusion(IntRect(0, 0, 50, 50)); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 100), &occluded, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -199,7 +201,7 @@ TEST_F(TiledLayerChromiumTest, pushDeletedTiles) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -221,7 +223,7 @@ TEST_F(TiledLayerChromiumTest, pushDeletedTiles) // This should recreate and update the deleted textures. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 100), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -250,7 +252,7 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); updateTextures(); // We should need idle-painting for 3x3 tiles in the center. @@ -266,7 +268,7 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintTiles) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); EXPECT_TRUE(layer->needsIdlePaint(visibleRect)); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -317,8 +319,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) layer2->setTexturePriorities(m_priorityCalculator); layer1->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer1->updateContentRect(m_updater, layerRect, 0, m_stats); - layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats); + layer1->updateContentRect(m_queue, layerRect, 0, m_stats); + layer2->updateContentRect(m_queue, IntRect(0, 0, 100, 100), 0, m_stats); // We should need idle-painting for both remaining tiles in layer2. EXPECT_TRUE(layer2->needsIdlePaint(layer2Rect)); @@ -335,7 +337,7 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) layer2->setTexturePriorities(m_priorityCalculator); layer1->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats); + layer2->updateContentRect(m_queue, IntRect(0, 0, 100, 100), 0, m_stats); // Oh well, commit the frame and push. updateTextures(); @@ -355,8 +357,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesAfterIdlePaintFailed) layer2->setTexturePriorities(m_priorityCalculator); layer1->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer2->updateContentRect(m_updater, layer2Rect, 0, m_stats); - layer1->updateContentRect(m_updater, layerRect, 0, m_stats); + layer2->updateContentRect(m_queue, layer2Rect, 0, m_stats); + layer1->updateContentRect(m_queue, layerRect, 0, m_stats); updateTextures(); layer1->pushPropertiesTo(layerImpl1.get()); @@ -387,7 +389,7 @@ TEST_F(TiledLayerChromiumTest, pushIdlePaintedOccludedTiles) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 100), &occluded, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -412,7 +414,7 @@ TEST_F(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -442,11 +444,11 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer) layer2->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer1->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); // Invalidate a tile on layer1 layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get()); - layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer2->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(); layer1->pushPropertiesTo(layer1Impl.get()); @@ -482,8 +484,8 @@ TEST_F(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLay // Invalidate a tile on layer2 layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get()); - layer1->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); - layer2->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer1->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); + layer2->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(); layer1->pushPropertiesTo(layer1Impl.get()); layer2->pushPropertiesTo(layer2Impl.get()); @@ -517,7 +519,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); // Idle-painting should see no more priority tiles for painting. EXPECT_FALSE(layer->needsIdlePaint(visibleRect)); @@ -530,7 +532,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintOutOfMemory) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); // We shouldn't signal we need another idle paint. EXPECT_FALSE(layer->needsIdlePaint(visibleRect)); @@ -559,7 +561,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintZeroSizedLayer) textureManager->prioritizeTextures(); // Empty layers don't paint or idle-paint. - layer->updateContentRect(m_updater, contentRect, 0, m_stats); + layer->updateContentRect(m_queue, contentRect, 0, m_stats); // Empty layers don't have tiles. EXPECT_EQ(0u, layer->numPaintedTiles()); @@ -595,7 +597,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleLayers) // Paint / idle-paint. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); // Non-visible layers don't need idle paint. EXPECT_FALSE(layer->needsIdlePaint(visibleRect)); @@ -658,7 +660,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); } @@ -671,7 +673,7 @@ TEST_F(TiledLayerChromiumTest, idlePaintNonVisibleAnimatingLayers) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, visibleRect, 0, m_stats); + layer->updateContentRect(m_queue, visibleRect, 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); } @@ -694,7 +696,7 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare) layer->invalidateContentRect(IntRect(0, 0, 100, 200)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(1000); layer->pushPropertiesTo(layerImpl.get()); @@ -705,7 +707,7 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare) layer->fakeLayerTextureUpdater()->clearPrepareCount(); // Invoke updateContentRect again. As the layer is valid updateContentRect shouldn't be invoked on // the LayerTextureUpdater. - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(1000); EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount()); @@ -713,12 +715,12 @@ TEST_F(TiledLayerChromiumTest, invalidateFromPrepare) // setRectToInvalidate triggers invalidateContentRect() being invoked from updateContentRect. layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get()); layer->fakeLayerTextureUpdater()->clearPrepareCount(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(1000); EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); layer->fakeLayerTextureUpdater()->clearPrepareCount(); // The layer should still be invalid as updateContentRect invoked invalidate. - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); updateTextures(1000); EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount()); } @@ -745,7 +747,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, contentBounds, 0, m_stats); + layer->updateContentRect(m_queue, contentBounds, 0, m_stats); EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect()); updateTextures(); @@ -753,7 +755,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); layer->invalidateContentRect(contentBounds); - layer->updateContentRect(m_updater, contentBounds, 0, m_stats); + layer->updateContentRect(m_queue, contentBounds, 0, m_stats); EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect()); updateTextures(); @@ -762,7 +764,7 @@ TEST_F(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled) layer->invalidateContentRect(partialDamage); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, contentBounds, 0, m_stats); + layer->updateContentRect(m_queue, contentBounds, 0, m_stats); EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect()); } @@ -784,7 +786,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges) // Push the tiles to the impl side and check that there is exactly one. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 100), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 100), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); EXPECT_TRUE(layerImpl->hasTileAt(0, 0)); @@ -801,7 +803,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges) // The impl side should get 2x2 tiles now. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 200, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 200, 200), 0, m_stats); updateTextures(); layer->pushPropertiesTo(layerImpl.get()); EXPECT_TRUE(layerImpl->hasTileAt(0, 0)); @@ -813,7 +815,7 @@ TEST_F(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges) // impl side. layer->setNeedsDisplay(); layer->setTexturePriorities(m_priorityCalculator); - layer->updateContentRect(m_updater, IntRect(1, 0, 0, 1), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(1, 0, 0, 1), 0, m_stats); textureManager->prioritizeTextures(); layer->pushPropertiesTo(layerImpl.get()); @@ -852,9 +854,9 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) childLayer->invalidateContentRect(contentRect); ccLayerTreeHost->setRootLayer(rootLayer); - ccLayerTreeHost->setViewportSize(IntSize(300, 300)); + ccLayerTreeHost->setViewportSize(IntSize(300, 300), IntSize(300, 300)); - ccLayerTreeHost->updateLayers(m_updater, memoryLimit); + ccLayerTreeHost->updateLayers(m_queue, memoryLimit); // We'll skip the root layer. EXPECT_TRUE(rootLayer->skipsDraw()); @@ -865,7 +867,7 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) // Remove the child layer. rootLayer->removeAllChildren(); - ccLayerTreeHost->updateLayers(m_updater, memoryLimit); + ccLayerTreeHost->updateLayers(m_queue, memoryLimit); EXPECT_FALSE(rootLayer->skipsDraw()); ccLayerTreeHost->contentsTextureManager()->clearAllMemory(m_resourceProvider.get()); @@ -885,7 +887,7 @@ TEST_F(TiledLayerChromiumTest, resizeToSmaller) layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 700, 700), 0, m_stats); layer->setBounds(IntSize(200, 200)); layer->invalidateContentRect(IntRect(0, 0, 200, 200)); @@ -904,7 +906,7 @@ TEST_F(TiledLayerChromiumTest, hugeLayerUpdateCrash) // Ensure no crash for bounds where size * size would overflow an int. layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 700, 700), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 700, 700), 0, m_stats); } TEST_F(TiledLayerChromiumTest, partialUpdates) @@ -930,20 +932,20 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) layer->invalidateContentRect(contentRect); ccLayerTreeHost->setRootLayer(layer); - ccLayerTreeHost->setViewportSize(IntSize(300, 200)); + ccLayerTreeHost->setViewportSize(IntSize(300, 200), IntSize(300, 200)); // Full update of all 6 tiles. - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1))); updateTextures(4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_TRUE(m_updater.hasMoreUpdates()); + EXPECT_TRUE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); updateTextures(4); EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); layer->pushPropertiesTo(layerImpl.get()); } @@ -951,17 +953,17 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) // Full update of 3 tiles and partial update of 3 tiles. layer->invalidateContentRect(IntRect(0, 0, 300, 150)); - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1))); updateTextures(4); EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_TRUE(m_updater.hasMoreUpdates()); + EXPECT_TRUE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); updateTextures(4); EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); layer->pushPropertiesTo(layerImpl.get()); } @@ -972,14 +974,14 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1))); - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); updateTextures(4); EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_TRUE(m_updater.hasMoreUpdates()); + EXPECT_TRUE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); updateTextures(4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); layer->pushPropertiesTo(layerImpl.get()); } @@ -999,14 +1001,14 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1))); - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); updateTextures(4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_TRUE(m_updater.hasMoreUpdates()); + EXPECT_TRUE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); updateTextures(4); EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); layer->pushPropertiesTo(layerImpl.get()); } @@ -1017,10 +1019,10 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(1))); - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); updateTextures(4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); layer->fakeLayerTextureUpdater()->clearUpdateCount(); layer->pushPropertiesTo(layerImpl.get()); } @@ -1042,12 +1044,13 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithoutOcclusion) // The tile size is 100x100, so this invalidates and then paints two tiles. layer->setBounds(IntSize(100, 200)); + layer->setDrawableContentRect(IntRect(0, 0, 100, 200)); layer->setVisibleContentRect(IntRect(0, 0, 100, 200)); layer->invalidateContentRect(IntRect(0, 0, 100, 200)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 100, 200), 0, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 100, 200), 0, m_stats); EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount()); } @@ -1062,12 +1065,13 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion) layer->setBounds(IntSize(600, 600)); occluded.setOcclusion(IntRect(200, 200, 300, 100)); + layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1075,10 +1079,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion) EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload()); layer->fakeLayerTextureUpdater()->clearPrepareRectCount(); + layer->setTexturePriorities(m_priorityCalculator); + textureManager->prioritizeTextures(); occluded.setOcclusion(IntRect(250, 200, 300, 100)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1086,10 +1092,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusion) EXPECT_EQ(3 + 2, occluded.overdrawMetrics().tilesCulledForUpload()); layer->fakeLayerTextureUpdater()->clearPrepareRectCount(); + layer->setTexturePriorities(m_priorityCalculator); + textureManager->prioritizeTextures(); occluded.setOcclusion(IntRect(250, 250, 300, 100)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1109,12 +1117,13 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints) // The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled. occluded.setOcclusion(IntRect(200, 200, 300, 150)); + layer->setDrawableContentRect(IntRect(0, 0, 600, 360)); layer->setVisibleContentRect(IntRect(0, 0, 600, 360)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 360), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 360), &occluded, m_stats); EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1125,11 +1134,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints) // Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded. occluded.setOcclusion(IntRect(200, 200, 300, 150)); + layer->setDrawableContentRect(IntRect(0, 0, 600, 350)); layer->setVisibleContentRect(IntRect(0, 0, 600, 350)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 350), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 350), &occluded, m_stats); EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1140,11 +1150,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints) // Now the visible region is even smaller than the occlusion, it should have the same result. occluded.setOcclusion(IntRect(200, 200, 300, 150)); + layer->setDrawableContentRect(IntRect(0, 0, 600, 340)); layer->setVisibleContentRect(IntRect(0, 0, 600, 340)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 340), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 340), &occluded, m_stats); EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1164,11 +1175,12 @@ TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation) layer->setBounds(IntSize(600, 600)); occluded.setOcclusion(IntRect(200, 200, 300, 100)); + layer->setDrawableContentRect(IntRect(0, 0, 600, 600)); layer->setVisibleContentRect(IntRect(0, 0, 600, 600)); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); { DebugScopedSetImplThread implThread; @@ -1180,9 +1192,11 @@ TEST_F(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation) EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload()); layer->fakeLayerTextureUpdater()->clearPrepareRectCount(); + layer->setTexturePriorities(m_priorityCalculator); + textureManager->prioritizeTextures(); // Repaint without marking it dirty. The 3 culled tiles will be pre-painted now. - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(3, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1207,11 +1221,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms) layer->setDrawTransform(screenTransform); occluded.setOcclusion(IntRect(100, 100, 150, 50)); + layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1238,11 +1253,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling) layer->setScreenSpaceTransform(drawTransform); occluded.setOcclusion(IntRect(200, 200, 300, 100)); + layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); // The content is half the size of the layer (so the number of tiles is fewer). // In this case, the content is 300x300, and since the tile size is 100, the // number of tiles 3x3. @@ -1258,11 +1274,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling) // a different layer space. In this case the occluded region catches the // blown up tiles. occluded.setOcclusion(IntRect(200, 200, 300, 200)); + layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1278,11 +1295,12 @@ TEST_F(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling) layer->setDrawTransform(screenTransform); occluded.setOcclusion(IntRect(100, 100, 150, 100)); + layer->setDrawableContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->setVisibleContentRect(IntRect(IntPoint(), layer->contentBounds())); layer->invalidateContentRect(IntRect(0, 0, 600, 600)); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); - layer->updateContentRect(m_updater, IntRect(0, 0, 600, 600), &occluded, m_stats); + layer->updateContentRect(m_queue, IntRect(0, 0, 600, 600), &occluded, m_stats); EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount()); EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1); @@ -1306,6 +1324,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) IntRect visibleBounds = IntRect(0, 0, 100, 150); layer->setBounds(contentBounds.size()); + layer->setDrawableContentRect(visibleBounds); layer->setVisibleContentRect(visibleBounds); layer->setDrawOpacity(1); @@ -1315,7 +1334,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) // If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty. layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); layer->invalidateContentRect(contentBounds); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_TRUE(opaqueContents.isEmpty()); @@ -1328,7 +1347,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) opaquePaintRect = IntRect(10, 10, 90, 190); layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect); layer->invalidateContentRect(contentBounds); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds()); @@ -1341,7 +1360,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) // If we paint again without invalidating, the same stuff should be opaque. layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds()); @@ -1356,7 +1375,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) // not be affected. layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); layer->invalidateContentRect(IntRect(0, 0, 1, 1)); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds()); @@ -1371,7 +1390,7 @@ TEST_F(TiledLayerChromiumTest, visibleContentOpaqueRegion) // not be affected. layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); layer->invalidateContentRect(IntRect(10, 10, 1, 1)); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_EQ_RECT(intersection(IntRect(10, 100, 90, 100), visibleBounds), opaqueContents.bounds()); @@ -1399,6 +1418,7 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics) IntRect visibleBounds = IntRect(0, 0, 100, 300); layer->setBounds(contentBounds.size()); + layer->setDrawableContentRect(visibleBounds); layer->setVisibleContentRect(visibleBounds); layer->setDrawOpacity(1); @@ -1408,7 +1428,7 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics) // Invalidates and paints the whole layer. layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); layer->invalidateContentRect(contentBounds); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_TRUE(opaqueContents.isEmpty()); @@ -1423,7 +1443,7 @@ TEST_F(TiledLayerChromiumTest, pixelsPaintedMetrics) layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect()); layer->invalidateContentRect(IntRect(0, 0, 1, 1)); layer->invalidateContentRect(IntRect(50, 200, 10, 10)); - layer->updateContentRect(m_updater, contentBounds, &occluded, m_stats); + layer->updateContentRect(m_queue, contentBounds, &occluded, m_stats); updateTextures(); opaqueContents = layer->visibleContentOpaqueRegion(); EXPECT_TRUE(opaqueContents.isEmpty()); @@ -1458,6 +1478,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca root->setBounds(rootRect.size()); root->setAnchorPoint(FloatPoint()); + root->setDrawableContentRect(rootRect); root->setVisibleContentRect(rootRect); root->addChild(surface); @@ -1471,27 +1492,29 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca child->setAnchorPoint(FloatPoint()); child->setPosition(childRect.location()); child->setVisibleContentRect(childRect); + child->setDrawableContentRect(rootRect); child2->setBounds(child2Rect.size()); child2->setAnchorPoint(FloatPoint()); child2->setPosition(child2Rect.location()); child2->setVisibleContentRect(child2Rect); + child2->setDrawableContentRect(rootRect); ccLayerTreeHost->setRootLayer(root); - ccLayerTreeHost->setViewportSize(rootRect.size()); + ccLayerTreeHost->setViewportSize(rootRect.size(), rootRect.size()); // With a huge memory limit, all layers should update and push their textures. root->invalidateContentRect(rootRect); child->invalidateContentRect(childRect); child2->invalidateContentRect(child2Rect); - ccLayerTreeHost->updateLayers(m_updater, std::numeric_limits<size_t>::max()); + ccLayerTreeHost->updateLayers(m_queue, std::numeric_limits<size_t>::max()); { DebugScopedSetImplThread implThread; updateTextures(1000); EXPECT_EQ(6, root->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(3, child->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(3, child2->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); root->fakeLayerTextureUpdater()->clearUpdateCount(); child->fakeLayerTextureUpdater()->clearUpdateCount(); @@ -1519,14 +1542,14 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca root->invalidateContentRect(rootRect); child->invalidateContentRect(childRect); child2->invalidateContentRect(child2Rect); - ccLayerTreeHost->updateLayers(m_updater, (3 * 2 + 3 * 1) * (100 * 100) * 4); + ccLayerTreeHost->updateLayers(m_queue, (3 * 2 + 3 * 1) * (100 * 100) * 4); { DebugScopedSetImplThread implThread; updateTextures(1000); EXPECT_EQ(6, root->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(0, child->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(0, child2->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); root->fakeLayerTextureUpdater()->clearUpdateCount(); child->fakeLayerTextureUpdater()->clearUpdateCount(); @@ -1555,14 +1578,14 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca root->invalidateContentRect(rootRect); child->invalidateContentRect(childRect); child2->invalidateContentRect(child2Rect); - ccLayerTreeHost->updateLayers(m_updater, (3 * 1) * (100 * 100) * 4); + ccLayerTreeHost->updateLayers(m_queue, (3 * 1) * (100 * 100) * 4); { DebugScopedSetImplThread implThread; updateTextures(1000); EXPECT_EQ(0, root->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(0, child->fakeLayerTextureUpdater()->updateCount()); EXPECT_EQ(0, child2->fakeLayerTextureUpdater()->updateCount()); - EXPECT_FALSE(m_updater.hasMoreUpdates()); + EXPECT_FALSE(m_queue.hasMoreUpdates()); root->fakeLayerTextureUpdater()->clearUpdateCount(); child->fakeLayerTextureUpdater()->clearUpdateCount(); @@ -1646,12 +1669,13 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) IntRect contentRect(0, 0, 45, 47); EXPECT_EQ(contentRect.size(), layer->contentBounds()); layer->setVisibleContentRect(contentRect); + layer->setDrawableContentRect(contentRect); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); // Update the whole tile. - layer->updateContentRect(m_updater, contentRect, 0, m_stats); + layer->updateContentRect(m_queue, contentRect, 0, m_stats); layer->trackingLayerPainter()->resetPaintedRect(); EXPECT_INT_RECT_EQ(IntRect(), layer->trackingLayerPainter()->paintedRect()); @@ -1663,7 +1687,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringPaint) // Invalidate the entire layer in content space. When painting, the rect given to webkit should match the layer's bounds. layer->invalidateContentRect(contentRect); - layer->updateContentRect(m_updater, contentRect, 0, m_stats); + layer->updateContentRect(m_queue, contentRect, 0, m_stats); EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); } @@ -1681,12 +1705,13 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringInvali IntRect contentRect(IntPoint(), layer->contentBounds()); layer->setVisibleContentRect(contentRect); + layer->setDrawableContentRect(contentRect); layer->setTexturePriorities(m_priorityCalculator); textureManager->prioritizeTextures(); // Update the whole tile. - layer->updateContentRect(m_updater, contentRect, 0, m_stats); + layer->updateContentRect(m_queue, contentRect, 0, m_stats); layer->trackingLayerPainter()->resetPaintedRect(); EXPECT_INT_RECT_EQ(IntRect(), layer->trackingLayerPainter()->paintedRect()); @@ -1698,7 +1723,7 @@ TEST_F(TiledLayerChromiumTest, nonIntegerContentsScaleIsNotDistortedDuringInvali // Invalidate the entire layer in layer space. When painting, the rect given to webkit should match the layer's bounds. layer->setNeedsDisplayRect(layerRect); - layer->updateContentRect(m_updater, contentRect, 0, m_stats); + layer->updateContentRect(m_queue, contentRect, 0, m_stats); EXPECT_INT_RECT_EQ(layerRect, layer->trackingLayerPainter()->paintedRect()); } |