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

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

Issue 2166043002: cc: Compute target space transform dynamically (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ancestors_are_invertible change Created 4 years, 5 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
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 #define EXPECT_IDEAL_SCALE_EQ(expected, layer) \ 94 #define EXPECT_IDEAL_SCALE_EQ(expected, layer) \
95 do { \ 95 do { \
96 EXPECT_FLOAT_EQ(expected, layer->GetIdealContentsScale()); \ 96 EXPECT_FLOAT_EQ(expected, layer->GetIdealContentsScale()); \
97 } while (false) 97 } while (false)
98 98
99 class LayerTreeSettingsScaleContent : public LayerTreeSettings { 99 class LayerTreeSettingsScaleContent : public LayerTreeSettings {
100 public: 100 public:
101 LayerTreeSettingsScaleContent() { 101 LayerTreeSettingsScaleContent() {
102 layer_transforms_should_scale_layer_contents = true; 102 layer_transforms_should_scale_layer_contents = true;
103 verify_transform_tree_calculations = true;
103 } 104 }
104 }; 105 };
105 106
106 class LayerTreeHostCommonScalingTest : public LayerTreeHostCommonTest { 107 class LayerTreeHostCommonScalingTest : public LayerTreeHostCommonTest {
107 public: 108 public:
108 LayerTreeHostCommonScalingTest() 109 LayerTreeHostCommonScalingTest()
109 : LayerTreeHostCommonTest(LayerTreeSettingsScaleContent()) {} 110 : LayerTreeHostCommonTest(LayerTreeSettingsScaleContent()) {}
110 }; 111 };
111 112
112 class LayerTreeHostCommonDrawRectsTest : public LayerTreeHostCommonTest { 113 class LayerTreeHostCommonDrawRectsTest : public LayerTreeHostCommonTest {
(...skipping 5257 matching lines...) Expand 10 before | Expand all | Expand 10 after
5370 scoped_refptr<AnimationTimeline> timeline() { return timeline_; } 5371 scoped_refptr<AnimationTimeline> timeline() { return timeline_; }
5371 5372
5372 protected: 5373 protected:
5373 LayerTreeSettings LCDTextTestLayerTreeSettings() { 5374 LayerTreeSettings LCDTextTestLayerTreeSettings() {
5374 LayerTreeSettings settings = LayerTreeSettings(); 5375 LayerTreeSettings settings = LayerTreeSettings();
5375 5376
5376 can_use_lcd_text_ = std::tr1::get<0>(GetParam()); 5377 can_use_lcd_text_ = std::tr1::get<0>(GetParam());
5377 layers_always_allowed_lcd_text_ = std::tr1::get<1>(GetParam()); 5378 layers_always_allowed_lcd_text_ = std::tr1::get<1>(GetParam());
5378 settings.can_use_lcd_text = can_use_lcd_text_; 5379 settings.can_use_lcd_text = can_use_lcd_text_;
5379 settings.layers_always_allowed_lcd_text = layers_always_allowed_lcd_text_; 5380 settings.layers_always_allowed_lcd_text = layers_always_allowed_lcd_text_;
5381 settings.verify_transform_tree_calculations = true;
5380 return settings; 5382 return settings;
5381 } 5383 }
5382 5384
5383 void SetUp() override { 5385 void SetUp() override {
5384 timeline_ = 5386 timeline_ =
5385 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); 5387 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
5386 host_impl_.animation_host()->AddAnimationTimeline(timeline_); 5388 host_impl_.animation_host()->AddAnimationTimeline(timeline_);
5387 5389
5388 std::unique_ptr<LayerImpl> root_ptr = 5390 std::unique_ptr<LayerImpl> root_ptr =
5389 LayerImpl::Create(host_impl_.active_tree(), 1); 5391 LayerImpl::Create(host_impl_.active_tree(), 1);
(...skipping 5152 matching lines...) Expand 10 before | Expand all | Expand 10 after
10542 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 10544 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
10543 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 10545 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
10544 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 10546 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
10545 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 10547 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
10546 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 10548 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
10547 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 10549 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
10548 } 10550 }
10549 10551
10550 } // namespace 10552 } // namespace
10551 } // namespace cc 10553 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698