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

Unified Diff: cc/damage_tracker_unittest.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
Index: cc/damage_tracker_unittest.cc
diff --git a/cc/damage_tracker_unittest.cc b/cc/damage_tracker_unittest.cc
index d7a8dabca00169aa495c03c142288e986750da3b..3784fa438734789729c2d4db7a55cc814958c520 100644
--- a/cc/damage_tracker_unittest.cc
+++ b/cc/damage_tracker_unittest.cc
@@ -74,7 +74,6 @@ scoped_ptr<LayerImpl> createTestTreeWithOneSurface()
root->setPosition(FloatPoint::zero());
root->setAnchorPoint(FloatPoint::zero());
root->setBounds(IntSize(500, 500));
- root->setContentBounds(IntSize(500, 500));
root->setDrawsContent(true);
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(500, 500)));
@@ -82,7 +81,6 @@ scoped_ptr<LayerImpl> createTestTreeWithOneSurface()
child->setPosition(FloatPoint(100, 100));
child->setAnchorPoint(FloatPoint::zero());
child->setBounds(IntSize(30, 30));
- child->setContentBounds(IntSize(30, 30));
child->setDrawsContent(true);
root->addChild(child.Pass());
@@ -104,7 +102,6 @@ scoped_ptr<LayerImpl> createTestTreeWithTwoSurfaces()
root->setPosition(FloatPoint::zero());
root->setAnchorPoint(FloatPoint::zero());
root->setBounds(IntSize(500, 500));
- root->setContentBounds(IntSize(500, 500));
root->setDrawsContent(true);
root->createRenderSurface();
root->renderSurface()->setContentRect(IntRect(IntPoint(), IntSize(500, 500)));
@@ -112,26 +109,22 @@ scoped_ptr<LayerImpl> createTestTreeWithTwoSurfaces()
child1->setPosition(FloatPoint(100, 100));
child1->setAnchorPoint(FloatPoint::zero());
child1->setBounds(IntSize(30, 30));
- child1->setContentBounds(IntSize(30, 30));
child1->setOpacity(0.5); // with a child that drawsContent, this will cause the layer to create its own renderSurface.
child1->setDrawsContent(false); // this layer does not draw, but is intended to create its own renderSurface.
child2->setPosition(FloatPoint(11, 11));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(18, 18));
- child2->setContentBounds(IntSize(18, 18));
child2->setDrawsContent(true);
grandChild1->setPosition(FloatPoint(200, 200));
grandChild1->setAnchorPoint(FloatPoint::zero());
grandChild1->setBounds(IntSize(6, 8));
- grandChild1->setContentBounds(IntSize(6, 8));
grandChild1->setDrawsContent(true);
grandChild2->setPosition(FloatPoint(190, 190));
grandChild2->setAnchorPoint(FloatPoint::zero());
grandChild2->setBounds(IntSize(6, 8));
- grandChild2->setContentBounds(IntSize(6, 8));
grandChild2->setDrawsContent(true);
child1->addChild(grandChild1.Pass());
@@ -342,7 +335,6 @@ TEST_F(DamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
// Set up the child
child->setPosition(FloatPoint(0, 0));
child->setBounds(IntSize(100, 100));
- child->setContentBounds(IntSize(100, 100));
child->setTransform(transform);
emulateDrawingOneFrame(root.get());
@@ -540,7 +532,6 @@ TEST_F(DamageTrackerTest, verifyDamageForAddingAndRemovingLayer)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
- child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
root->addChild(child2.Pass());
}
@@ -580,7 +571,6 @@ TEST_F(DamageTrackerTest, verifyDamageForNewUnchangedLayer)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
- child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
child2->resetAllChangeTrackingForSubtree();
// Sanity check the initial conditions of the test, if these asserts trigger, it
@@ -610,7 +600,6 @@ TEST_F(DamageTrackerTest, verifyDamageForMultipleLayers)
child2->setPosition(FloatPoint(400, 380));
child2->setAnchorPoint(FloatPoint::zero());
child2->setBounds(IntSize(6, 8));
- child2->setContentBounds(IntSize(6, 8));
child2->setDrawsContent(true);
root->addChild(child2.Pass());
}
@@ -829,7 +818,6 @@ TEST_F(DamageTrackerTest, verifyDamageForReplica)
grandChild3->setPosition(FloatPoint(240, 240));
grandChild3->setAnchorPoint(FloatPoint::zero());
grandChild3->setBounds(IntSize(10, 10));
- grandChild3->setContentBounds(IntSize(10, 10));
grandChild3->setDrawsContent(true);
child1->addChild(grandChild3.Pass());
}
@@ -912,7 +900,6 @@ TEST_F(DamageTrackerTest, verifyDamageForMask)
maskLayer->setPosition(child->position());
maskLayer->setAnchorPoint(FloatPoint::zero());
maskLayer->setBounds(child->bounds());
- maskLayer->setContentBounds(child->bounds());
child->setMaskLayer(maskLayer.Pass());
}
LayerImpl* maskLayer = child->maskLayer();
@@ -924,7 +911,6 @@ TEST_F(DamageTrackerTest, verifyDamageForMask)
grandChild->setPosition(FloatPoint(2, 2));
grandChild->setAnchorPoint(FloatPoint::zero());
grandChild->setBounds(IntSize(2, 2));
- grandChild->setContentBounds(IntSize(2, 2));
grandChild->setDrawsContent(true);
child->addChild(grandChild.Pass());
}
@@ -1009,7 +995,6 @@ TEST_F(DamageTrackerTest, verifyDamageForReplicaMask)
replicaMaskLayer->setPosition(FloatPoint::zero());
replicaMaskLayer->setAnchorPoint(FloatPoint::zero());
replicaMaskLayer->setBounds(grandChild1->bounds());
- replicaMaskLayer->setContentBounds(grandChild1->bounds());
grandChild1Replica->setMaskLayer(replicaMaskLayer.Pass());
}
LayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();
@@ -1071,7 +1056,6 @@ TEST_F(DamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
replicaMaskLayer->setPosition(FloatPoint::zero());
replicaMaskLayer->setAnchorPoint(FloatPoint::zero()); // note, this is not the anchor being tested.
replicaMaskLayer->setBounds(grandChild1->bounds());
- replicaMaskLayer->setContentBounds(grandChild1->bounds());
grandChild1Replica->setMaskLayer(replicaMaskLayer.Pass());
}
LayerImpl* replicaMaskLayer = grandChild1Replica->maskLayer();

Powered by Google App Engine
This is Rietveld 408576698