OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/damage_tracker.h" | 5 #include "cc/trees/damage_tracker.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 LayerImpl::Create(host_impl_.active_tree(), 6); | 1465 LayerImpl::Create(host_impl_.active_tree(), 6); |
1466 grand_child1_replica->SetPosition(gfx::PointF()); | 1466 grand_child1_replica->SetPosition(gfx::PointF()); |
1467 | 1467 |
1468 // This is the anchor being tested. | 1468 // This is the anchor being tested. |
1469 grand_child1_replica->test_properties()->transform_origin = | 1469 grand_child1_replica->test_properties()->transform_origin = |
1470 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f); | 1470 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f); |
1471 gfx::Transform reflection; | 1471 gfx::Transform reflection; |
1472 reflection.Scale3d(-1.0, 1.0, 1.0); | 1472 reflection.Scale3d(-1.0, 1.0, 1.0); |
1473 grand_child1_replica->SetTransform(reflection); | 1473 grand_child1_replica->SetTransform(reflection); |
1474 // We need to set parent on replica layer for property tree building. | 1474 // We need to set parent on replica layer for property tree building. |
1475 grand_child1_replica->SetParent(grand_child1); | 1475 grand_child1_replica->test_properties()->parent = grand_child1; |
1476 grand_child1->test_properties()->SetReplicaLayer( | 1476 grand_child1->test_properties()->SetReplicaLayer( |
1477 std::move(grand_child1_replica)); | 1477 std::move(grand_child1_replica)); |
1478 grand_child1->test_properties()->force_render_surface = true; | 1478 grand_child1->test_properties()->force_render_surface = true; |
1479 } | 1479 } |
1480 LayerImpl* grand_child1_replica = | 1480 LayerImpl* grand_child1_replica = |
1481 grand_child1->test_properties()->replica_layer; | 1481 grand_child1->test_properties()->replica_layer; |
1482 | 1482 |
1483 // Set up the mask layer on the replica layer | 1483 // Set up the mask layer on the replica layer |
1484 { | 1484 { |
1485 std::unique_ptr<LayerImpl> replica_mask_layer = | 1485 std::unique_ptr<LayerImpl> replica_mask_layer = |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 gfx::Rect root_damage_rect = | 1637 gfx::Rect root_damage_rect = |
1638 root->render_surface()->damage_tracker()->current_damage_rect(); | 1638 root->render_surface()->damage_tracker()->current_damage_rect(); |
1639 gfx::Rect damage_we_care_about = gfx::Rect(i, i); | 1639 gfx::Rect damage_we_care_about = gfx::Rect(i, i); |
1640 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); | 1640 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); |
1641 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); | 1641 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); |
1642 } | 1642 } |
1643 } | 1643 } |
1644 | 1644 |
1645 } // namespace | 1645 } // namespace |
1646 } // namespace cc | 1646 } // namespace cc |
OLD | NEW |