| 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 scoped_ptr<LayerImpl> grand_child1_replica = | 1385 scoped_ptr<LayerImpl> grand_child1_replica = |
| 1386 LayerImpl::Create(host_impl_.active_tree(), 6); | 1386 LayerImpl::Create(host_impl_.active_tree(), 6); |
| 1387 grand_child1_replica->SetPosition(gfx::PointF()); | 1387 grand_child1_replica->SetPosition(gfx::PointF()); |
| 1388 | 1388 |
| 1389 // This is the anchor being tested. | 1389 // This is the anchor being tested. |
| 1390 grand_child1_replica->SetTransformOrigin( | 1390 grand_child1_replica->SetTransformOrigin( |
| 1391 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f)); | 1391 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f)); |
| 1392 gfx::Transform reflection; | 1392 gfx::Transform reflection; |
| 1393 reflection.Scale3d(-1.0, 1.0, 1.0); | 1393 reflection.Scale3d(-1.0, 1.0, 1.0); |
| 1394 grand_child1_replica->SetTransform(reflection); | 1394 grand_child1_replica->SetTransform(reflection); |
| 1395 // We need to set parent on replica layer for property tree building. |
| 1396 grand_child1_replica->SetParent(grand_child1); |
| 1395 grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); | 1397 grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); |
| 1396 grand_child1->SetForceRenderSurface(true); | 1398 grand_child1->SetForceRenderSurface(true); |
| 1397 } | 1399 } |
| 1398 LayerImpl* grand_child1_replica = grand_child1->replica_layer(); | 1400 LayerImpl* grand_child1_replica = grand_child1->replica_layer(); |
| 1399 | 1401 |
| 1400 // Set up the mask layer on the replica layer | 1402 // Set up the mask layer on the replica layer |
| 1401 { | 1403 { |
| 1402 scoped_ptr<LayerImpl> replica_mask_layer = | 1404 scoped_ptr<LayerImpl> replica_mask_layer = |
| 1403 LayerImpl::Create(host_impl_.active_tree(), 7); | 1405 LayerImpl::Create(host_impl_.active_tree(), 7); |
| 1404 replica_mask_layer->SetPosition(gfx::PointF()); | 1406 replica_mask_layer->SetPosition(gfx::PointF()); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 gfx::Rect root_damage_rect = | 1559 gfx::Rect root_damage_rect = |
| 1558 root->render_surface()->damage_tracker()->current_damage_rect(); | 1560 root->render_surface()->damage_tracker()->current_damage_rect(); |
| 1559 gfx::Rect damage_we_care_about = gfx::Rect(i, i); | 1561 gfx::Rect damage_we_care_about = gfx::Rect(i, i); |
| 1560 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); | 1562 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); |
| 1561 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); | 1563 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); |
| 1562 } | 1564 } |
| 1563 } | 1565 } |
| 1564 | 1566 |
| 1565 } // namespace | 1567 } // namespace |
| 1566 } // namespace cc | 1568 } // namespace cc |
| OLD | NEW |