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

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

Issue 2408243002: cc : Move screen space scale factor to root transform node (Closed)
Patch Set: comments Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/property_tree.h" 5 #include "cc/trees/property_tree.h"
6 6
7 #include "cc/input/main_thread_scrolling_reason.h" 7 #include "cc/input/main_thread_scrolling_reason.h"
8 #include "cc/proto/property_tree.pb.h" 8 #include "cc/proto/property_tree.pb.h"
9 #include "cc/test/geometry_test_utils.h" 9 #include "cc/test/geometry_test_utils.h"
10 #include "cc/trees/clip_node.h" 10 #include "cc/trees/clip_node.h"
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 void StartTest() override { 1112 void StartTest() override {
1113 // This tests that to_target transform is not snapped when it has a singular 1113 // This tests that to_target transform is not snapped when it has a singular
1114 // transform. 1114 // transform.
1115 PropertyTrees property_trees; 1115 PropertyTrees property_trees;
1116 TransformTree& tree = property_trees.transform_tree; 1116 TransformTree& tree = property_trees.transform_tree;
1117 EffectTree& effect_tree = property_trees.effect_tree; 1117 EffectTree& effect_tree = property_trees.effect_tree;
1118 1118
1119 int parent = tree.Insert(TransformNode(), 0); 1119 int parent = tree.Insert(TransformNode(), 0);
1120 int effect_parent = effect_tree.Insert(EffectNode(), 0); 1120 int effect_parent = effect_tree.Insert(EffectNode(), 0);
1121 effect_tree.Node(effect_parent)->has_render_surface = true; 1121 effect_tree.Node(effect_parent)->has_render_surface = true;
1122 effect_tree.Node(effect_parent)->surface_contents_scale =
1123 gfx::Vector2dF(1.f, 1.f);
1124
1122 tree.SetTargetId(parent, parent); 1125 tree.SetTargetId(parent, parent);
1123 tree.Node(parent)->scrolls = true; 1126 tree.Node(parent)->scrolls = true;
1124 tree.Node(parent)->source_node_id = 0; 1127 tree.Node(parent)->source_node_id = 0;
1125 1128
1126 int child = tree.Insert(TransformNode(), parent); 1129 int child = tree.Insert(TransformNode(), parent);
1127 TransformNode* child_node = tree.Node(child); 1130 TransformNode* child_node = tree.Node(child);
1128 tree.SetTargetId(child, parent); 1131 tree.SetTargetId(child, parent);
1129 child_node->scrolls = true; 1132 child_node->scrolls = true;
1130 child_node->local.Scale3d(6.0f, 6.0f, 0.0f); 1133 child_node->local.Scale3d(6.0f, 6.0f, 0.0f);
1131 child_node->local.Translate(1.3f, 1.3f); 1134 child_node->local.Translate(1.3f, 1.3f);
(...skipping 22 matching lines...) Expand all
1154 1157
1155 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 1158 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
1156 PropertyTreeTestSingularTransformSnapTest); 1159 PropertyTreeTestSingularTransformSnapTest);
1157 1160
1158 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F 1161 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F
1159 #undef SERIALIZED_PROPERTY_TREE_TEST_F 1162 #undef SERIALIZED_PROPERTY_TREE_TEST_F
1160 #undef DIRECT_PROPERTY_TREE_TEST_F 1163 #undef DIRECT_PROPERTY_TREE_TEST_F
1161 1164
1162 } // namespace 1165 } // namespace
1163 } // namespace cc 1166 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698