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

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

Issue 2266223002: cc: Compute draw transforms dynamically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 } 582 }
583 }; 583 };
584 584
585 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 585 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
586 PropertyTreeTestComputeTransformSiblingSingularAncestor); 586 PropertyTreeTestComputeTransformSiblingSingularAncestor);
587 587
588 class PropertyTreeTestTransformsWithFlattening : public PropertyTreeTest { 588 class PropertyTreeTestTransformsWithFlattening : public PropertyTreeTest {
589 protected: 589 protected:
590 void StartTest() override { 590 void StartTest() override {
591 PropertyTrees property_trees; 591 PropertyTrees property_trees;
592 property_trees.verify_transform_tree_calculations = true;
593 TransformTree& tree = property_trees.transform_tree; 592 TransformTree& tree = property_trees.transform_tree;
594 EffectTree& effect_tree = property_trees.effect_tree; 593 EffectTree& effect_tree = property_trees.effect_tree;
595 594
596 int grand_parent = tree.Insert(TransformNode(), 0); 595 int grand_parent = tree.Insert(TransformNode(), 0);
597 int effect_grand_parent = effect_tree.Insert(EffectNode(), 0); 596 int effect_grand_parent = effect_tree.Insert(EffectNode(), 0);
598 effect_tree.Node(effect_grand_parent)->has_render_surface = true; 597 effect_tree.Node(effect_grand_parent)->has_render_surface = true;
599 effect_tree.Node(effect_grand_parent)->transform_id = grand_parent; 598 effect_tree.Node(effect_grand_parent)->transform_id = grand_parent;
600 effect_tree.Node(effect_grand_parent)->surface_contents_scale = 599 effect_tree.Node(effect_grand_parent)->surface_contents_scale =
601 gfx::Vector2dF(1.f, 1.f); 600 gfx::Vector2dF(1.f, 1.f);
602 tree.SetContentTargetId(grand_parent, grand_parent); 601 tree.SetContentTargetId(grand_parent, grand_parent);
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 1106
1108 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 1107 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
1109 PropertyTreeTestNonIntegerTranslationTest); 1108 PropertyTreeTestNonIntegerTranslationTest);
1110 1109
1111 class PropertyTreeTestSingularTransformSnapTest : public PropertyTreeTest { 1110 class PropertyTreeTestSingularTransformSnapTest : public PropertyTreeTest {
1112 protected: 1111 protected:
1113 void StartTest() override { 1112 void StartTest() override {
1114 // 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
1115 // transform. 1114 // transform.
1116 PropertyTrees property_trees; 1115 PropertyTrees property_trees;
1117 property_trees.verify_transform_tree_calculations = true;
1118 TransformTree& tree = property_trees.transform_tree; 1116 TransformTree& tree = property_trees.transform_tree;
1119 EffectTree& effect_tree = property_trees.effect_tree; 1117 EffectTree& effect_tree = property_trees.effect_tree;
1120 1118
1121 int parent = tree.Insert(TransformNode(), 0); 1119 int parent = tree.Insert(TransformNode(), 0);
1122 int effect_parent = effect_tree.Insert(EffectNode(), 0); 1120 int effect_parent = effect_tree.Insert(EffectNode(), 0);
1123 effect_tree.Node(effect_parent)->has_render_surface = true; 1121 effect_tree.Node(effect_parent)->has_render_surface = true;
1124 tree.SetTargetId(parent, parent); 1122 tree.SetTargetId(parent, parent);
1125 tree.Node(parent)->scrolls = true; 1123 tree.Node(parent)->scrolls = true;
1126 tree.Node(parent)->source_node_id = 0; 1124 tree.Node(parent)->source_node_id = 0;
1127 1125
(...skipping 28 matching lines...) Expand all
1156 1154
1157 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 1155 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
1158 PropertyTreeTestSingularTransformSnapTest); 1156 PropertyTreeTestSingularTransformSnapTest);
1159 1157
1160 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F 1158 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F
1161 #undef SERIALIZED_PROPERTY_TREE_TEST_F 1159 #undef SERIALIZED_PROPERTY_TREE_TEST_F
1162 #undef DIRECT_PROPERTY_TREE_TEST_F 1160 #undef DIRECT_PROPERTY_TREE_TEST_F
1163 1161
1164 } // namespace 1162 } // namespace
1165 } // namespace cc 1163 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698