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/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
(...skipping 7871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7882 LayerImpl* render_surface = | 7882 LayerImpl* render_surface = |
7883 AddChild<LayerImpl>(between_clip_parent_and_child); | 7883 AddChild<LayerImpl>(between_clip_parent_and_child); |
7884 LayerImpl* test_layer = AddChild<LayerImpl>(render_surface); | 7884 LayerImpl* test_layer = AddChild<LayerImpl>(render_surface); |
7885 | 7885 |
7886 const gfx::Transform identity_matrix; | 7886 const gfx::Transform identity_matrix; |
7887 gfx::Transform transform; | 7887 gfx::Transform transform; |
7888 transform.Translate(2.0, 2.0); | 7888 transform.Translate(2.0, 2.0); |
7889 | 7889 |
7890 test_layer->SetDrawsContent(true); | 7890 test_layer->SetDrawsContent(true); |
7891 render_surface->SetClipParent(clip_parent); | 7891 render_surface->SetClipParent(clip_parent); |
| 7892 scoped_ptr<std::set<LayerImpl*>> clip_children(new std::set<LayerImpl*>); |
| 7893 clip_children->insert(render_surface); |
| 7894 clip_parent->SetClipChildren(clip_children.release()); |
7892 SetLayerPropertiesForTesting(root, identity_matrix, gfx::Point3F(), | 7895 SetLayerPropertiesForTesting(root, identity_matrix, gfx::Point3F(), |
7893 gfx::PointF(), gfx::Size(30, 30), true, false, | 7896 gfx::PointF(), gfx::Size(30, 30), true, false, |
7894 true); | 7897 true); |
7895 SetLayerPropertiesForTesting(clip_parent, transform, gfx::Point3F(), | 7898 SetLayerPropertiesForTesting(clip_parent, transform, gfx::Point3F(), |
7896 gfx::PointF(), gfx::Size(30, 30), true, false, | 7899 gfx::PointF(), gfx::Size(30, 30), true, false, |
7897 false); | 7900 false); |
7898 SetLayerPropertiesForTesting(between_clip_parent_and_child, transform, | 7901 SetLayerPropertiesForTesting(between_clip_parent_and_child, transform, |
7899 gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30), | 7902 gfx::Point3F(), gfx::PointF(), gfx::Size(30, 30), |
7900 true, false, false); | 7903 true, false, false); |
7901 SetLayerPropertiesForTesting(render_surface, identity_matrix, gfx::Point3F(), | 7904 SetLayerPropertiesForTesting(render_surface, identity_matrix, gfx::Point3F(), |
7902 gfx::PointF(), gfx::Size(30, 30), true, false, | 7905 gfx::PointF(), gfx::Size(30, 30), true, false, |
7903 true); | 7906 true); |
7904 SetLayerPropertiesForTesting(test_layer, identity_matrix, gfx::Point3F(), | 7907 SetLayerPropertiesForTesting(test_layer, identity_matrix, gfx::Point3F(), |
7905 gfx::PointF(), gfx::Size(30, 30), true, false, | 7908 gfx::PointF(), gfx::Size(30, 30), true, false, |
7906 false); | 7909 false); |
7907 | 7910 |
7908 ExecuteCalculateDrawProperties(root); | 7911 ExecuteCalculateDrawProperties(root); |
7909 | 7912 |
7910 EXPECT_EQ(gfx::Rect(-4, -4, 30, 30), test_layer->clip_rect()); | 7913 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); |
7911 } | 7914 } |
7912 | 7915 |
7913 } // namespace | 7916 } // namespace |
7914 } // namespace cc | 7917 } // namespace cc |
OLD | NEW |