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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1912893002: cc : Stop pushing properties not used by LayerImpl to LayerImpl. (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index ece381a366a7e456574bf006e500136f34bbb751..60a408ef097db8a563890a4e26b33cf2ec5d9f02 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1593,7 +1593,7 @@ TEST_F(LayerTreeHostCommonTest, ForceRenderSurface) {
gfx::PointF(), gfx::Size(10, 10), true, false);
child->SetDrawsContent(true);
- render_surface1->SetForceRenderSurface(true);
+ render_surface1->test_properties()->force_render_surface = true;
{
ExecuteCalculateDrawPropertiesWithPropertyTrees(parent);
@@ -1604,7 +1604,7 @@ TEST_F(LayerTreeHostCommonTest, ForceRenderSurface) {
}
{
- render_surface1->SetForceRenderSurface(false);
+ render_surface1->test_properties()->force_render_surface = false;
render_surface1->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawPropertiesWithPropertyTrees(parent);
EXPECT_TRUE(parent->has_render_surface());
@@ -2312,9 +2312,9 @@ TEST_F(LayerTreeHostCommonTest, ClipRectWhenCannotRenderToSeparateSurface) {
// Case 1: Nothing is clipped. In this case, each layer's clip rect is its
// bounds in target space. The only thing that changes when surfaces are
// disabled is that target space is always screen space.
- root->SetForceRenderSurface(true);
- child1->SetForceRenderSurface(true);
- grand_child->SetForceRenderSurface(true);
+ root->test_properties()->force_render_surface = true;
+ child1->test_properties()->force_render_surface = true;
+ grand_child->test_properties()->force_render_surface = true;
ExecuteCalculateDrawProperties(root);
EXPECT_TRUE(root->has_render_surface());
EXPECT_FALSE(parent->has_render_surface());
@@ -2350,9 +2350,9 @@ TEST_F(LayerTreeHostCommonTest, ClipRectWhenCannotRenderToSeparateSurface) {
// render surface are clipped by the root's bounds.
root->SetMasksToBounds(true);
host_impl()->active_tree()->property_trees()->needs_rebuild = true;
- root->SetForceRenderSurface(true);
- child1->SetForceRenderSurface(true);
- grand_child->SetForceRenderSurface(true);
+ root->test_properties()->force_render_surface = true;
+ child1->test_properties()->force_render_surface = true;
+ grand_child->test_properties()->force_render_surface = true;
ExecuteCalculateDrawProperties(root);
EXPECT_TRUE(root->has_render_surface());
EXPECT_FALSE(parent->has_render_surface());
@@ -2403,9 +2403,9 @@ TEST_F(LayerTreeHostCommonTest, ClipRectWhenCannotRenderToSeparateSurface) {
parent->SetMasksToBounds(true);
child1->SetMasksToBounds(true);
host_impl()->active_tree()->property_trees()->needs_rebuild = true;
- root->SetForceRenderSurface(true);
- child1->SetForceRenderSurface(true);
- grand_child->SetForceRenderSurface(true);
+ root->test_properties()->force_render_surface = true;
+ child1->test_properties()->force_render_surface = true;
+ grand_child->test_properties()->force_render_surface = true;
ExecuteCalculateDrawProperties(root);
EXPECT_TRUE(root->has_render_surface());
EXPECT_FALSE(parent->has_render_surface());
@@ -4396,14 +4396,18 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithPreserves3d) {
AddReplicaLayer<LayerImpl>(back_facing_surface);
// Nothing is double-sided
- front_facing_child->SetDoubleSided(false);
- back_facing_child->SetDoubleSided(false);
- front_facing_surface->SetDoubleSided(false);
- back_facing_surface->SetDoubleSided(false);
- front_facing_child_of_front_facing_surface->SetDoubleSided(false);
- back_facing_child_of_front_facing_surface->SetDoubleSided(false);
- front_facing_child_of_back_facing_surface->SetDoubleSided(false);
- back_facing_child_of_back_facing_surface->SetDoubleSided(false);
+ front_facing_child->test_properties()->double_sided = false;
+ back_facing_child->test_properties()->double_sided = false;
+ front_facing_surface->test_properties()->double_sided = false;
+ back_facing_surface->test_properties()->double_sided = false;
+ front_facing_child_of_front_facing_surface->test_properties()->double_sided =
+ false;
+ back_facing_child_of_front_facing_surface->test_properties()->double_sided =
+ false;
+ front_facing_child_of_back_facing_surface->test_properties()->double_sided =
+ false;
+ back_facing_child_of_back_facing_surface->test_properties()->double_sided =
+ false;
// Everything draws content.
front_facing_child->SetDrawsContent(true);
@@ -4520,7 +4524,7 @@ TEST_F(LayerTreeHostCommonTest, BackFaceCullingWithAnimatingTransforms) {
backface_matrix.Translate(-50.0, -50.0);
// Make our render surface.
- animating_surface->SetForceRenderSurface(true);
+ animating_surface->SetForceRenderSurfaceForTesting(true);
// Animate the transform on the render surface.
AddAnimatedTransformToLayerWithPlayer(animating_surface->id(), timeline(),
@@ -6462,9 +6466,9 @@ TEST_F(LayerTreeHostCommonTest, DoNotIncludeBackfaceInvisibleSurfaces) {
root->Set3dSortingContextId(1);
back_facing->Set3dSortingContextId(1);
back_facing->SetShouldFlattenTransform(false);
- render_surface1->SetDoubleSided(false);
+ render_surface1->test_properties()->double_sided = false;
render_surface2->Set3dSortingContextId(2);
- render_surface2->SetDoubleSided(false);
+ render_surface2->test_properties()->double_sided = false;
ExecuteCalculateDrawProperties(root);
@@ -6508,7 +6512,7 @@ TEST_F(LayerTreeHostCommonTest, DoNotIncludeBackfaceInvisibleLayers) {
LayerImpl* grand_child = AddChild<LayerImpl>(child);
grand_child->SetDrawsContent(true);
- child->SetDoubleSided(false);
+ child->test_properties()->double_sided = false;
grand_child->SetUseParentBackfaceVisibility(true);
gfx::Transform identity_transform;
@@ -6572,7 +6576,7 @@ TEST_F(LayerTreeHostCommonTest, DoNotIncludeBackfaceInvisibleLayers) {
EXPECT_TRUE(grand_child->use_local_transform_for_backface_visibility());
grand_child->SetUseParentBackfaceVisibility(false);
- grand_child->SetDoubleSided(false);
+ grand_child->test_properties()->double_sided = false;
grand_child->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(root);
@@ -7000,7 +7004,7 @@ TEST_F(LayerTreeHostCommonTest, FixedPositionWithInterveningRenderSurface) {
child->SetDrawsContent(true);
root->SetIsContainerForFixedPositionLayers(true);
- render_surface->SetForceRenderSurface(true);
+ render_surface->test_properties()->force_render_surface = true;
LayerPositionConstraint constraint;
constraint.set_is_fixed_position(true);
@@ -7899,7 +7903,7 @@ TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) {
root->AddChild(std::move(child1));
root->AddChild(std::move(child2));
- root->SetForceRenderSurface(true);
+ root->test_properties()->force_render_surface = true;
root->SetDrawsContent(true);
host_impl.active_tree()->SetRootLayer(std::move(root));
@@ -8220,7 +8224,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectForAnimatedLayer) {
gfx::PointF(), gfx::Size(20, 20), true, false);
root->SetMasksToBounds(true);
- root->SetForceRenderSurface(true);
+ root->SetForceRenderSurfaceForTesting(true);
animated->SetOpacity(0.f);
AddOpacityTransitionToLayerWithPlayer(animated->id(), timeline(), 10.0, 0.f,
@@ -8248,7 +8252,7 @@ TEST_F(LayerTreeHostCommonTest,
surface->AddChild(descendant_of_animation);
clip->SetMasksToBounds(true);
- surface->SetForceRenderSurface(true);
+ surface->SetForceRenderSurfaceForTesting(true);
host()->SetRootLayer(root);
@@ -8918,7 +8922,7 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayerImpl) {
// A double sided render surface with backface visible should not be skipped
grandchild_ptr->set_visible_layer_rect(gfx::Rect());
child_ptr->SetHasRenderSurface(true);
- child_ptr->SetDoubleSided(true);
+ child_ptr->test_properties()->double_sided = true;
child_ptr->SetTransform(rotate_back_and_translate);
root_ptr->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawPropertiesWithPropertyTrees(root_ptr);
@@ -9110,13 +9114,13 @@ TEST_F(LayerTreeHostCommonTest, SkippingLayer) {
child->SetBounds(gfx::Size(10, 10));
gfx::Transform rotate;
- child->SetDoubleSided(false);
+ child->test_properties()->double_sided = false;
rotate.RotateAboutXAxis(180.f);
child->SetTransform(rotate);
root->layer_tree_impl()->property_trees()->needs_rebuild = true;
ExecuteCalculateDrawProperties(root);
EXPECT_EQ(gfx::Rect(0, 0), child->visible_layer_rect());
- child->SetDoubleSided(true);
+ child->test_properties()->double_sided = true;
child->SetTransform(identity);
child->SetOpacity(0.f);
@@ -9244,11 +9248,11 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceClipsSubtree) {
SetLayerPropertiesForTesting(test_layer, identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(30, 30), true, false);
- root->SetForceRenderSurface(true);
- significant_transform->SetForceRenderSurface(false);
- layer_clips_subtree->SetForceRenderSurface(true);
- render_surface->SetForceRenderSurface(true);
- test_layer->SetForceRenderSurface(false);
+ root->test_properties()->force_render_surface = true;
+ significant_transform->test_properties()->force_render_surface = false;
+ layer_clips_subtree->test_properties()->force_render_surface = true;
+ render_surface->test_properties()->force_render_surface = true;
+ test_layer->test_properties()->force_render_surface = false;
ExecuteCalculateDrawProperties(root);
TransformTree transform_tree =

Powered by Google App Engine
This is Rietveld 408576698