summaryrefslogtreecommitdiffstats
path: root/cc/CCDamageTrackerTest.cpp
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 03:34:03 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-20 03:34:03 +0000
commit0920e24fdb8558f364926651828142d8a380e645 (patch)
tree850464d0f223985aaea40922e64f2c1ea9d6a59f /cc/CCDamageTrackerTest.cpp
parent7b5d438ccc3eb04f6a3d069052f9bfb06316726c (diff)
downloadchromium_src-0920e24fdb8558f364926651828142d8a380e645.zip
chromium_src-0920e24fdb8558f364926651828142d8a380e645.tar.gz
chromium_src-0920e24fdb8558f364926651828142d8a380e645.tar.bz2
Add wrapper container for a vector of OwnPtr<T>
In cc we frequently use WTF::Vector<WTF::OwnPtr<T> > to store lists of single-ownership objects. In WTF this works nicely using template specialization in the container implementation. In chromium we use STL containers and can't modify the implementation, so this adds a wrapper to do roughly the same thing. BUG= Review URL: https://chromiumcodereview.appspot.com/10940002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/CCDamageTrackerTest.cpp')
-rw-r--r--cc/CCDamageTrackerTest.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/cc/CCDamageTrackerTest.cpp b/cc/CCDamageTrackerTest.cpp
index 6ae520e..bf290f2 100644
--- a/cc/CCDamageTrackerTest.cpp
+++ b/cc/CCDamageTrackerTest.cpp
@@ -45,7 +45,7 @@ void clearDamageForAllSurfaces(CCLayerImpl* layer)
// Recursively clear damage for any existing surface.
for (size_t i = 0; i < layer->children().size(); ++i)
- clearDamageForAllSurfaces(layer->children()[i].get());
+ clearDamageForAllSurfaces(layer->children()[i]);
}
void emulateDrawingOneFrame(CCLayerImpl* root)
@@ -193,8 +193,8 @@ TEST_F(CCDamageTrackerTest, sanityCheckTestTreeWithTwoSurfaces)
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* child2 = root->children()[1].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* child2 = root->children()[1];
FloatRect childDamageRect = child1->renderSurface()->damageTracker()->currentDamageRect();
FloatRect rootDamageRect = root->renderSurface()->damageTracker()->currentDamageRect();
@@ -211,7 +211,7 @@ TEST_F(CCDamageTrackerTest, sanityCheckTestTreeWithTwoSurfaces)
TEST_F(CCDamageTrackerTest, verifyDamageForUpdateRects)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
// CASE 1: Setting the update rect should cause the corresponding damage to the surface.
//
@@ -245,7 +245,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForUpdateRects)
TEST_F(CCDamageTrackerTest, verifyDamageForPropertyChanges)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
// CASE 1: The layer's property changed flag takes priority over update rect.
//
@@ -289,7 +289,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForTransformedLayer)
// transformed layer.
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
WebTransformationMatrix rotation;
rotation.rotate(45);
@@ -332,7 +332,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
//
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
WebTransformationMatrix transform;
transform.translate3d(500, 500, 0);
@@ -369,7 +369,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForPerspectiveClippedLayer)
TEST_F(CCDamageTrackerTest, verifyDamageForBlurredSurface)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
WebFilterOperations filters;
filters.append(WebFilterOperation::createBlurFilter(5));
@@ -397,8 +397,8 @@ TEST_F(CCDamageTrackerTest, verifyDamageForBlurredSurface)
TEST_F(CCDamageTrackerTest, verifyDamageForBackgroundBlurredChild)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* child2 = root->children()[1].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* child2 = root->children()[1];
// Allow us to set damage on child1 too.
child1->setDrawsContent(true);
@@ -500,7 +500,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForBackgroundBlurredChild)
TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingLayer)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
// CASE 1: Adding a new layer should cause the appropriate damage.
//
@@ -571,7 +571,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForNewUnchangedLayer)
TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
// In this test we don't want the above tree manipulation to be considered part of the same frame.
clearDamageForAllSurfaces(root.get());
@@ -584,7 +584,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
child2->setDrawsContent(true);
root->addChild(child2.release());
}
- CCLayerImpl* child2 = root->children()[1].get();
+ CCLayerImpl* child2 = root->children()[1];
emulateDrawingOneFrame(root.get());
// Damaging two layers simultaneously should cause combined damage.
@@ -601,9 +601,9 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMultipleLayers)
TEST_F(CCDamageTrackerTest, verifyDamageForNestedSurfaces)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* child2 = root->children()[1].get();
- CCLayerImpl* grandChild1 = root->children()[0]->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* child2 = root->children()[1];
+ CCLayerImpl* grandChild1 = root->children()[0]->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -640,8 +640,8 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromDescendantLayer)
// surface should be marked dirty.
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* grandChild1 = root->children()[0]->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* grandChild1 = root->children()[0]->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -673,7 +673,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromAncestorLayer)
// root surface would be damaged appropriately.
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -695,7 +695,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForSurfaceChangeFromAncestorLayer)
TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingRenderSurfaces)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -739,7 +739,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForAddingAndRemovingRenderSurfaces)
TEST_F(CCDamageTrackerTest, verifyNoDamageWhenNothingChanged)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -765,7 +765,7 @@ TEST_F(CCDamageTrackerTest, verifyNoDamageWhenNothingChanged)
TEST_F(CCDamageTrackerTest, verifyNoDamageForUpdateRectThatDoesNotDrawContent)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
FloatRect childDamageRect;
FloatRect rootDamageRect;
@@ -783,9 +783,9 @@ TEST_F(CCDamageTrackerTest, verifyNoDamageForUpdateRectThatDoesNotDrawContent)
TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* grandChild1 = child1->children()[0].get();
- CCLayerImpl* grandChild2 = child1->children()[1].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* grandChild1 = child1->children()[0];
+ CCLayerImpl* grandChild2 = child1->children()[1];
// Damage on a surface that has a reflection should cause the target surface to
// receive the surface's damage and the surface's reflected damage.
@@ -869,7 +869,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplica)
TEST_F(CCDamageTrackerTest, verifyDamageForMask)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
// In the current implementation of the damage tracker, changes to mask layers should
// damage the entire corresponding surface.
@@ -953,8 +953,8 @@ TEST_F(CCDamageTrackerTest, verifyDamageForMask)
TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* grandChild1 = child1->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* grandChild1 = child1->children()[0];
// Changes to a replica's mask should not damage the original surface, because it is
// not masked. But it does damage the ancestor target surface.
@@ -1016,8 +1016,8 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMask)
TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithTwoSurfaces();
- CCLayerImpl* child1 = root->children()[0].get();
- CCLayerImpl* grandChild1 = child1->children()[0].get();
+ CCLayerImpl* child1 = root->children()[0];
+ CCLayerImpl* grandChild1 = child1->children()[0];
// Verify that the correct replicaOriginTransform is used for the replicaMask;
clearDamageForAllSurfaces(root.get());
@@ -1064,7 +1064,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageForReplicaMaskWithAnchor)
TEST_F(CCDamageTrackerTest, verifyDamageWhenForcedFullDamage)
{
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
// Case 1: This test ensures that when the tracker is forced to have full damage, that
// it takes priority over any other partial damage.
@@ -1108,7 +1108,7 @@ TEST_F(CCDamageTrackerTest, verifyDamageAccumulatesUntilReset)
// If damage is not cleared, it should accumulate.
OwnPtr<CCLayerImpl> root = createAndSetUpTestTreeWithOneSurface();
- CCLayerImpl* child = root->children()[0].get();
+ CCLayerImpl* child = root->children()[0];
clearDamageForAllSurfaces(root.get());
child->setUpdateRect(FloatRect(10, 11, 1, 2));