| 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/clip_node.h" | 10 #include "cc/trees/clip_node.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 ClipNode original; | 106 ClipNode original; |
| 107 original.id = 3; | 107 original.id = 3; |
| 108 original.parent_id = 2; | 108 original.parent_id = 2; |
| 109 original.owner_id = 4; | 109 original.owner_id = 4; |
| 110 original.clip = gfx::RectF(0.5f, 0.5f); | 110 original.clip = gfx::RectF(0.5f, 0.5f); |
| 111 original.combined_clip_in_target_space = gfx::RectF(0.6f, 0.6f); | 111 original.combined_clip_in_target_space = gfx::RectF(0.6f, 0.6f); |
| 112 original.clip_in_target_space = gfx::RectF(0.7f, 0.7f); | 112 original.clip_in_target_space = gfx::RectF(0.7f, 0.7f); |
| 113 original.transform_id = 2; | 113 original.transform_id = 2; |
| 114 original.target_transform_id = 3; | 114 original.target_transform_id = 3; |
| 115 original.target_effect_id = 4; | 115 original.target_effect_id = 4; |
| 116 original.applies_local_clip = false; | 116 original.clip_type = ClipNode::ClipType::NONE; |
| 117 original.layer_clipping_uses_only_local_clip = false; | 117 original.layer_clipping_uses_only_local_clip = false; |
| 118 original.target_is_clipped = false; | 118 original.target_is_clipped = false; |
| 119 original.layers_are_clipped = false; | 119 original.layers_are_clipped = false; |
| 120 original.layers_are_clipped_when_surfaces_disabled = false; | 120 original.layers_are_clipped_when_surfaces_disabled = false; |
| 121 original.resets_clip = false; | 121 original.resets_clip = false; |
| 122 | 122 |
| 123 proto::TreeNode proto; | 123 proto::TreeNode proto; |
| 124 original.ToProtobuf(&proto); | 124 original.ToProtobuf(&proto); |
| 125 ClipNode result; | 125 ClipNode result; |
| 126 result.FromProtobuf(proto); | 126 result.FromProtobuf(proto); |
| 127 | 127 |
| 128 EXPECT_EQ(original, result); | 128 EXPECT_EQ(original, result); |
| 129 } | 129 } |
| 130 | 130 |
| 131 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) { | 131 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) { |
| 132 ClipTree original; | 132 ClipTree original; |
| 133 ClipNode& root = *original.Node(0); | 133 ClipNode& root = *original.Node(0); |
| 134 root.owner_id = 1; | 134 root.owner_id = 1; |
| 135 root.transform_id = 2; | 135 root.transform_id = 2; |
| 136 root.target_transform_id = 1; | 136 root.target_transform_id = 1; |
| 137 root.target_effect_id = 1; | 137 root.target_effect_id = 1; |
| 138 ClipNode second; | 138 ClipNode second; |
| 139 second.owner_id = 2; | 139 second.owner_id = 2; |
| 140 second.transform_id = 4; | 140 second.transform_id = 4; |
| 141 second.applies_local_clip = true; | 141 second.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP; |
| 142 ClipNode third; | 142 ClipNode third; |
| 143 third.owner_id = 3; | 143 third.owner_id = 3; |
| 144 third.target_transform_id = 3; | 144 third.target_transform_id = 3; |
| 145 third.target_effect_id = 2; | 145 third.target_effect_id = 2; |
| 146 third.target_is_clipped = false; | 146 third.target_is_clipped = false; |
| 147 | 147 |
| 148 original.Insert(second, 0); | 148 original.Insert(second, 0); |
| 149 original.Insert(third, 1); | 149 original.Insert(third, 1); |
| 150 original.set_needs_update(true); | 150 original.set_needs_update(true); |
| 151 | 151 |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 | 1154 |
| 1155 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( | 1155 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( |
| 1156 PropertyTreeTestSingularTransformSnapTest); | 1156 PropertyTreeTestSingularTransformSnapTest); |
| 1157 | 1157 |
| 1158 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F | 1158 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F |
| 1159 #undef SERIALIZED_PROPERTY_TREE_TEST_F | 1159 #undef SERIALIZED_PROPERTY_TREE_TEST_F |
| 1160 #undef DIRECT_PROPERTY_TREE_TEST_F | 1160 #undef DIRECT_PROPERTY_TREE_TEST_F |
| 1161 | 1161 |
| 1162 } // namespace | 1162 } // namespace |
| 1163 } // namespace cc | 1163 } // namespace cc |
| OLD | NEW |