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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 9857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9868 | 9868 |
9869 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) { | 9869 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) { |
9870 scoped_refptr<Layer> root = Layer::Create(); | 9870 scoped_refptr<Layer> root = Layer::Create(); |
9871 scoped_refptr<LayerWithForcedDrawsContent> animated = | 9871 scoped_refptr<LayerWithForcedDrawsContent> animated = |
9872 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 9872 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
9873 root->AddChild(animated); | 9873 root->AddChild(animated); |
9874 host()->SetRootLayer(root); | 9874 host()->SetRootLayer(root); |
9875 host()->SetElementIdsForTesting(); | 9875 host()->SetElementIdsForTesting(); |
9876 | 9876 |
9877 root->SetBounds(gfx::Size(100, 100)); | 9877 root->SetBounds(gfx::Size(100, 100)); |
9878 root->SetForceRenderSurfaceForTesting(true); | 9878 root->SetForceRenderSurface(true); |
9879 animated->SetBounds(gfx::Size(20, 20)); | 9879 animated->SetBounds(gfx::Size(20, 20)); |
9880 animated->SetOpacity(0.f); | 9880 animated->SetOpacity(0.f); |
9881 | 9881 |
9882 scoped_refptr<AnimationPlayer> player = | 9882 scoped_refptr<AnimationPlayer> player = |
9883 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); | 9883 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
9884 timeline()->AttachPlayer(player); | 9884 timeline()->AttachPlayer(player); |
9885 | 9885 |
9886 player->AttachElement(animated->element_id()); | 9886 player->AttachElement(animated->element_id()); |
9887 | 9887 |
9888 int animation_id = 0; | 9888 int animation_id = 0; |
(...skipping 28 matching lines...) Expand all Loading... |
9917 | 9917 |
9918 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) { | 9918 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) { |
9919 scoped_refptr<Layer> root = Layer::Create(); | 9919 scoped_refptr<Layer> root = Layer::Create(); |
9920 scoped_refptr<LayerWithForcedDrawsContent> animated = | 9920 scoped_refptr<LayerWithForcedDrawsContent> animated = |
9921 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 9921 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
9922 root->AddChild(animated); | 9922 root->AddChild(animated); |
9923 host()->SetRootLayer(root); | 9923 host()->SetRootLayer(root); |
9924 host()->SetElementIdsForTesting(); | 9924 host()->SetElementIdsForTesting(); |
9925 | 9925 |
9926 root->SetBounds(gfx::Size(100, 100)); | 9926 root->SetBounds(gfx::Size(100, 100)); |
9927 root->SetForceRenderSurfaceForTesting(true); | 9927 root->SetForceRenderSurface(true); |
9928 animated->SetBounds(gfx::Size(20, 20)); | 9928 animated->SetBounds(gfx::Size(20, 20)); |
9929 | 9929 |
9930 scoped_refptr<AnimationPlayer> player = | 9930 scoped_refptr<AnimationPlayer> player = |
9931 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); | 9931 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
9932 timeline()->AttachPlayer(player); | 9932 timeline()->AttachPlayer(player); |
9933 player->AttachElement(animated->element_id()); | 9933 player->AttachElement(animated->element_id()); |
9934 | 9934 |
9935 std::unique_ptr<KeyframedTransformAnimationCurve> curve( | 9935 std::unique_ptr<KeyframedTransformAnimationCurve> curve( |
9936 KeyframedTransformAnimationCurve::Create()); | 9936 KeyframedTransformAnimationCurve::Create()); |
9937 TransformOperations start; | 9937 TransformOperations start; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10209 | 10209 |
10210 // Check child layer draw properties. | 10210 // Check child layer draw properties. |
10211 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); | 10211 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); |
10212 EXPECT_EQ(gfx::Transform(), child->DrawTransform()); | 10212 EXPECT_EQ(gfx::Transform(), child->DrawTransform()); |
10213 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect()); | 10213 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect()); |
10214 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect()); | 10214 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect()); |
10215 } | 10215 } |
10216 | 10216 |
10217 } // namespace | 10217 } // namespace |
10218 } // namespace cc | 10218 } // namespace cc |
OLD | NEW |