Lines Matching refs:Layer
34 #include "ui/compositor/layer.h"
313 // Layer::ConvertPointToLayer, except NULL values for |source| are permitted,
709 // Make sure StackChildAtTop moves both the window and layer to the front.
723 ASSERT_EQ(2u, parent.layer()->children().size());
724 EXPECT_EQ(child1.layer(), parent.layer()->children()[0]);
725 EXPECT_EQ(child2.layer(), parent.layer()->children()[1]);
731 ASSERT_EQ(2u, parent.layer()->children().size());
732 EXPECT_EQ(child1.layer(), parent.layer()->children()[1]);
733 EXPECT_EQ(child2.layer(), parent.layer()->children()[0]);
787 ASSERT_EQ(2u, parent.layer()->children().size());
788 EXPECT_EQ(child2.layer(), parent.layer()->children()[0]);
789 EXPECT_EQ(child1.layer(), parent.layer()->children()[1]);
799 ASSERT_EQ(3u, parent.layer()->children().size());
800 EXPECT_EQ(child1.layer(), parent.layer()->children()[0]);
801 EXPECT_EQ(child2.layer(), parent.layer()->children()[1]);
802 EXPECT_EQ(child3.layer(), parent.layer()->children()[2]);
810 ASSERT_EQ(3u, parent.layer()->children().size());
811 EXPECT_EQ(child2.layer(), parent.layer()->children()[0]);
812 EXPECT_EQ(child3.layer(), parent.layer()->children()[1]);
813 EXPECT_EQ(child1.layer(), parent.layer()->children()[2]);
821 ASSERT_EQ(3u, parent.layer()->children().size());
822 EXPECT_EQ(child2.layer(), parent.layer()->children()[0]);
823 EXPECT_EQ(child1.layer(), parent.layer()->children()[1]);
824 EXPECT_EQ(child3.layer(), parent.layer()->children()[2]);
1449 // Verifies show/hide propagate correctly to children and the layer.
1718 EXPECT_FALSE(!w1->layer());
1719 w1->layer()->GetAnimator()->set_disable_timer_for_test(true);
1720 gfx::AnimationContainerElement* element = w1->layer()->GetAnimator();
1723 EXPECT_EQ("0,0 100x100", w1->layer()->GetTargetBounds().ToString());
1727 ui::ScopedLayerAnimationSettings settings(w1->layer()->GetAnimator());
1732 EXPECT_EQ("100,100 100x100", w1->layer()->GetTargetBounds().ToString());
1739 ui::ScopedLayerAnimationSettings settings(w1->layer()->GetAnimator());
1744 EXPECT_EQ("0,0 100x100", w1->layer()->GetTargetBounds().ToString());
1748 w1->layer()->GetAnimator()->last_step_time();
1959 ui::Layer* parent = window1->parent()->layer();
1968 // After acquisition, window1 should not own its layer, but it should still
1970 scoped_ptr<ui::Layer> window1_layer(window1->AcquireLayer());
1972 EXPECT_TRUE(window1_layer.get() == window1->layer());
1974 // Upon destruction, window1's layer should still be valid, and in the layer
1984 // Make sure that properties which should persist from the old layer to the new
1985 // layer actually do.
1993 ui::Layer* layer = w.layer();
1994 layer->set_scale_content(false);
1995 layer->SetVisible(false);
1996 layer->SetMasksToBounds(true);
1998 ui::Layer child_layer;
1999 layer->Add(&child_layer);
2001 scoped_ptr<ui::Layer> old_layer(w.RecreateLayer());
2002 layer = w.layer();
2003 EXPECT_EQ(ui::LAYER_SOLID_COLOR, layer->type());
2004 EXPECT_FALSE(layer->scale_content());
2005 EXPECT_FALSE(layer->visible());
2006 EXPECT_EQ(1u, layer->children().size());
2007 EXPECT_TRUE(layer->GetMasksToBounds());
2010 // Verify that RecreateLayer() stacks the old layer above the newly creatd
2011 // layer.
2016 scoped_ptr<ui::Layer> old_layer(w->RecreateLayer());
2018 const std::vector<ui::Layer*>& child_layers =
2019 root_window()->layer()->children();
2021 EXPECT_EQ(w->layer(), child_layers[0]);
2025 // Ensure that acquiring a layer then recreating a layer does not crash
2031 scoped_ptr<ui::Layer>acquired_layer(w->AcquireLayer());
2032 scoped_ptr<ui::Layer>doubly_acquired_layer(w->RecreateLayer());
2035 // Destroy window before layer gets destroyed.
2041 window1->layer()->set_name("1");
2043 window2->layer()->set_name("2");
2045 window3->layer()->set_name("3");
2049 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2050 window1->layer()->set_delegate(NULL);
2056 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2061 window1->layer()->set_name("1");
2063 window2->layer()->set_name("2");
2065 window3->layer()->set_name("3");
2067 // This brings |window1| (and its layer) to the front.
2071 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2074 // front of it, nor should its layer.
2075 window1->layer()->set_delegate(NULL);
2079 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2085 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2089 window3->layer()->set_delegate(NULL);
2093 ui::test::ChildLayerNamesAsString(*root_window()->layer()));
2109 window11->layer()->set_delegate(NULL);
2110 window13->layer()->set_delegate(NULL);
2136 window->layer()->SetVisible(visible);
2149 EXPECT_TRUE(window->layer()->visible());
2153 EXPECT_FALSE(window->layer()->visible());
2159 EXPECT_TRUE(window->layer()->visible());
2314 window->layer()->set_delegate(NULL);
2316 window->layer()->SetVisible(visible);
2318 window->layer()->SetVisible(visible);
2328 // aura client attempts to manipulate the visibility and delegate of a layer
2333 // spurious updating the client code may also clear window's layer's delegate,
2335 // uses the presence of a NULL layer delegate as a signal in stacking to note
2371 // resulting in window12's layer being below window1's layer (though the
2376 // Both window12 and its layer should be stacked above window1.
2382 // transient with a NULL layer delegate causes that primary window to be moved,
2383 // but the layer order not changed to match. http://crbug.com/112562
2397 ASSERT_EQ(4u, root->layer()->children().size());
2398 EXPECT_EQ(root->layer()->children()[0], window1->layer());
2399 EXPECT_EQ(root->layer()->children()[1], transient1->layer());
2400 EXPECT_EQ(root->layer()->children()[2], window2->layer());
2401 EXPECT_EQ(root->layer()->children()[3], transient2->layer());
2412 EXPECT_EQ(root->layer()->children()[0], window2->layer());
2413 EXPECT_EQ(root->layer()->children()[1], transient2->layer());
2414 EXPECT_EQ(root->layer()->children()[2], window1->layer());
2415 EXPECT_EQ(root->layer()->children()[3], transient1->layer());
2420 transient1->layer()->set_delegate(NULL);
2427 EXPECT_EQ(root->layer()->children()[0], window1->layer());
2428 EXPECT_EQ(root->layer()->children()[1], window2->layer());
2429 EXPECT_EQ(root->layer()->children()[2], transient2->layer());
2430 EXPECT_EQ(root->layer()->children()[3], transient1->layer());
2439 ASSERT_EQ(3u, root->layer()->children().size());
2440 EXPECT_EQ(root->layer()->children()[0], window1->layer());
2441 EXPECT_EQ(root->layer()->children()[1], window2->layer());
2442 EXPECT_EQ(root->layer()->children()[2], transient2->layer());
2452 ASSERT_EQ(4u, root->layer()->children().size());
2453 EXPECT_EQ(root->layer()->children()[0], window1->layer());
2454 EXPECT_EQ(root->layer()->children()[1], window2->layer());
2455 EXPECT_EQ(root->layer()->children()[2], transient2->layer());
2456 EXPECT_EQ(root->layer()->children()[3], window3->layer());
2460 window3->layer()->set_delegate(NULL);
2468 ASSERT_EQ(4u, root->layer()->children().size());
2469 EXPECT_EQ(root->layer()->children()[0], window1->layer());
2470 EXPECT_EQ(root->layer()->children()[1], window2->layer());
2471 EXPECT_EQ(root->layer()->children()[2], transient2->layer());
2472 EXPECT_EQ(root->layer()->children()[3], window3->layer());
2483 ASSERT_EQ(4u, root->layer()->children().size());
2484 EXPECT_EQ(root->layer()->children()[0], window2->layer());
2485 EXPECT_EQ(root->layer()->children()[1], transient2->layer());
2486 EXPECT_EQ(root->layer()->children()[2], window1->layer());
2487 EXPECT_EQ(root->layer()->children()[3], window3->layer());
2671 // Verifies the delegate is notified when the actual bounds of the layer
2683 window->layer()->GetAnimator()->set_disable_timer_for_test(true);
2689 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
2699 window->layer()->GetAnimator()->last_step_time();
2700 gfx::AnimationContainerElement* element = window->layer()->GetAnimator();
2706 // Verifies the delegate is notified when the actual bounds of the layer
2707 // change even when the window is not the layer's delegate
2718 window->layer()->GetAnimator()->set_disable_timer_for_test(true);
2722 // Suppress paint on the window since it is hidden (should reset the layer's
2725 EXPECT_EQ(NULL, window->layer()->delegate());
2729 ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
2733 // Layer delegate is NULL but we should still get bounds changed notification.
2741 window->layer()->GetAnimator()->last_step_time();
2742 gfx::AnimationContainerElement* element = window->layer()->GetAnimator();
2745 // No bounds changed notification at the end of animation since layer
2748 EXPECT_NE("0,0 100x100", window->layer()->bounds().ToString());
3066 root.layer()->SendDamagedRects();
3070 gfx::SkIRectToRect(root.layer()->damaged_region().getBounds()).
3078 root.layer()->SendDamagedRects();
3083 gfx::SkIRectToRect(root.layer()->damaged_region().getBounds()).
3098 // ll: layer less, eg no layer
3130 EXPECT_EQ(root.layer(), w111->layer()->parent());
3131 EXPECT_EQ(root.layer(), w12->layer()->parent());
3132 EXPECT_EQ(w12->layer(), w121->layer()->parent());
3141 // Bounds of layers are relative to the nearest ancestor with a layer.
3142 EXPECT_EQ("8,10 100x100", w12->layer()->bounds().ToString());
3143 EXPECT_EQ("9,12 100x100", w111->layer()->bounds().ToString());
3144 EXPECT_EQ("9,10 100x100", w121->layer()->bounds().ToString());
3149 EXPECT_TRUE(w111->layer()->parent() == NULL);
3150 EXPECT_TRUE(w12->layer()->parent() == NULL);
3160 EXPECT_EQ("7,8 100x100", w12->layer()->bounds().ToString());
3161 EXPECT_EQ("5,6 100x100", w111->layer()->bounds().ToString());
3162 EXPECT_EQ("9,10 100x100", w121->layer()->bounds().ToString());
3178 // ll: layer less, eg no layer
3212 EXPECT_EQ("11,14 11x12", w111->layer()->bounds().ToString());
3218 EXPECT_EQ("9,12 100x100", w111->layer()->bounds().ToString());
3227 EXPECT_EQ("11,14 100x100", w111->layer()->bounds().ToString());
3234 EXPECT_EQ("7,8 11x12", w111->layer()->bounds().ToString());
3288 // ll: layer less, eg no layer
3360 // ll: layer less, eg no layer
3451 // Window name is only propagated to layer in debug builds.
3452 if (window->layer())
3453 window->layer()->set_name(name);
3521 // returned string. This does *not* include the layer type in the description,
3534 std::string BuildLayerTreeDescription(const ui::Layer& layer) {
3536 result += layer.name();
3537 if (layer.children().empty())
3541 for (size_t i = 0; i < layer.children().size(); ++i) {
3544 result += BuildLayerTreeDescription(*(layer.children()[i]));
3550 // Builds a string for all the children of |layer|. The returned string is in
3553 std::string BuildRootLayerTreeDescription(const ui::Layer& layer) {
3555 for (size_t i = 0; i < layer.children().size(); ++i) {
3558 result += BuildLayerTreeDescription(*(layer.children()[i]));
3602 // Expected window and layer results.
3708 BuildRootLayerTreeDescription(*root.layer()))
3709 << "layer tree doesn't match at " << i;