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

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

Issue 1588093004: Compute if a layer is drawn without LayerTree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/layer_animation_controller.h" 9 #include "cc/animation/layer_animation_controller.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 gfx::PointF(), gfx::Size()); 2065 gfx::PointF(), gfx::Size());
2066 LayerImpl* copy = 2066 LayerImpl* copy =
2067 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), 2067 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f),
2068 gfx::Size(200, 400)); 2068 gfx::Size(200, 400));
2069 this->AddCopyRequest(copy); 2069 this->AddCopyRequest(copy);
2070 LayerImpl* copy_child = this->CreateDrawingLayer( 2070 LayerImpl* copy_child = this->CreateDrawingLayer(
2071 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); 2071 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true);
2072 2072
2073 // The |copy| layer is hidden but since it is being copied, it will be 2073 // The |copy| layer is hidden but since it is being copied, it will be
2074 // drawn. 2074 // drawn.
2075 hide->SetHideLayerAndSubtree(true); 2075 hide->SetOpacity(0.f);
2076 2076
2077 this->CalcDrawEtc(root); 2077 this->CalcDrawEtc(root);
2078 2078
2079 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 2079 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
2080 2080
2081 this->VisitLayer(copy_child, &occlusion); 2081 this->VisitLayer(copy_child, &occlusion);
2082 EXPECT_EQ(gfx::Rect().ToString(), 2082 EXPECT_EQ(gfx::Rect().ToString(),
2083 occlusion.occlusion_from_outside_target().ToString()); 2083 occlusion.occlusion_from_outside_target().ToString());
2084 EXPECT_EQ(gfx::Rect(200, 400).ToString(), 2084 EXPECT_EQ(gfx::Rect(200, 400).ToString(),
2085 occlusion.occlusion_from_inside_target().ToString()); 2085 occlusion.occlusion_from_inside_target().ToString());
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 EXPECT_EQ(gfx::Rect(), 2513 EXPECT_EQ(gfx::Rect(),
2514 occlusion.UnoccludedSurfaceContentRect( 2514 occlusion.UnoccludedSurfaceContentRect(
2515 surface, gfx::Rect(80, 70, 50, 50))); 2515 surface, gfx::Rect(80, 70, 50, 50)));
2516 } 2516 }
2517 }; 2517 };
2518 2518
2519 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2519 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2520 2520
2521 } // namespace 2521 } // namespace
2522 } // namespace cc 2522 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698