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

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: Rendering context now in Layers, removed is_3d_sorted 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 // Set rendering context ID to 1 for 3D sorting
danakj 2014/06/15 18:15:36 comment nit: stick a period on the end, comments s
troyhildebrandt 2014/06/17 00:29:43 Removed the comment instead, since the method name
3958 back_facing_surface->SetIs3dSorted(true); 3958 front_facing_surface->SetRenderingContextId(1);
3959 back_facing_surface->SetRenderingContextId(1);
3959 3960
3960 RenderSurfaceLayerList render_surface_layer_list; 3961 RenderSurfaceLayerList render_surface_layer_list;
3961 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( 3962 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
3962 parent.get(), parent->bounds(), &render_surface_layer_list); 3963 parent.get(), parent->bounds(), &render_surface_layer_list);
3963 inputs.can_adjust_raster_scales = true; 3964 inputs.can_adjust_raster_scales = true;
3964 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 3965 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
3965 3966
3966 // Verify which render surfaces were created. 3967 // Verify which render surfaces were created.
3967 EXPECT_TRUE(front_facing_surface->render_surface()); 3968 EXPECT_TRUE(front_facing_surface->render_surface());
3968 EXPECT_FALSE( 3969 EXPECT_FALSE(
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after
6923 child2->SetDrawsContent(true); 6924 child2->SetDrawsContent(true);
6924 SetLayerPropertiesForTesting(child3.get(), 6925 SetLayerPropertiesForTesting(child3.get(),
6925 identity_matrix, 6926 identity_matrix,
6926 transform_origin, 6927 transform_origin,
6927 position, 6928 position,
6928 bounds, 6929 bounds,
6929 true, 6930 true,
6930 false); 6931 false);
6931 child3->SetDrawsContent(true); 6932 child3->SetDrawsContent(true);
6932 6933
6933 child2->SetIs3dSorted(true); 6934 // Set rendering context ID to 1 for 3D sorting
6934 child3->SetIs3dSorted(true); 6935 child2->SetRenderingContextId(1);
6936 child3->SetRenderingContextId(1);
6935 6937
6936 child2->AddChild(child3.Pass()); 6938 child2->AddChild(child3.Pass());
6937 child1->AddChild(child2.Pass()); 6939 child1->AddChild(child2.Pass());
6938 root->AddChild(child1.Pass()); 6940 root->AddChild(child1.Pass());
6939 6941
6940 { 6942 {
6941 LayerImplList render_surface_layer_list; 6943 LayerImplList render_surface_layer_list;
6942 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 6944 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
6943 root.get(), root->bounds(), &render_surface_layer_list); 6945 root.get(), root->bounds(), &render_surface_layer_list);
6944 inputs.can_render_to_separate_surface = true; 6946 inputs.can_render_to_separate_surface = true;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
6984 true); 6986 true);
6985 SetLayerPropertiesForTesting(child.get(), 6987 SetLayerPropertiesForTesting(child.get(),
6986 identity_transform, 6988 identity_transform,
6987 gfx::Point3F(), 6989 gfx::Point3F(),
6988 gfx::PointF(), 6990 gfx::PointF(),
6989 gfx::Size(20, 20), 6991 gfx::Size(20, 20),
6990 true, 6992 true,
6991 false); 6993 false);
6992 6994
6993 root->SetShouldFlattenTransform(false); 6995 root->SetShouldFlattenTransform(false);
6994 root->SetIs3dSorted(true); 6996 // Set rendering context ID to 1 for 3D sorting
6997 root->SetRenderingContextId(1);
6995 render_surface->SetDoubleSided(false); 6998 render_surface->SetDoubleSided(false);
6996 render_surface->SetForceRenderSurface(true); 6999 render_surface->SetForceRenderSurface(true);
6997 7000
6998 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); 7001 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
6999 host->SetRootLayer(root); 7002 host->SetRootLayer(root);
7000 7003
7001 ExecuteCalculateDrawProperties(root.get()); 7004 ExecuteCalculateDrawProperties(root.get());
7002 7005
7003 EXPECT_EQ(2u, render_surface_layer_list()->size()); 7006 EXPECT_EQ(2u, render_surface_layer_list()->size());
7004 EXPECT_EQ(1u, 7007 EXPECT_EQ(1u,
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
7612 true); 7615 true);
7613 SetLayerPropertiesForTesting(bottom_content.get(), 7616 SetLayerPropertiesForTesting(bottom_content.get(),
7614 bottom_transform, 7617 bottom_transform,
7615 gfx::Point3F(), 7618 gfx::Point3F(),
7616 gfx::PointF(), 7619 gfx::PointF(),
7617 gfx::Size(50, 50), 7620 gfx::Size(50, 50),
7618 false, 7621 false,
7619 true); 7622 true);
7620 7623
7621 scroll_child->SetShouldFlattenTransform(false); 7624 scroll_child->SetShouldFlattenTransform(false);
7622 scroll_child->SetIs3dSorted(true); 7625 // Set rendering context ID to 1 for 3D sorting
7626 scroll_child->SetRenderingContextId(1);
7623 7627
7624 scroll_child->AddChild(top_content.Pass()); 7628 scroll_child->AddChild(top_content.Pass());
7625 scroll_child->AddChild(bottom_content.Pass()); 7629 scroll_child->AddChild(bottom_content.Pass());
7626 root->AddChild(scroll_child.Pass()); 7630 root->AddChild(scroll_child.Pass());
7627 7631
7628 scroll_parent_clip->AddChild(scroll_parent.Pass()); 7632 scroll_parent_clip->AddChild(scroll_parent.Pass());
7629 scroll_parent_border->AddChild(scroll_parent_clip.Pass()); 7633 scroll_parent_border->AddChild(scroll_parent_clip.Pass());
7630 root->AddChild(scroll_parent_border.Pass()); 7634 root->AddChild(scroll_parent_border.Pass());
7631 7635
7632 LayerImplList render_surface_layer_list; 7636 LayerImplList render_surface_layer_list;
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
8307 expected.insert(child_raw); 8311 expected.insert(child_raw);
8308 expected.insert(grand_child1_raw); 8312 expected.insert(grand_child1_raw);
8309 expected.insert(grand_child2_raw); 8313 expected.insert(grand_child2_raw);
8310 8314
8311 actual.clear(); 8315 actual.clear();
8312 GatherDrawnLayers(render_surface_layer_list_impl(), &actual); 8316 GatherDrawnLayers(render_surface_layer_list_impl(), &actual);
8313 EXPECT_EQ(expected, actual); 8317 EXPECT_EQ(expected, actual);
8314 } 8318 }
8315 } // namespace 8319 } // namespace
8316 } // namespace cc 8320 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698