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

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

Issue 2615773003: Replace LayerImpl::sorting_context_id with transform reference. (Closed)
Patch Set: Update tests. Created 3 years, 11 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/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 transform.Translate(50.0, 50.0); 1061 transform.Translate(50.0, 50.0);
1062 transform.ApplyPerspectiveDepth(100.0); 1062 transform.ApplyPerspectiveDepth(100.0);
1063 transform.Translate3d(0.0, 0.0, 110.0); 1063 transform.Translate3d(0.0, 0.0, 110.0);
1064 transform.Translate(-50.0, -50.0); 1064 transform.Translate(-50.0, -50.0);
1065 1065
1066 TestContentLayerImpl* parent = this->CreateRoot( 1066 TestContentLayerImpl* parent = this->CreateRoot(
1067 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); 1067 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100));
1068 TestContentLayerImpl* layer = this->CreateDrawingLayer( 1068 TestContentLayerImpl* layer = this->CreateDrawingLayer(
1069 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); 1069 parent, transform, gfx::PointF(), gfx::Size(100, 100), true);
1070 parent->test_properties()->should_flatten_transform = false; 1070 parent->test_properties()->should_flatten_transform = false;
1071 parent->Set3dSortingContextId(1); 1071 parent->test_properties()->sorting_context_id = 1;
1072 layer->test_properties()->should_flatten_transform = false; 1072 layer->test_properties()->should_flatten_transform = false;
1073 layer->Set3dSortingContextId(1); 1073 layer->test_properties()->sorting_context_id = 1;
1074 this->CalcDrawEtc(parent); 1074 this->CalcDrawEtc(parent);
1075 1075
1076 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 1076 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
1077 1077
1078 // The |layer| is entirely behind the camera and should not occlude. 1078 // The |layer| is entirely behind the camera and should not occlude.
1079 this->VisitLayer(layer, &occlusion); 1079 this->VisitLayer(layer, &occlusion);
1080 this->EnterLayer(parent, &occlusion); 1080 this->EnterLayer(parent, &occlusion);
1081 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); 1081 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty());
1082 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); 1082 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty());
1083 } 1083 }
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 EXPECT_EQ(gfx::Rect(), 2425 EXPECT_EQ(gfx::Rect(),
2426 occlusion.UnoccludedSurfaceContentRect( 2426 occlusion.UnoccludedSurfaceContentRect(
2427 surface, gfx::Rect(80, 70, 50, 50))); 2427 surface, gfx::Rect(80, 70, 50, 50)));
2428 } 2428 }
2429 }; 2429 };
2430 2430
2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2432 2432
2433 } // namespace 2433 } // namespace
2434 } // namespace cc 2434 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698