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 10557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10568 | 10568 |
10569 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) { | 10569 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) { |
10570 scoped_refptr<Layer> root = Layer::Create(); | 10570 scoped_refptr<Layer> root = Layer::Create(); |
10571 scoped_refptr<LayerWithForcedDrawsContent> animated = | 10571 scoped_refptr<LayerWithForcedDrawsContent> animated = |
10572 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 10572 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
10573 root->AddChild(animated); | 10573 root->AddChild(animated); |
10574 host()->SetRootLayer(root); | 10574 host()->SetRootLayer(root); |
10575 host()->SetElementIdsForTesting(); | 10575 host()->SetElementIdsForTesting(); |
10576 | 10576 |
10577 root->SetBounds(gfx::Size(100, 100)); | 10577 root->SetBounds(gfx::Size(100, 100)); |
10578 root->SetForceRenderSurfaceForTesting(true); | 10578 root->SetForceRenderSurface(true); |
10579 animated->SetBounds(gfx::Size(20, 20)); | 10579 animated->SetBounds(gfx::Size(20, 20)); |
10580 animated->SetOpacity(0.f); | 10580 animated->SetOpacity(0.f); |
10581 | 10581 |
10582 scoped_refptr<AnimationPlayer> player = | 10582 scoped_refptr<AnimationPlayer> player = |
10583 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); | 10583 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
10584 timeline()->AttachPlayer(player); | 10584 timeline()->AttachPlayer(player); |
10585 | 10585 |
10586 player->AttachElement(animated->element_id()); | 10586 player->AttachElement(animated->element_id()); |
10587 | 10587 |
10588 int animation_id = 0; | 10588 int animation_id = 0; |
(...skipping 28 matching lines...) Expand all Loading... |
10617 | 10617 |
10618 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) { | 10618 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) { |
10619 scoped_refptr<Layer> root = Layer::Create(); | 10619 scoped_refptr<Layer> root = Layer::Create(); |
10620 scoped_refptr<LayerWithForcedDrawsContent> animated = | 10620 scoped_refptr<LayerWithForcedDrawsContent> animated = |
10621 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 10621 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
10622 root->AddChild(animated); | 10622 root->AddChild(animated); |
10623 host()->SetRootLayer(root); | 10623 host()->SetRootLayer(root); |
10624 host()->SetElementIdsForTesting(); | 10624 host()->SetElementIdsForTesting(); |
10625 | 10625 |
10626 root->SetBounds(gfx::Size(100, 100)); | 10626 root->SetBounds(gfx::Size(100, 100)); |
10627 root->SetForceRenderSurfaceForTesting(true); | 10627 root->SetForceRenderSurface(true); |
10628 animated->SetBounds(gfx::Size(20, 20)); | 10628 animated->SetBounds(gfx::Size(20, 20)); |
10629 | 10629 |
10630 scoped_refptr<AnimationPlayer> player = | 10630 scoped_refptr<AnimationPlayer> player = |
10631 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); | 10631 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); |
10632 timeline()->AttachPlayer(player); | 10632 timeline()->AttachPlayer(player); |
10633 player->AttachElement(animated->element_id()); | 10633 player->AttachElement(animated->element_id()); |
10634 | 10634 |
10635 std::unique_ptr<KeyframedTransformAnimationCurve> curve( | 10635 std::unique_ptr<KeyframedTransformAnimationCurve> curve( |
10636 KeyframedTransformAnimationCurve::Create()); | 10636 KeyframedTransformAnimationCurve::Create()); |
10637 TransformOperations start; | 10637 TransformOperations start; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10905 | 10905 |
10906 // Check child layer draw properties. | 10906 // Check child layer draw properties. |
10907 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); | 10907 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); |
10908 EXPECT_EQ(gfx::Transform(), child->DrawTransform()); | 10908 EXPECT_EQ(gfx::Transform(), child->DrawTransform()); |
10909 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect()); | 10909 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect()); |
10910 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect()); | 10910 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect()); |
10911 } | 10911 } |
10912 | 10912 |
10913 } // namespace | 10913 } // namespace |
10914 } // namespace cc | 10914 } // namespace cc |
OLD | NEW |