diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-23 09:28:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-23 09:28:44 +0200 |
commit | 815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch) | |
tree | 923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Source/WebKit/chromium/tests/CCQuadCullerTest.cpp | |
parent | b4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff) | |
download | qtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz |
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Source/WebKit/chromium/tests/CCQuadCullerTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/CCQuadCullerTest.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp index e1d9fb367..526ab4e59 100644 --- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp +++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp @@ -75,11 +75,11 @@ static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const We layer->setBounds(layerRect.size()); layer->setContentBounds(layerRect.size()); - int textureId = 1; + CCResourceProvider::ResourceId resourceId = 1; for (int i = 0; i < tiler->numTilesX(); ++i) for (int j = 0; j < tiler->numTilesY(); ++j) { IntRect tileOpaqueRect = opaque ? tiler->tileBounds(i, j) : intersection(tiler->tileBounds(i, j), layerOpaqueRect); - layer->pushTileProperties(i, j, static_cast<Platform3DObject>(textureId++), tileOpaqueRect); + layer->pushTileProperties(i, j, resourceId++, tileOpaqueRect); } if (!parent) { @@ -97,8 +97,8 @@ static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const We static void appendQuads(CCQuadList& quadList, Vector<OwnPtr<CCSharedQuadState> >& sharedStateList, CCTiledLayerImpl* layer, CCLayerIteratorType& it, CCOcclusionTrackerImpl& occlusionTracker) { occlusionTracker.enterLayer(it); - CCQuadCuller quadCuller(quadList, layer, &occlusionTracker, false); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(); + CCQuadCuller quadCuller(quadList, layer, &occlusionTracker, false, false); + OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); sharedStateList.append(sharedQuadState.release()); @@ -121,8 +121,8 @@ TEST(CCQuadCullerTest, verifyNoCulling) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, false, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, false, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -138,8 +138,8 @@ TEST(CCQuadCullerTest, verifyCullChildLinesUpTopLeft) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -172,8 +172,8 @@ TEST(CCQuadCullerTest, verifyCullWhenChildOpaqueFlagFalse) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, false, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, false, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -191,8 +191,8 @@ TEST(CCQuadCullerTest, verifyCullCenterTileOnly) childTransform.translate(50, 50); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -234,8 +234,8 @@ TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize1) rootRect = childRect = IntRect(0, 0, 100, 100); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, rootTransform, rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, rootTransform, rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -262,8 +262,8 @@ TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize2) rootRect = childRect = IntRect(0, 0, 100, 100); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, rootTransform, rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, rootTransform, rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -282,8 +282,8 @@ TEST(CCQuadCullerTest, verifyCullChildLinesUpBottomRight) childTransform.translate(100, 100); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -301,9 +301,9 @@ TEST(CCQuadCullerTest, verifyCullSubRegion) childTransform.translate(50, 50); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); IntRect childOpaqueRect(childRect.x() + childRect.width() / 4, childRect.y() + childRect.height() / 4, childRect.width() / 2, childRect.height() / 2); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, false, childOpaqueRect, renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, false, childOpaqueRect, renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -321,9 +321,9 @@ TEST(CCQuadCullerTest, verifyCullSubRegion2) childTransform.translate(50, 10); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); IntRect childOpaqueRect(childRect.x() + childRect.width() / 4, childRect.y() + childRect.height() / 4, childRect.width() / 2, childRect.height() * 3 / 4); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, false, childOpaqueRect, renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, false, childOpaqueRect, renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -341,9 +341,9 @@ TEST(CCQuadCullerTest, verifyCullSubRegionCheckOvercull) childTransform.translate(50, 49); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); IntRect childOpaqueRect(childRect.x() + childRect.width() / 4, childRect.y() + childRect.height() / 4, childRect.width() / 2, childRect.height() / 2); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, false, childOpaqueRect, renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, false, childOpaqueRect, renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -362,8 +362,8 @@ TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsDontOcclude) // Use a small rotation so as to not disturb the geometry significantly. childTransform.rotate(1); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), childTransform, childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -388,8 +388,8 @@ TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsSafelyCulled) WebTransformationMatrix parentTransform; parentTransform.rotate(1); - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, parentTransform, rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, parentTransform, rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(-100, -100, 1000, 1000)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -405,8 +405,8 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverTile) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(200, 100, 100, 100)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -422,8 +422,8 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverCulledTile) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(100, 100, 100, 100)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -439,8 +439,8 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverPartialTiles) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(50, 50, 200, 200)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -456,8 +456,8 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverNoTiles) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(500, 500, 100, 100)); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); @@ -473,8 +473,8 @@ TEST(CCQuadCullerTest, verifyWithoutMetrics) { DECLARE_AND_INITIALIZE_TEST_QUADS - OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1.0, true, IntRect(), renderSurfaceLayerList); - OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1.0, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> rootLayer = makeLayer(0, WebTransformationMatrix(), rootRect, 1, true, IntRect(), renderSurfaceLayerList); + OwnPtr<CCTiledLayerImpl> childLayer = makeLayer(rootLayer.get(), WebTransformationMatrix(), childRect, 1, true, IntRect(), renderSurfaceLayerList); TestCCOcclusionTrackerImpl occlusionTracker(IntRect(50, 50, 200, 200), false); CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); |