Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix for patch 1. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 9745 matching lines...) Expand 10 before | Expand all | Expand 10 after
9756 9756
9757 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) { 9757 TEST_F(LayerTreeHostCommonTest, OpacityAnimationsTrackingTest) {
9758 scoped_refptr<Layer> root = Layer::Create(); 9758 scoped_refptr<Layer> root = Layer::Create();
9759 scoped_refptr<LayerWithForcedDrawsContent> animated = 9759 scoped_refptr<LayerWithForcedDrawsContent> animated =
9760 make_scoped_refptr(new LayerWithForcedDrawsContent()); 9760 make_scoped_refptr(new LayerWithForcedDrawsContent());
9761 root->AddChild(animated); 9761 root->AddChild(animated);
9762 host()->SetRootLayer(root); 9762 host()->SetRootLayer(root);
9763 host()->SetElementIdsForTesting(); 9763 host()->SetElementIdsForTesting();
9764 9764
9765 root->SetBounds(gfx::Size(100, 100)); 9765 root->SetBounds(gfx::Size(100, 100));
9766 root->SetForceRenderSurfaceForTesting(true); 9766 root->SetForceRenderSurface(true);
9767 animated->SetBounds(gfx::Size(20, 20)); 9767 animated->SetBounds(gfx::Size(20, 20));
9768 animated->SetOpacity(0.f); 9768 animated->SetOpacity(0.f);
9769 9769
9770 scoped_refptr<AnimationPlayer> player = 9770 scoped_refptr<AnimationPlayer> player =
9771 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); 9771 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId());
9772 timeline()->AttachPlayer(player); 9772 timeline()->AttachPlayer(player);
9773 9773
9774 player->AttachElement(animated->element_id()); 9774 player->AttachElement(animated->element_id());
9775 9775
9776 int animation_id = 0; 9776 int animation_id = 0;
(...skipping 28 matching lines...) Expand all
9805 9805
9806 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) { 9806 TEST_F(LayerTreeHostCommonTest, TransformAnimationsTrackingTest) {
9807 scoped_refptr<Layer> root = Layer::Create(); 9807 scoped_refptr<Layer> root = Layer::Create();
9808 scoped_refptr<LayerWithForcedDrawsContent> animated = 9808 scoped_refptr<LayerWithForcedDrawsContent> animated =
9809 make_scoped_refptr(new LayerWithForcedDrawsContent()); 9809 make_scoped_refptr(new LayerWithForcedDrawsContent());
9810 root->AddChild(animated); 9810 root->AddChild(animated);
9811 host()->SetRootLayer(root); 9811 host()->SetRootLayer(root);
9812 host()->SetElementIdsForTesting(); 9812 host()->SetElementIdsForTesting();
9813 9813
9814 root->SetBounds(gfx::Size(100, 100)); 9814 root->SetBounds(gfx::Size(100, 100));
9815 root->SetForceRenderSurfaceForTesting(true); 9815 root->SetForceRenderSurface(true);
9816 animated->SetBounds(gfx::Size(20, 20)); 9816 animated->SetBounds(gfx::Size(20, 20));
9817 9817
9818 scoped_refptr<AnimationPlayer> player = 9818 scoped_refptr<AnimationPlayer> player =
9819 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); 9819 AnimationPlayer::Create(AnimationIdProvider::NextPlayerId());
9820 timeline()->AttachPlayer(player); 9820 timeline()->AttachPlayer(player);
9821 player->AttachElement(animated->element_id()); 9821 player->AttachElement(animated->element_id());
9822 9822
9823 std::unique_ptr<KeyframedTransformAnimationCurve> curve( 9823 std::unique_ptr<KeyframedTransformAnimationCurve> curve(
9824 KeyframedTransformAnimationCurve::Create()); 9824 KeyframedTransformAnimationCurve::Create());
9825 TransformOperations start; 9825 TransformOperations start;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
10093 10093
10094 // Check child layer draw properties. 10094 // Check child layer draw properties.
10095 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect()); 10095 EXPECT_EQ(gfx::Rect(10, 10), child->visible_layer_rect());
10096 EXPECT_EQ(gfx::Transform(), child->DrawTransform()); 10096 EXPECT_EQ(gfx::Transform(), child->DrawTransform());
10097 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect()); 10097 EXPECT_EQ(gfx::Rect(10, 10), child->clip_rect());
10098 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect()); 10098 EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect());
10099 } 10099 }
10100 10100
10101 } // namespace 10101 } // namespace
10102 } // namespace cc 10102 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698