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

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

Issue 332873005: Rendering context information added to SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed RenderingContextId to 3dSortingContextId for clarity. Created 6 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "cc/animation/layer_animation_controller.h" 9 #include "cc/animation/layer_animation_controller.h"
10 #include "cc/animation/transform_operations.h" 10 #include "cc/animation/transform_operations.h"
(...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after
3947 true, 3947 true,
3948 false); 3948 false);
3949 SetLayerPropertiesForTesting(child2.get(), 3949 SetLayerPropertiesForTesting(child2.get(),
3950 identity_matrix, 3950 identity_matrix,
3951 gfx::Point3F(), 3951 gfx::Point3F(),
3952 gfx::PointF(), 3952 gfx::PointF(),
3953 gfx::Size(100, 100), 3953 gfx::Size(100, 100),
3954 true, 3954 true,
3955 false); 3955 false);
3956 3956
3957 front_facing_surface->SetIs3dSorted(true); 3957 front_facing_surface->Set3dSortingContextId(1);
3958 back_facing_surface->SetIs3dSorted(true); 3958 back_facing_surface->Set3dSortingContextId(1);
3959 3959
3960 RenderSurfaceLayerList render_surface_layer_list; 3960 RenderSurfaceLayerList render_surface_layer_list;
3961 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( 3961 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
3962 parent.get(), parent->bounds(), &render_surface_layer_list); 3962 parent.get(), parent->bounds(), &render_surface_layer_list);
3963 inputs.can_adjust_raster_scales = true; 3963 inputs.can_adjust_raster_scales = true;
3964 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 3964 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
3965 3965
3966 // Verify which render surfaces were created. 3966 // Verify which render surfaces were created.
3967 EXPECT_TRUE(front_facing_surface->render_surface()); 3967 EXPECT_TRUE(front_facing_surface->render_surface());
3968 EXPECT_FALSE( 3968 EXPECT_FALSE(
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after
6923 child2->SetDrawsContent(true); 6923 child2->SetDrawsContent(true);
6924 SetLayerPropertiesForTesting(child3.get(), 6924 SetLayerPropertiesForTesting(child3.get(),
6925 identity_matrix, 6925 identity_matrix,
6926 transform_origin, 6926 transform_origin,
6927 position, 6927 position,
6928 bounds, 6928 bounds,
6929 true, 6929 true,
6930 false); 6930 false);
6931 child3->SetDrawsContent(true); 6931 child3->SetDrawsContent(true);
6932 6932
6933 child2->SetIs3dSorted(true); 6933 child2->Set3dSortingContextId(1);
6934 child3->SetIs3dSorted(true); 6934 child3->Set3dSortingContextId(1);
6935 6935
6936 child2->AddChild(child3.Pass()); 6936 child2->AddChild(child3.Pass());
6937 child1->AddChild(child2.Pass()); 6937 child1->AddChild(child2.Pass());
6938 root->AddChild(child1.Pass()); 6938 root->AddChild(child1.Pass());
6939 6939
6940 { 6940 {
6941 LayerImplList render_surface_layer_list; 6941 LayerImplList render_surface_layer_list;
6942 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 6942 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
6943 root.get(), root->bounds(), &render_surface_layer_list); 6943 root.get(), root->bounds(), &render_surface_layer_list);
6944 inputs.can_render_to_separate_surface = true; 6944 inputs.can_render_to_separate_surface = true;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
6984 true); 6984 true);
6985 SetLayerPropertiesForTesting(child.get(), 6985 SetLayerPropertiesForTesting(child.get(),
6986 identity_transform, 6986 identity_transform,
6987 gfx::Point3F(), 6987 gfx::Point3F(),
6988 gfx::PointF(), 6988 gfx::PointF(),
6989 gfx::Size(20, 20), 6989 gfx::Size(20, 20),
6990 true, 6990 true,
6991 false); 6991 false);
6992 6992
6993 root->SetShouldFlattenTransform(false); 6993 root->SetShouldFlattenTransform(false);
6994 root->SetIs3dSorted(true); 6994 root->Set3dSortingContextId(1);
6995 render_surface->SetDoubleSided(false); 6995 render_surface->SetDoubleSided(false);
6996 render_surface->SetForceRenderSurface(true); 6996 render_surface->SetForceRenderSurface(true);
6997 6997
6998 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); 6998 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
6999 host->SetRootLayer(root); 6999 host->SetRootLayer(root);
7000 7000
7001 ExecuteCalculateDrawProperties(root.get()); 7001 ExecuteCalculateDrawProperties(root.get());
7002 7002
7003 EXPECT_EQ(2u, render_surface_layer_list()->size()); 7003 EXPECT_EQ(2u, render_surface_layer_list()->size());
7004 EXPECT_EQ(1u, 7004 EXPECT_EQ(1u,
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
7612 true); 7612 true);
7613 SetLayerPropertiesForTesting(bottom_content.get(), 7613 SetLayerPropertiesForTesting(bottom_content.get(),
7614 bottom_transform, 7614 bottom_transform,
7615 gfx::Point3F(), 7615 gfx::Point3F(),
7616 gfx::PointF(), 7616 gfx::PointF(),
7617 gfx::Size(50, 50), 7617 gfx::Size(50, 50),
7618 false, 7618 false,
7619 true); 7619 true);
7620 7620
7621 scroll_child->SetShouldFlattenTransform(false); 7621 scroll_child->SetShouldFlattenTransform(false);
7622 scroll_child->SetIs3dSorted(true); 7622 scroll_child->Set3dSortingContextId(1);
7623 7623
7624 scroll_child->AddChild(top_content.Pass()); 7624 scroll_child->AddChild(top_content.Pass());
7625 scroll_child->AddChild(bottom_content.Pass()); 7625 scroll_child->AddChild(bottom_content.Pass());
7626 root->AddChild(scroll_child.Pass()); 7626 root->AddChild(scroll_child.Pass());
7627 7627
7628 scroll_parent_clip->AddChild(scroll_parent.Pass()); 7628 scroll_parent_clip->AddChild(scroll_parent.Pass());
7629 scroll_parent_border->AddChild(scroll_parent_clip.Pass()); 7629 scroll_parent_border->AddChild(scroll_parent_clip.Pass());
7630 root->AddChild(scroll_parent_border.Pass()); 7630 root->AddChild(scroll_parent_border.Pass());
7631 7631
7632 LayerImplList render_surface_layer_list; 7632 LayerImplList render_surface_layer_list;
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
8307 expected.insert(child_raw); 8307 expected.insert(child_raw);
8308 expected.insert(grand_child1_raw); 8308 expected.insert(grand_child1_raw);
8309 expected.insert(grand_child2_raw); 8309 expected.insert(grand_child2_raw);
8310 8310
8311 actual.clear(); 8311 actual.clear();
8312 GatherDrawnLayers(render_surface_layer_list_impl(), &actual); 8312 GatherDrawnLayers(render_surface_layer_list_impl(), &actual);
8313 EXPECT_EQ(expected, actual); 8313 EXPECT_EQ(expected, actual);
8314 } 8314 }
8315 } // namespace 8315 } // namespace
8316 } // namespace cc 8316 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698