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

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

Issue 2053983003: cc : Move LayerImpl::parent to test properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 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 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 LayerImpl::Create(host_impl_.active_tree(), 6); 1460 LayerImpl::Create(host_impl_.active_tree(), 6);
1461 grand_child1_replica->SetPosition(gfx::PointF()); 1461 grand_child1_replica->SetPosition(gfx::PointF());
1462 1462
1463 // This is the anchor being tested. 1463 // This is the anchor being tested.
1464 grand_child1_replica->test_properties()->transform_origin = 1464 grand_child1_replica->test_properties()->transform_origin =
1465 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f); 1465 gfx::Point3F(grand_child1->bounds().width(), 0.f, 0.f);
1466 gfx::Transform reflection; 1466 gfx::Transform reflection;
1467 reflection.Scale3d(-1.0, 1.0, 1.0); 1467 reflection.Scale3d(-1.0, 1.0, 1.0);
1468 grand_child1_replica->SetTransform(reflection); 1468 grand_child1_replica->SetTransform(reflection);
1469 // We need to set parent on replica layer for property tree building. 1469 // We need to set parent on replica layer for property tree building.
1470 grand_child1_replica->SetParent(grand_child1); 1470 grand_child1_replica->test_properties()->parent = grand_child1;
1471 grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); 1471 grand_child1->SetReplicaLayer(std::move(grand_child1_replica));
1472 grand_child1->test_properties()->force_render_surface = true; 1472 grand_child1->test_properties()->force_render_surface = true;
1473 } 1473 }
1474 LayerImpl* grand_child1_replica = grand_child1->replica_layer(); 1474 LayerImpl* grand_child1_replica = grand_child1->replica_layer();
1475 1475
1476 // Set up the mask layer on the replica layer 1476 // Set up the mask layer on the replica layer
1477 { 1477 {
1478 std::unique_ptr<LayerImpl> replica_mask_layer = 1478 std::unique_ptr<LayerImpl> replica_mask_layer =
1479 LayerImpl::Create(host_impl_.active_tree(), 7); 1479 LayerImpl::Create(host_impl_.active_tree(), 7);
1480 replica_mask_layer->SetPosition(gfx::PointF()); 1480 replica_mask_layer->SetPosition(gfx::PointF());
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 gfx::Rect root_damage_rect = 1628 gfx::Rect root_damage_rect =
1629 root->render_surface()->damage_tracker()->current_damage_rect(); 1629 root->render_surface()->damage_tracker()->current_damage_rect();
1630 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1630 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1631 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1631 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1632 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1632 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1633 } 1633 }
1634 } 1634 }
1635 1635
1636 } // namespace 1636 } // namespace
1637 } // namespace cc 1637 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698