1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/trees/property_tree.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/trees/draw_property_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
TEST(PropertyTreeTest, ComputeTransformRoot) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.local.Translate(2, 2);
root.data.target_id = 0;
tree.UpdateTransforms(0);
gfx::Transform expected;
gfx::Transform transform;
bool success = tree.ComputeTransform(0, 0, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.Translate(2, 2);
success = tree.ComputeTransform(0, -1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(-2, -2);
success = tree.ComputeTransform(-1, 0, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
}
TEST(PropertyTreeTest, ComputeTransformChild) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.local.Translate(2, 2);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode child;
child.data.local.Translate(3, 3);
child.data.target_id = 0;
child.data.source_node_id = 0;
tree.Insert(child, 0);
tree.UpdateTransforms(1);
gfx::Transform expected;
gfx::Transform transform;
expected.Translate(3, 3);
bool success = tree.ComputeTransform(1, 0, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(-3, -3);
success = tree.ComputeTransform(0, 1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(5, 5);
success = tree.ComputeTransform(1, -1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(-5, -5);
success = tree.ComputeTransform(-1, 1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
}
TEST(PropertyTreeTest, ComputeTransformSibling) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.local.Translate(2, 2);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode child;
child.data.local.Translate(3, 3);
child.data.source_node_id = 0;
child.data.target_id = 0;
TransformNode sibling;
sibling.data.local.Translate(7, 7);
sibling.data.source_node_id = 0;
sibling.data.target_id = 0;
tree.Insert(child, 0);
tree.Insert(sibling, 0);
tree.UpdateTransforms(1);
tree.UpdateTransforms(2);
gfx::Transform expected;
gfx::Transform transform;
expected.Translate(4, 4);
bool success = tree.ComputeTransform(2, 1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(-4, -4);
success = tree.ComputeTransform(1, 2, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
}
TEST(PropertyTreeTest, ComputeTransformSiblingSingularAncestor) {
// In this test, we have the following tree:
// root
// + singular
// + child
// + sibling
// Since the lowest common ancestor of |child| and |sibling| has a singular
// transform, we cannot use screen space transforms to compute change of basis
// transforms between these nodes.
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.local.Translate(2, 2);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode singular;
singular.data.local.matrix().set(2, 2, 0.0);
singular.data.source_node_id = 0;
singular.data.target_id = 0;
TransformNode child;
child.data.local.Translate(3, 3);
child.data.source_node_id = 1;
child.data.target_id = 0;
TransformNode sibling;
sibling.data.local.Translate(7, 7);
sibling.data.source_node_id = 1;
sibling.data.target_id = 0;
tree.Insert(singular, 0);
tree.Insert(child, 1);
tree.Insert(sibling, 1);
tree.UpdateTransforms(1);
tree.UpdateTransforms(2);
tree.UpdateTransforms(3);
gfx::Transform expected;
gfx::Transform transform;
expected.Translate(4, 4);
bool success = tree.ComputeTransform(3, 2, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
transform.MakeIdentity();
expected.MakeIdentity();
expected.Translate(-4, -4);
success = tree.ComputeTransform(2, 3, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
}
TEST(PropertyTreeTest, TransformsWithFlattening) {
TransformTree tree;
int grand_parent = tree.Insert(TransformNode(), 0);
tree.Node(grand_parent)->data.content_target_id = grand_parent;
tree.Node(grand_parent)->data.target_id = grand_parent;
tree.Node(grand_parent)->data.source_node_id = 0;
gfx::Transform rotation_about_x;
rotation_about_x.RotateAboutXAxis(15);
int parent = tree.Insert(TransformNode(), grand_parent);
tree.Node(parent)->data.needs_sublayer_scale = true;
tree.Node(parent)->data.target_id = grand_parent;
tree.Node(parent)->data.content_target_id = parent;
tree.Node(parent)->data.source_node_id = grand_parent;
tree.Node(parent)->data.local = rotation_about_x;
int child = tree.Insert(TransformNode(), parent);
tree.Node(child)->data.target_id = parent;
tree.Node(child)->data.content_target_id = parent;
tree.Node(child)->data.source_node_id = parent;
tree.Node(child)->data.flattens_inherited_transform = true;
tree.Node(child)->data.local = rotation_about_x;
int grand_child = tree.Insert(TransformNode(), child);
tree.Node(grand_child)->data.target_id = parent;
tree.Node(grand_child)->data.content_target_id = parent;
tree.Node(grand_child)->data.source_node_id = child;
tree.Node(grand_child)->data.flattens_inherited_transform = true;
tree.Node(grand_child)->data.local = rotation_about_x;
tree.set_needs_update(true);
ComputeTransforms(&tree);
gfx::Transform flattened_rotation_about_x = rotation_about_x;
flattened_rotation_about_x.FlattenTo2d();
EXPECT_TRANSFORMATION_MATRIX_EQ(rotation_about_x,
tree.Node(child)->data.to_target);
EXPECT_TRANSFORMATION_MATRIX_EQ(flattened_rotation_about_x * rotation_about_x,
tree.Node(child)->data.to_screen);
EXPECT_TRANSFORMATION_MATRIX_EQ(flattened_rotation_about_x * rotation_about_x,
tree.Node(grand_child)->data.to_target);
EXPECT_TRANSFORMATION_MATRIX_EQ(flattened_rotation_about_x *
flattened_rotation_about_x *
rotation_about_x,
tree.Node(grand_child)->data.to_screen);
gfx::Transform grand_child_to_child;
bool success =
tree.ComputeTransform(grand_child, child, &grand_child_to_child);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(rotation_about_x, grand_child_to_child);
// Remove flattening at grand_child, and recompute transforms.
tree.Node(grand_child)->data.flattens_inherited_transform = false;
tree.set_needs_update(true);
ComputeTransforms(&tree);
EXPECT_TRANSFORMATION_MATRIX_EQ(rotation_about_x * rotation_about_x,
tree.Node(grand_child)->data.to_target);
EXPECT_TRANSFORMATION_MATRIX_EQ(
flattened_rotation_about_x * rotation_about_x * rotation_about_x,
tree.Node(grand_child)->data.to_screen);
success = tree.ComputeTransform(grand_child, child, &grand_child_to_child);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(rotation_about_x, grand_child_to_child);
}
TEST(PropertyTreeTest, MultiplicationOrder) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.local.Translate(2, 2);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode child;
child.data.local.Scale(2, 2);
child.data.target_id = 0;
child.data.source_node_id = 0;
tree.Insert(child, 0);
tree.UpdateTransforms(1);
gfx::Transform expected;
expected.Translate(2, 2);
expected.Scale(2, 2);
gfx::Transform transform;
gfx::Transform inverse;
bool success = tree.ComputeTransform(1, -1, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
success = tree.ComputeTransform(-1, 1, &inverse);
EXPECT_TRUE(success);
transform = transform * inverse;
expected.MakeIdentity();
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
}
TEST(PropertyTreeTest, ComputeTransformWithUninvertibleTransform) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode child;
child.data.local.Scale(0, 0);
child.data.target_id = 0;
child.data.source_node_id = 0;
tree.Insert(child, 0);
tree.UpdateTransforms(1);
gfx::Transform expected;
expected.Scale(0, 0);
gfx::Transform transform;
gfx::Transform inverse;
bool success = tree.ComputeTransform(1, 0, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected, transform);
// To compute this would require inverting the 0 matrix, so we cannot
// succeed.
success = tree.ComputeTransform(0, 1, &inverse);
EXPECT_FALSE(success);
}
TEST(PropertyTreeTest, ComputeTransformWithSublayerScale) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode grand_parent;
grand_parent.data.local.Scale(2.f, 2.f);
grand_parent.data.target_id = 0;
grand_parent.data.source_node_id = 0;
grand_parent.data.needs_sublayer_scale = true;
int grand_parent_id = tree.Insert(grand_parent, 0);
tree.UpdateTransforms(grand_parent_id);
TransformNode parent;
parent.data.local.Translate(15.f, 15.f);
parent.data.target_id = grand_parent_id;
parent.data.source_node_id = grand_parent_id;
int parent_id = tree.Insert(parent, grand_parent_id);
tree.UpdateTransforms(parent_id);
TransformNode child;
child.data.local.Scale(3.f, 3.f);
child.data.target_id = grand_parent_id;
child.data.source_node_id = parent_id;
int child_id = tree.Insert(child, parent_id);
tree.UpdateTransforms(child_id);
TransformNode grand_child;
grand_child.data.local.Scale(5.f, 5.f);
grand_child.data.target_id = grand_parent_id;
grand_child.data.source_node_id = child_id;
grand_child.data.needs_sublayer_scale = true;
int grand_child_id = tree.Insert(grand_child, child_id);
tree.UpdateTransforms(grand_child_id);
EXPECT_EQ(gfx::Vector2dF(2.f, 2.f),
tree.Node(grand_parent_id)->data.sublayer_scale);
EXPECT_EQ(gfx::Vector2dF(30.f, 30.f),
tree.Node(grand_child_id)->data.sublayer_scale);
// Compute transform from grand_parent to grand_child.
gfx::Transform expected_transform_without_sublayer_scale;
expected_transform_without_sublayer_scale.Scale(1.f / 15.f, 1.f / 15.f);
expected_transform_without_sublayer_scale.Translate(-15.f, -15.f);
gfx::Transform expected_transform_with_dest_sublayer_scale;
expected_transform_with_dest_sublayer_scale.Scale(30.f, 30.f);
expected_transform_with_dest_sublayer_scale.Scale(1.f / 15.f, 1.f / 15.f);
expected_transform_with_dest_sublayer_scale.Translate(-15.f, -15.f);
gfx::Transform expected_transform_with_source_sublayer_scale;
expected_transform_with_source_sublayer_scale.Scale(1.f / 15.f, 1.f / 15.f);
expected_transform_with_source_sublayer_scale.Translate(-15.f, -15.f);
expected_transform_with_source_sublayer_scale.Scale(0.5f, 0.5f);
gfx::Transform transform;
bool success =
tree.ComputeTransform(grand_parent_id, grand_child_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_without_sublayer_scale,
transform);
success = tree.ComputeTransformWithDestinationSublayerScale(
grand_parent_id, grand_child_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_with_dest_sublayer_scale,
transform);
success = tree.ComputeTransformWithSourceSublayerScale(
grand_parent_id, grand_child_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_with_source_sublayer_scale,
transform);
// Now compute transform from grand_child to grand_parent.
expected_transform_without_sublayer_scale.MakeIdentity();
expected_transform_without_sublayer_scale.Translate(15.f, 15.f);
expected_transform_without_sublayer_scale.Scale(15.f, 15.f);
expected_transform_with_dest_sublayer_scale.MakeIdentity();
expected_transform_with_dest_sublayer_scale.Scale(2.f, 2.f);
expected_transform_with_dest_sublayer_scale.Translate(15.f, 15.f);
expected_transform_with_dest_sublayer_scale.Scale(15.f, 15.f);
expected_transform_with_source_sublayer_scale.MakeIdentity();
expected_transform_with_source_sublayer_scale.Translate(15.f, 15.f);
expected_transform_with_source_sublayer_scale.Scale(15.f, 15.f);
expected_transform_with_source_sublayer_scale.Scale(1.f / 30.f, 1.f / 30.f);
success = tree.ComputeTransform(grand_child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_without_sublayer_scale,
transform);
success = tree.ComputeTransformWithDestinationSublayerScale(
grand_child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_with_dest_sublayer_scale,
transform);
success = tree.ComputeTransformWithSourceSublayerScale(
grand_child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform_with_source_sublayer_scale,
transform);
}
TEST(PropertyTreeTest, ComputeTransformToTargetWithZeroSublayerScale) {
TransformTree tree;
TransformNode& root = *tree.Node(0);
root.data.target_id = 0;
tree.UpdateTransforms(0);
TransformNode grand_parent;
grand_parent.data.local.Scale(2.f, 0.f);
grand_parent.data.target_id = 0;
grand_parent.data.source_node_id = 0;
grand_parent.data.needs_sublayer_scale = true;
int grand_parent_id = tree.Insert(grand_parent, 0);
tree.Node(grand_parent_id)->data.content_target_id = grand_parent_id;
tree.UpdateTransforms(grand_parent_id);
TransformNode parent;
parent.data.local.Translate(1.f, 1.f);
parent.data.target_id = grand_parent_id;
parent.data.content_target_id = grand_parent_id;
parent.data.source_node_id = grand_parent_id;
int parent_id = tree.Insert(parent, grand_parent_id);
tree.UpdateTransforms(parent_id);
TransformNode child;
child.data.local.Translate(3.f, 4.f);
child.data.target_id = grand_parent_id;
child.data.content_target_id = grand_parent_id;
child.data.source_node_id = parent_id;
int child_id = tree.Insert(child, parent_id);
tree.UpdateTransforms(child_id);
gfx::Transform expected_transform;
expected_transform.Translate(4.f, 5.f);
gfx::Transform transform;
bool success = tree.ComputeTransform(child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform, transform);
tree.Node(grand_parent_id)->data.local.MakeIdentity();
tree.Node(grand_parent_id)->data.local.Scale(0.f, 2.f);
tree.Node(grand_parent_id)->data.needs_local_transform_update = true;
tree.set_needs_update(true);
ComputeTransforms(&tree);
success = tree.ComputeTransform(child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform, transform);
tree.Node(grand_parent_id)->data.local.MakeIdentity();
tree.Node(grand_parent_id)->data.local.Scale(0.f, 0.f);
tree.Node(grand_parent_id)->data.needs_local_transform_update = true;
tree.set_needs_update(true);
ComputeTransforms(&tree);
success = tree.ComputeTransform(child_id, grand_parent_id, &transform);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(expected_transform, transform);
}
TEST(PropertyTreeTest, FlatteningWhenDestinationHasOnlyFlatAncestors) {
// This tests that flattening is performed correctly when
// destination and its ancestors are flat, but there are 3d transforms
// and flattening between the source and destination.
TransformTree tree;
int parent = tree.Insert(TransformNode(), 0);
tree.Node(parent)->data.content_target_id = parent;
tree.Node(parent)->data.target_id = parent;
tree.Node(parent)->data.source_node_id = 0;
tree.Node(parent)->data.local.Translate(2, 2);
gfx::Transform rotation_about_x;
rotation_about_x.RotateAboutXAxis(15);
int child = tree.Insert(TransformNode(), parent);
tree.Node(child)->data.content_target_id = child;
tree.Node(child)->data.target_id = child;
tree.Node(child)->data.source_node_id = parent;
tree.Node(child)->data.local = rotation_about_x;
int grand_child = tree.Insert(TransformNode(), child);
tree.Node(grand_child)->data.content_target_id = grand_child;
tree.Node(grand_child)->data.target_id = grand_child;
tree.Node(grand_child)->data.source_node_id = child;
tree.Node(grand_child)->data.flattens_inherited_transform = true;
tree.set_needs_update(true);
ComputeTransforms(&tree);
gfx::Transform flattened_rotation_about_x = rotation_about_x;
flattened_rotation_about_x.FlattenTo2d();
gfx::Transform grand_child_to_parent;
bool success =
tree.ComputeTransform(grand_child, parent, &grand_child_to_parent);
EXPECT_TRUE(success);
EXPECT_TRANSFORMATION_MATRIX_EQ(flattened_rotation_about_x,
grand_child_to_parent);
}
TEST(PropertyTreeTest, ScreenSpaceOpacityUpdateTest) {
// This tests that screen space opacity is updated for the subtree when
// opacity of a node changes.
EffectTree tree;
int parent = tree.Insert(EffectNode(), 0);
int child = tree.Insert(EffectNode(), parent);
EXPECT_EQ(tree.Node(child)->data.screen_space_opacity, 1.f);
tree.Node(parent)->data.opacity = 0.5f;
tree.set_needs_update(true);
ComputeOpacities(&tree);
EXPECT_EQ(tree.Node(child)->data.screen_space_opacity, 0.5f);
tree.Node(child)->data.opacity = 0.5f;
tree.set_needs_update(true);
ComputeOpacities(&tree);
EXPECT_EQ(tree.Node(child)->data.screen_space_opacity, 0.25f);
}
TEST(PropertyTreeTest, NonIntegerTranslationTest) {
// This tests that when a node has non-integer translation, the information
// is propagated to the subtree.
TransformTree tree;
int parent = tree.Insert(TransformNode(), 0);
tree.Node(parent)->data.target_id = parent;
tree.Node(parent)->data.local.Translate(1.5f, 1.5f);
int child = tree.Insert(TransformNode(), parent);
tree.Node(child)->data.target_id = parent;
tree.Node(child)->data.local.Translate(1, 1);
tree.set_needs_update(true);
ComputeTransforms(&tree);
EXPECT_FALSE(
tree.Node(parent)->data.node_and_ancestors_have_only_integer_translation);
EXPECT_FALSE(
tree.Node(child)->data.node_and_ancestors_have_only_integer_translation);
tree.Node(parent)->data.local.Translate(0.5f, 0.5f);
tree.Node(child)->data.local.Translate(0.5f, 0.5f);
tree.set_needs_update(true);
ComputeTransforms(&tree);
EXPECT_TRUE(
tree.Node(parent)->data.node_and_ancestors_have_only_integer_translation);
EXPECT_FALSE(
tree.Node(child)->data.node_and_ancestors_have_only_integer_translation);
tree.Node(child)->data.local.Translate(0.5f, 0.5f);
tree.Node(child)->data.target_id = child;
tree.set_needs_update(true);
ComputeTransforms(&tree);
EXPECT_TRUE(
tree.Node(parent)->data.node_and_ancestors_have_only_integer_translation);
EXPECT_TRUE(
tree.Node(child)->data.node_and_ancestors_have_only_integer_translation);
}
} // namespace cc
|