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

Unified Diff: cc/layer_tree_host_common_unittest.cc

Issue 12648005: cc: Chromify the LayerTreeHostImpl class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compl Created 7 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 | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_common_unittest.cc
diff --git a/cc/layer_tree_host_common_unittest.cc b/cc/layer_tree_host_common_unittest.cc
index 1228d63e17b6486a9b5b9f2b2aa3b113074774b7..f6900478f4af258b08b342e4ed993e9b9ea4624e 100644
--- a/cc/layer_tree_host_common_unittest.cc
+++ b/cc/layer_tree_host_common_unittest.cc
@@ -77,10 +77,10 @@ void executeCalculateDrawProperties(LayerImpl* rootLayer, float deviceScaleFacto
scoped_ptr<LayerImpl> createTreeForFixedPositionTests(LayerTreeHostImpl* hostImpl)
{
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl->activeTree(), 1);
- scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl->activeTree(), 2);
- scoped_ptr<LayerImpl> grandChild = LayerImpl::Create(hostImpl->activeTree(), 3);
- scoped_ptr<LayerImpl> greatGrandChild = LayerImpl::Create(hostImpl->activeTree(), 4);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl->active_tree(), 1);
+ scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl->active_tree(), 2);
+ scoped_ptr<LayerImpl> grandChild = LayerImpl::Create(hostImpl->active_tree(), 3);
+ scoped_ptr<LayerImpl> greatGrandChild = LayerImpl::Create(hostImpl->active_tree(), 4);
gfx::Transform IdentityMatrix;
gfx::PointF anchor(0, 0);
@@ -270,12 +270,12 @@ TEST(LayerTreeHostCommonTest, verifyTransformsAboutScrollOffset)
FakeLayerTreeHostImpl hostImpl(&proxy);
gfx::Transform identityMatrix;
- scoped_ptr<LayerImpl> sublayerScopedPtr(LayerImpl::Create(hostImpl.activeTree(), 1));
+ scoped_ptr<LayerImpl> sublayerScopedPtr(LayerImpl::Create(hostImpl.active_tree(), 1));
LayerImpl* sublayer = sublayerScopedPtr.get();
sublayer->SetContentsScale(kPageScale * kDeviceScale, kPageScale * kDeviceScale);
setLayerPropertiesForTesting(sublayer, identityMatrix, identityMatrix, gfx::Point(0, 0), gfx::PointF(0, 0), gfx::Size(500, 500), false);
- scoped_ptr<LayerImpl> scrollLayerScopedPtr(LayerImpl::Create(hostImpl.activeTree(), 2));
+ scoped_ptr<LayerImpl> scrollLayerScopedPtr(LayerImpl::Create(hostImpl.active_tree(), 2));
LayerImpl* scrollLayer = scrollLayerScopedPtr.get();
setLayerPropertiesForTesting(scrollLayer, identityMatrix, identityMatrix, gfx::PointF(0, 0), kScrollLayerPosition, gfx::Size(10, 20), false);
scrollLayer->SetScrollable(true);
@@ -286,7 +286,7 @@ TEST(LayerTreeHostCommonTest, verifyTransformsAboutScrollOffset)
scrollLayer->SetImplTransform(implTransform);
scrollLayer->AddChild(sublayerScopedPtr.Pass());
- scoped_ptr<LayerImpl> root(LayerImpl::Create(hostImpl.activeTree(), 3));
+ scoped_ptr<LayerImpl> root(LayerImpl::Create(hostImpl.active_tree(), 3));
setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(3, 4), false);
root->AddChild(scrollLayerScopedPtr.Pass());
@@ -1303,7 +1303,7 @@ TEST(LayerTreeHostCommonTest, verifyScrollCompensationForFixedPositionLayerWithM
// Add one more layer to the test tree for this scenario.
{
gfx::Transform identity;
- scoped_ptr<LayerImpl> fixedPositionChild = LayerImpl::Create(hostImpl.activeTree(), 5);
+ scoped_ptr<LayerImpl> fixedPositionChild = LayerImpl::Create(hostImpl.active_tree(), 5);
setLayerPropertiesForTesting(fixedPositionChild.get(), identity, identity, gfx::PointF(0, 0), gfx::PointF(0, 0), gfx::Size(100, 100), false);
greatGrandChild->AddChild(fixedPositionChild.Pass());
}
@@ -2978,7 +2978,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayer)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3020,8 +3020,8 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerAndHud)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
- scoped_ptr<HeadsUpDisplayLayerImpl> hud = HeadsUpDisplayLayerImpl::Create(hostImpl.activeTree(), 11111);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
+ scoped_ptr<HeadsUpDisplayLayerImpl> hud = HeadsUpDisplayLayerImpl::Create(hostImpl.active_tree(), 11111);
gfx::Transform identityMatrix;
gfx::PointF anchor(0.f, 0.f);
@@ -3035,7 +3035,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerAndHud)
setLayerPropertiesForTesting(hud.get(), identityMatrix, identityMatrix, anchor, position, hudBounds, false);
hud->SetDrawsContent(true);
- hostImpl.activeTree()->set_hud_layer(hud.get());
+ hostImpl.active_tree()->set_hud_layer(hud.get());
root->AddChild(hud.PassAs<LayerImpl>());
std::vector<LayerImpl*> renderSurfaceLayerList;
@@ -3071,7 +3071,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForUninvertibleTransform)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform uninvertibleTransform;
uninvertibleTransform.matrix().setDouble(0, 0, 0);
@@ -3132,7 +3132,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePositionedLayer)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3175,7 +3175,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleRotatedLayer)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
gfx::Transform rotation45DegreesAboutCenter;
@@ -3226,7 +3226,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSinglePerspectiveLayer)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
@@ -3288,7 +3288,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
//
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3298,7 +3298,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSingleLayerWithScaledContents)
{
gfx::PointF position(25, 25);
gfx::Size bounds(50, 50);
- scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.active_tree(), 12345);
setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
// override contentBounds and contentsScale
@@ -3354,17 +3354,17 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForSimpleClippedLayer)
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
{
- scoped_ptr<LayerImpl> clippingLayer = LayerImpl::Create(hostImpl.activeTree(), 123);
+ scoped_ptr<LayerImpl> clippingLayer = LayerImpl::Create(hostImpl.active_tree(), 123);
gfx::PointF position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
gfx::Size bounds(50, 50);
setLayerPropertiesForTesting(clippingLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
clippingLayer->SetMasksToBounds(true);
- scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.activeTree(), 456);
+ scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.active_tree(), 456);
position = gfx::PointF(-50, -50);
bounds = gfx::Size(300, 300);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
@@ -3419,7 +3419,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
//
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 123);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 123);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3429,9 +3429,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultiClippedRotatedLayer)
root->SetMasksToBounds(true);
{
- scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.activeTree(), 456);
- scoped_ptr<LayerImpl> grandChild = LayerImpl::Create(hostImpl.activeTree(), 789);
- scoped_ptr<LayerImpl> rotatedLeaf = LayerImpl::Create(hostImpl.activeTree(), 2468);
+ scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.active_tree(), 456);
+ scoped_ptr<LayerImpl> grandChild = LayerImpl::Create(hostImpl.active_tree(), 789);
+ scoped_ptr<LayerImpl> rotatedLeaf = LayerImpl::Create(hostImpl.active_tree(), 2468);
position = gfx::PointF(10, 10);
bounds = gfx::Size(80, 80);
@@ -3522,11 +3522,11 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
{
- scoped_ptr<LayerImpl> intermediateLayer = LayerImpl::Create(hostImpl.activeTree(), 123);
+ scoped_ptr<LayerImpl> intermediateLayer = LayerImpl::Create(hostImpl.active_tree(), 123);
gfx::PointF position(10, 10); // this layer is positioned, and hit testing should correctly know where the layer is located.
gfx::Size bounds(50, 50);
setLayerPropertiesForTesting(intermediateLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
@@ -3536,7 +3536,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForNonClippingIntermediateLayer)
// The child of the intermediateLayer is translated so that it does not overlap intermediateLayer at all.
// If child is incorrectly clipped, we would not be able to hit it successfully.
- scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.activeTree(), 456);
+ scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.active_tree(), 456);
position = gfx::PointF(60, 60); // 70, 70 in screen space
bounds = gfx::Size(20, 20);
setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
@@ -3580,7 +3580,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3595,9 +3595,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayers)
// The expected stacking order is:
// (front) child2, (second) grandChild, (third) child1, and (back) the root layer behind all other layers.
- scoped_ptr<LayerImpl> child1 = LayerImpl::Create(hostImpl.activeTree(), 2);
- scoped_ptr<LayerImpl> child2 = LayerImpl::Create(hostImpl.activeTree(), 3);
- scoped_ptr<LayerImpl> grandChild1 = LayerImpl::Create(hostImpl.activeTree(), 4);
+ scoped_ptr<LayerImpl> child1 = LayerImpl::Create(hostImpl.active_tree(), 2);
+ scoped_ptr<LayerImpl> child2 = LayerImpl::Create(hostImpl.active_tree(), 3);
+ scoped_ptr<LayerImpl> grandChild1 = LayerImpl::Create(hostImpl.active_tree(), 4);
position = gfx::PointF(10, 10);
bounds = gfx::Size(50, 50);
@@ -3685,7 +3685,7 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
//
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -3700,9 +3700,9 @@ TEST(LayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists)
// The expected stacking order is:
// (front) child2, (second) grandChild, (third) child1, and (back) the root layer behind all other layers.
- scoped_ptr<LayerImpl> child1 = LayerImpl::Create(hostImpl.activeTree(), 2);
- scoped_ptr<LayerImpl> child2 = LayerImpl::Create(hostImpl.activeTree(), 3);
- scoped_ptr<LayerImpl> grandChild1 = LayerImpl::Create(hostImpl.activeTree(), 4);
+ scoped_ptr<LayerImpl> child1 = LayerImpl::Create(hostImpl.active_tree(), 2);
+ scoped_ptr<LayerImpl> child2 = LayerImpl::Create(hostImpl.active_tree(), 3);
+ scoped_ptr<LayerImpl> grandChild1 = LayerImpl::Create(hostImpl.active_tree(), 4);
position = gfx::PointF(10, 10);
bounds = gfx::Size(50, 50);
@@ -3809,7 +3809,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSingleLayer
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
Region touchHandlerRegion(gfx::Rect(10, 10, 50, 50));
@@ -3867,7 +3867,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForUninvertibl
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform uninvertibleTransform;
uninvertibleTransform.matrix().setDouble(0, 0, 0);
@@ -3930,7 +3930,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSinglePosit
{
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 12345);
gfx::Transform identityMatrix;
Region touchHandlerRegion(gfx::Rect(10, 10, 50, 50));
@@ -3990,7 +3990,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSingleLayer
//
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -4001,7 +4001,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSingleLayer
Region touchHandlerRegion(gfx::Rect(10, 10, 30, 30));
gfx::PointF position(25, 25);
gfx::Size bounds(50, 50);
- scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.active_tree(), 12345);
setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
// override contentBounds and contentsScale
@@ -4064,7 +4064,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSingleLayer
// be able to hit the touch handler region by scaling the points accordingly.
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
gfx::Transform identityMatrix;
gfx::PointF anchor(0, 0);
@@ -4075,7 +4075,7 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSingleLayer
Region touchHandlerRegion(gfx::Rect(10, 10, 30, 30));
gfx::PointF position(25, 25);
gfx::Size bounds(50, 50);
- scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.activeTree(), 12345);
+ scoped_ptr<LayerImpl> testLayer = LayerImpl::Create(hostImpl.active_tree(), 12345);
setLayerPropertiesForTesting(testLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
testLayer->SetDrawsContent(true);
@@ -4152,17 +4152,17 @@ TEST(LayerTreeHostCommonTest, verifyHitCheckingTouchHandlerRegionsForSimpleClipp
FakeImplProxy proxy;
FakeLayerTreeHostImpl hostImpl(&proxy);
- scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.activeTree(), 1);
+ scoped_ptr<LayerImpl> root = LayerImpl::Create(hostImpl.active_tree(), 1);
setLayerPropertiesForTesting(root.get(), identityMatrix, identityMatrix, anchor, gfx::PointF(0, 0), gfx::Size(100, 100), false);
{
- scoped_ptr<LayerImpl> clippingLayer = LayerImpl::Create(hostImpl.activeTree(), 123);
+ scoped_ptr<LayerImpl> clippingLayer = LayerImpl::Create(hostImpl.active_tree(), 123);
gfx::PointF position(25, 25); // this layer is positioned, and hit testing should correctly know where the layer is located.
gfx::Size bounds(50, 50);
setLayerPropertiesForTesting(clippingLayer.get(), identityMatrix, identityMatrix, anchor, position, bounds, false);
clippingLayer->SetMasksToBounds(true);
- scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.activeTree(), 456);
+ scoped_ptr<LayerImpl> child = LayerImpl::Create(hostImpl.active_tree(), 456);
Region touchHandlerRegion(gfx::Rect(10, 10, 50, 50));
position = gfx::PointF(-50, -50);
bounds = gfx::Size(300, 300);
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698