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

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

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: rebase Created 3 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree_builder.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/base/filter_operation.h" 10 #include "cc/base/filter_operation.h"
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 gfx::PointF(), gfx::Size()); 1986 gfx::PointF(), gfx::Size());
1987 LayerImpl* copy = 1987 LayerImpl* copy =
1988 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), 1988 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f),
1989 gfx::Size(200, 400)); 1989 gfx::Size(200, 400));
1990 this->AddCopyRequest(copy); 1990 this->AddCopyRequest(copy);
1991 LayerImpl* copy_child = this->CreateDrawingLayer( 1991 LayerImpl* copy_child = this->CreateDrawingLayer(
1992 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); 1992 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true);
1993 1993
1994 // The |copy| layer is hidden but since it is being copied, it will be 1994 // The |copy| layer is hidden but since it is being copied, it will be
1995 // drawn. 1995 // drawn.
1996 hide->test_properties()->hide_layer_and_subtree = true; 1996 hide->test_properties()->opacity = 0.f;
1997 1997
1998 this->CalcDrawEtc(root); 1998 this->CalcDrawEtc(root);
1999 1999
2000 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 2000 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
2001 2001
2002 this->VisitLayer(copy_child, &occlusion); 2002 this->VisitLayer(copy_child, &occlusion);
2003 EXPECT_EQ(gfx::Rect().ToString(), 2003 EXPECT_EQ(gfx::Rect().ToString(),
2004 occlusion.occlusion_from_outside_target().ToString()); 2004 occlusion.occlusion_from_outside_target().ToString());
2005 EXPECT_EQ(gfx::Rect(200, 400).ToString(), 2005 EXPECT_EQ(gfx::Rect(200, 400).ToString(),
2006 occlusion.occlusion_from_inside_target().ToString()); 2006 occlusion.occlusion_from_inside_target().ToString());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 EXPECT_EQ(gfx::Rect(), 2434 EXPECT_EQ(gfx::Rect(),
2435 occlusion.UnoccludedSurfaceContentRect( 2435 occlusion.UnoccludedSurfaceContentRect(
2436 surface, gfx::Rect(80, 70, 50, 50))); 2436 surface, gfx::Rect(80, 70, 50, 50)));
2437 } 2437 }
2438 }; 2438 };
2439 2439
2440 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2440 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2441 2441
2442 } // namespace 2442 } // namespace
2443 } // namespace cc 2443 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698