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

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

Issue 1850493002: cc : Remove parent for mask and replica layers in LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete dead code Created 4 years, 8 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
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 grand_child1_replica->SetParent(grand_child1);
ajuma 2016/03/30 21:56:05 Why do tests still need to set the parent of mask
jaydasika 2016/03/30 21:59:32 We don't need parent for masks but need it for rep
ajuma 2016/03/30 22:02:52 Oh, ok. Do we have other tests that construct repl
jaydasika 2016/03/30 22:10:08 There are many tests. One random example : LayerTr
ajuma 2016/03/30 23:00:09 Thanks for checking. Please add a comment here (an
jaydasika 2016/03/30 23:29:46 Done.
1395 grand_child1->SetReplicaLayer(std::move(grand_child1_replica)); 1396 grand_child1->SetReplicaLayer(std::move(grand_child1_replica));
1396 grand_child1->SetForceRenderSurface(true); 1397 grand_child1->SetForceRenderSurface(true);
1397 } 1398 }
1398 LayerImpl* grand_child1_replica = grand_child1->replica_layer(); 1399 LayerImpl* grand_child1_replica = grand_child1->replica_layer();
1399 1400
1400 // Set up the mask layer on the replica layer 1401 // Set up the mask layer on the replica layer
1401 { 1402 {
1402 scoped_ptr<LayerImpl> replica_mask_layer = 1403 scoped_ptr<LayerImpl> replica_mask_layer =
1403 LayerImpl::Create(host_impl_.active_tree(), 7); 1404 LayerImpl::Create(host_impl_.active_tree(), 7);
1404 replica_mask_layer->SetPosition(gfx::PointF()); 1405 replica_mask_layer->SetPosition(gfx::PointF());
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 gfx::Rect root_damage_rect = 1558 gfx::Rect root_damage_rect =
1558 root->render_surface()->damage_tracker()->current_damage_rect(); 1559 root->render_surface()->damage_tracker()->current_damage_rect();
1559 gfx::Rect damage_we_care_about = gfx::Rect(i, i); 1560 gfx::Rect damage_we_care_about = gfx::Rect(i, i);
1560 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right()); 1561 EXPECT_LE(damage_we_care_about.right(), root_damage_rect.right());
1561 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom()); 1562 EXPECT_LE(damage_we_care_about.bottom(), root_damage_rect.bottom());
1562 } 1563 }
1563 } 1564 }
1564 1565
1565 } // namespace 1566 } // namespace
1566 } // namespace cc 1567 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698