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

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

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: . Created 3 years, 7 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 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 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 gfx::PointF(), gfx::Size()); 1984 gfx::PointF(), gfx::Size());
1985 LayerImpl* copy = 1985 LayerImpl* copy =
1986 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), 1986 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f),
1987 gfx::Size(200, 400)); 1987 gfx::Size(200, 400));
1988 this->AddCopyRequest(copy); 1988 this->AddCopyRequest(copy);
1989 LayerImpl* copy_child = this->CreateDrawingLayer( 1989 LayerImpl* copy_child = this->CreateDrawingLayer(
1990 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); 1990 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true);
1991 1991
1992 // The |copy| layer is hidden but since it is being copied, it will be 1992 // The |copy| layer is hidden but since it is being copied, it will be
1993 // drawn. 1993 // drawn.
1994 hide->test_properties()->hide_layer_and_subtree = true; 1994 hide->test_properties()->opacity = 0.f;
1995 1995
1996 this->CalcDrawEtc(root); 1996 this->CalcDrawEtc(root);
1997 1997
1998 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 1998 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
1999 1999
2000 this->VisitLayer(copy_child, &occlusion); 2000 this->VisitLayer(copy_child, &occlusion);
2001 EXPECT_EQ(gfx::Rect().ToString(), 2001 EXPECT_EQ(gfx::Rect().ToString(),
2002 occlusion.occlusion_from_outside_target().ToString()); 2002 occlusion.occlusion_from_outside_target().ToString());
2003 EXPECT_EQ(gfx::Rect(200, 400).ToString(), 2003 EXPECT_EQ(gfx::Rect(200, 400).ToString(),
2004 occlusion.occlusion_from_inside_target().ToString()); 2004 occlusion.occlusion_from_inside_target().ToString());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 EXPECT_EQ(gfx::Rect(), 2432 EXPECT_EQ(gfx::Rect(),
2433 occlusion.UnoccludedSurfaceContentRect( 2433 occlusion.UnoccludedSurfaceContentRect(
2434 surface, gfx::Rect(80, 70, 50, 50))); 2434 surface, gfx::Rect(80, 70, 50, 50)));
2435 } 2435 }
2436 }; 2436 };
2437 2437
2438 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2438 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2439 2439
2440 } // namespace 2440 } // namespace
2441 } // namespace cc 2441 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698