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

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

Issue 2127323002: cc: Use sublayer scale from effect tree (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 TEST(PropertyTreeSerializationTest, ClipNodeSerialization) { 105 TEST(PropertyTreeSerializationTest, ClipNodeSerialization) {
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_id = 3; 114 original.target_transform_id = 3;
115 original.target_effect_id = 4;
115 original.applies_local_clip = false; 116 original.applies_local_clip = false;
116 original.layer_clipping_uses_only_local_clip = false; 117 original.layer_clipping_uses_only_local_clip = false;
117 original.target_is_clipped = false; 118 original.target_is_clipped = false;
118 original.layers_are_clipped = false; 119 original.layers_are_clipped = false;
119 original.layers_are_clipped_when_surfaces_disabled = false; 120 original.layers_are_clipped_when_surfaces_disabled = false;
120 original.resets_clip = false; 121 original.resets_clip = false;
121 122
122 proto::TreeNode proto; 123 proto::TreeNode proto;
123 original.ToProtobuf(&proto); 124 original.ToProtobuf(&proto);
124 ClipNode result; 125 ClipNode result;
125 result.FromProtobuf(proto); 126 result.FromProtobuf(proto);
126 127
127 EXPECT_EQ(original, result); 128 EXPECT_EQ(original, result);
128 } 129 }
129 130
130 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) { 131 TEST(PropertyTreeSerializationTest, ClipTreeSerialization) {
131 ClipTree original; 132 ClipTree original;
132 ClipNode& root = *original.Node(0); 133 ClipNode& root = *original.Node(0);
133 root.owner_id = 1; 134 root.owner_id = 1;
134 root.transform_id = 2; 135 root.transform_id = 2;
135 root.target_id = 1; 136 root.target_transform_id = 1;
137 root.target_effect_id = 1;
136 ClipNode second; 138 ClipNode second;
137 second.owner_id = 2; 139 second.owner_id = 2;
138 second.transform_id = 4; 140 second.transform_id = 4;
139 second.applies_local_clip = true; 141 second.applies_local_clip = true;
140 ClipNode third; 142 ClipNode third;
141 third.owner_id = 3; 143 third.owner_id = 3;
142 third.target_id = 3; 144 third.target_transform_id = 3;
145 third.target_effect_id = 2;
143 third.target_is_clipped = false; 146 third.target_is_clipped = false;
144 147
145 original.Insert(second, 0); 148 original.Insert(second, 0);
146 original.Insert(third, 1); 149 original.Insert(third, 1);
147 original.set_needs_update(true); 150 original.set_needs_update(true);
148 151
149 proto::PropertyTree proto; 152 proto::PropertyTree proto;
150 original.ToProtobuf(&proto); 153 original.ToProtobuf(&proto);
151 ClipTree result; 154 ClipTree result;
152 std::unordered_map<int, int> clip_id_to_index_map; 155 std::unordered_map<int, int> clip_id_to_index_map;
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 1115
1113 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F( 1116 DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F(
1114 PropertyTreeTestSingularTransformSnapTest); 1117 PropertyTreeTestSingularTransformSnapTest);
1115 1118
1116 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F 1119 #undef DIRECT_AND_SERIALIZED_PROPERTY_TREE_TEST_F
1117 #undef SERIALIZED_PROPERTY_TREE_TEST_F 1120 #undef SERIALIZED_PROPERTY_TREE_TEST_F
1118 #undef DIRECT_PROPERTY_TREE_TEST_F 1121 #undef DIRECT_PROPERTY_TREE_TEST_F
1119 1122
1120 } // namespace 1123 } // namespace
1121 } // namespace cc 1124 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698