Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
| (...skipping 8886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8897 rotated->AddChild(surface); | 8897 rotated->AddChild(surface); |
| 8898 surface->AddChild(container); | 8898 surface->AddChild(container); |
| 8899 surface->AddChild(box); | 8899 surface->AddChild(box); |
| 8900 | 8900 |
| 8901 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); | 8901 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 8902 host->SetRootLayer(root); | 8902 host->SetRootLayer(root); |
| 8903 | 8903 |
| 8904 ExecuteCalculateDrawProperties(root.get()); | 8904 ExecuteCalculateDrawProperties(root.get()); |
| 8905 } | 8905 } |
| 8906 | 8906 |
| 8907 TEST_F(LayerTreeHostCommonTest, OnlyApplyFixedPositioningOnce) { | |
| 8908 gfx::Transform identity; | |
| 8909 gfx::Transform translateZ; | |
|
ajuma
2015/03/20 18:15:34
nit: translate_z
Ian Vollick
2015/03/20 20:23:20
Done.
| |
| 8910 translateZ.Translate3d(0, 0, 10); | |
| 8911 | |
| 8912 scoped_refptr<Layer> root = Layer::Create(); | |
| 8913 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), | |
| 8914 gfx::PointF(), gfx::Size(800, 800), true, false); | |
| 8915 root->SetIsContainerForFixedPositionLayers(true); | |
| 8916 | |
| 8917 scoped_refptr<Layer> frame_clip = Layer::Create(); | |
| 8918 SetLayerPropertiesForTesting(frame_clip.get(), translateZ, gfx::Point3F(), | |
| 8919 gfx::PointF(500, 100), gfx::Size(100, 100), true, | |
| 8920 false); | |
| 8921 frame_clip->SetMasksToBounds(true); | |
| 8922 | |
| 8923 scoped_refptr<LayerWithForcedDrawsContent> fixed = | |
| 8924 make_scoped_refptr(new LayerWithForcedDrawsContent()); | |
| 8925 SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(), | |
| 8926 gfx::PointF(), gfx::Size(1000, 1000), true, | |
| 8927 false); | |
| 8928 | |
| 8929 LayerPositionConstraint constraint; | |
| 8930 constraint.set_is_fixed_position(true); | |
| 8931 fixed->SetPositionConstraint(constraint); | |
| 8932 | |
| 8933 root->AddChild(frame_clip); | |
| 8934 frame_clip->AddChild(fixed); | |
| 8935 | |
| 8936 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); | |
| 8937 host->SetRootLayer(root); | |
| 8938 | |
| 8939 ExecuteCalculateDrawProperties(root.get()); | |
|
ajuma
2015/03/20 18:15:35
It'd be good to add 'EXPECT' lines here so this co
Ian Vollick
2015/03/20 20:23:20
Done.
| |
| 8940 } | |
| 8941 | |
| 8907 } // namespace | 8942 } // namespace |
| 8908 } // namespace cc | 8943 } // namespace cc |
| OLD | NEW |