OLD | NEW |
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/draw_property_utils.h" | 10 #include "cc/trees/draw_property_utils.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 EXPECT_EQ(transform_id_to_index_map[3], 2); | 108 EXPECT_EQ(transform_id_to_index_map[3], 2); |
109 EXPECT_EQ(original, result); | 109 EXPECT_EQ(original, result); |
110 } | 110 } |
111 | 111 |
112 TEST(PropertyTreeSerializationTest, ClipNodeDataSerialization) { | 112 TEST(PropertyTreeSerializationTest, ClipNodeDataSerialization) { |
113 ClipNodeData original; | 113 ClipNodeData original; |
114 original.clip = gfx::RectF(0.5f, 0.5f); | 114 original.clip = gfx::RectF(0.5f, 0.5f); |
115 original.combined_clip_in_target_space = gfx::RectF(0.6f, 0.6f); | 115 original.combined_clip_in_target_space = gfx::RectF(0.6f, 0.6f); |
116 original.clip_in_target_space = gfx::RectF(0.7f, 0.7f); | 116 original.clip_in_target_space = gfx::RectF(0.7f, 0.7f); |
117 original.transform_id = 2; | 117 original.transform_id = 2; |
118 original.target_id = 3; | 118 original.target_transform_id = 3; |
| 119 original.target_effect_id = 4; |
119 original.applies_local_clip = false; | 120 original.applies_local_clip = false; |
120 original.layer_clipping_uses_only_local_clip = false; | 121 original.layer_clipping_uses_only_local_clip = false; |
121 original.target_is_clipped = false; | 122 original.target_is_clipped = false; |
122 original.layers_are_clipped = false; | 123 original.layers_are_clipped = false; |
123 original.layers_are_clipped_when_surfaces_disabled = false; | 124 original.layers_are_clipped_when_surfaces_disabled = false; |
124 original.resets_clip = false; | 125 original.resets_clip = false; |
125 | 126 |
126 proto::TreeNode proto; | 127 proto::TreeNode proto; |
127 original.ToProtobuf(&proto); | 128 original.ToProtobuf(&proto); |
128 ClipNodeData result; | 129 ClipNodeData result; |
(...skipping 14 matching lines...) Expand all Loading... |
143 result.FromProtobuf(proto); | 144 result.FromProtobuf(proto); |
144 | 145 |
145 EXPECT_EQ(original, result); | 146 EXPECT_EQ(original, result); |
146 } | 147 } |
147 | 148 |
148 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) { | 149 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) { |
149 ClipTree original; | 150 ClipTree original; |
150 ClipNode& root = *original.Node(0); | 151 ClipNode& root = *original.Node(0); |
151 root.owner_id = 1; | 152 root.owner_id = 1; |
152 root.data.transform_id = 2; | 153 root.data.transform_id = 2; |
153 root.data.target_id = 1; | 154 root.data.target_transform_id = 1; |
| 155 root.data.target_effect_id = 1; |
154 ClipNode second; | 156 ClipNode second; |
155 second.owner_id = 2; | 157 second.owner_id = 2; |
156 second.data.transform_id = 4; | 158 second.data.transform_id = 4; |
157 second.data.applies_local_clip = true; | 159 second.data.applies_local_clip = true; |
158 ClipNode third; | 160 ClipNode third; |
159 third.owner_id = 3; | 161 third.owner_id = 3; |
160 third.data.target_id = 3; | 162 third.data.target_transform_id = 3; |
| 163 third.data.target_effect_id = 2; |
161 third.data.target_is_clipped = false; | 164 third.data.target_is_clipped = false; |
162 | 165 |
163 original.Insert(second, 0); | 166 original.Insert(second, 0); |
164 original.Insert(third, 1); | 167 original.Insert(third, 1); |
165 original.set_needs_update(true); | 168 original.set_needs_update(true); |
166 | 169 |
167 proto::PropertyTree proto; | 170 proto::PropertyTree proto; |
168 original.ToProtobuf(&proto); | 171 original.ToProtobuf(&proto); |
169 ClipTree result; | 172 ClipTree result; |
170 std::unordered_map<int, int> clip_id_to_index_map; | 173 std::unordered_map<int, int> clip_id_to_index_map; |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 | 1155 |
1153 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( | 1156 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( |
1154 PropertyTreeTestSingularTransformSnapTest); | 1157 PropertyTreeTestSingularTransformSnapTest); |
1155 | 1158 |
1156 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F | 1159 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F |
1157 #undef SERIALIZED_PROPERTY_TREE_TEST_F | 1160 #undef SERIALIZED_PROPERTY_TREE_TEST_F |
1158 #undef DIRECT_PROPERTY_TREE_TEST_F | 1161 #undef DIRECT_PROPERTY_TREE_TEST_F |
1159 | 1162 |
1160 } // namespace | 1163 } // namespace |
1161 } // namespace cc | 1164 } // namespace cc |
OLD | NEW |