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

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: layer_tree_json_parser fix 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
« no previous file with comments | « cc/trees/layer_tree_host_common_perftest.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3982 matching lines...) Expand 10 before | Expand all | Expand 10 after
3993 true, 3993 true,
3994 false); 3994 false);
3995 SetLayerPropertiesForTesting(child2.get(), 3995 SetLayerPropertiesForTesting(child2.get(),
3996 identity_matrix, 3996 identity_matrix,
3997 gfx::Point3F(), 3997 gfx::Point3F(),
3998 gfx::PointF(), 3998 gfx::PointF(),
3999 gfx::Size(100, 100), 3999 gfx::Size(100, 100),
4000 true, 4000 true,
4001 false); 4001 false);
4002 4002
4003 front_facing_surface->SetIs3dSorted(true); 4003 front_facing_surface->Set3dSortingContextId(1);
4004 back_facing_surface->SetIs3dSorted(true); 4004 back_facing_surface->Set3dSortingContextId(1);
4005 4005
4006 RenderSurfaceLayerList render_surface_layer_list; 4006 RenderSurfaceLayerList render_surface_layer_list;
4007 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( 4007 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
4008 parent.get(), parent->bounds(), &render_surface_layer_list); 4008 parent.get(), parent->bounds(), &render_surface_layer_list);
4009 inputs.can_adjust_raster_scales = true; 4009 inputs.can_adjust_raster_scales = true;
4010 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 4010 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
4011 4011
4012 // Verify which render surfaces were created. 4012 // Verify which render surfaces were created.
4013 EXPECT_TRUE(front_facing_surface->render_surface()); 4013 EXPECT_TRUE(front_facing_surface->render_surface());
4014 EXPECT_FALSE( 4014 EXPECT_FALSE(
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after
6969 child2->SetDrawsContent(true); 6969 child2->SetDrawsContent(true);
6970 SetLayerPropertiesForTesting(child3.get(), 6970 SetLayerPropertiesForTesting(child3.get(),
6971 identity_matrix, 6971 identity_matrix,
6972 transform_origin, 6972 transform_origin,
6973 position, 6973 position,
6974 bounds, 6974 bounds,
6975 true, 6975 true,
6976 false); 6976 false);
6977 child3->SetDrawsContent(true); 6977 child3->SetDrawsContent(true);
6978 6978
6979 child2->SetIs3dSorted(true); 6979 child2->Set3dSortingContextId(1);
6980 child3->SetIs3dSorted(true); 6980 child3->Set3dSortingContextId(1);
6981 6981
6982 child2->AddChild(child3.Pass()); 6982 child2->AddChild(child3.Pass());
6983 child1->AddChild(child2.Pass()); 6983 child1->AddChild(child2.Pass());
6984 root->AddChild(child1.Pass()); 6984 root->AddChild(child1.Pass());
6985 6985
6986 { 6986 {
6987 LayerImplList render_surface_layer_list; 6987 LayerImplList render_surface_layer_list;
6988 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 6988 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
6989 root.get(), root->bounds(), &render_surface_layer_list); 6989 root.get(), root->bounds(), &render_surface_layer_list);
6990 inputs.can_render_to_separate_surface = true; 6990 inputs.can_render_to_separate_surface = true;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
7030 true); 7030 true);
7031 SetLayerPropertiesForTesting(child.get(), 7031 SetLayerPropertiesForTesting(child.get(),
7032 identity_transform, 7032 identity_transform,
7033 gfx::Point3F(), 7033 gfx::Point3F(),
7034 gfx::PointF(), 7034 gfx::PointF(),
7035 gfx::Size(20, 20), 7035 gfx::Size(20, 20),
7036 true, 7036 true,
7037 false); 7037 false);
7038 7038
7039 root->SetShouldFlattenTransform(false); 7039 root->SetShouldFlattenTransform(false);
7040 root->SetIs3dSorted(true); 7040 root->Set3dSortingContextId(1);
7041 render_surface->SetDoubleSided(false); 7041 render_surface->SetDoubleSided(false);
7042 render_surface->SetForceRenderSurface(true); 7042 render_surface->SetForceRenderSurface(true);
7043 7043
7044 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); 7044 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
7045 host->SetRootLayer(root); 7045 host->SetRootLayer(root);
7046 7046
7047 ExecuteCalculateDrawProperties(root.get()); 7047 ExecuteCalculateDrawProperties(root.get());
7048 7048
7049 EXPECT_EQ(2u, render_surface_layer_list()->size()); 7049 EXPECT_EQ(2u, render_surface_layer_list()->size());
7050 EXPECT_EQ(1u, 7050 EXPECT_EQ(1u,
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
7658 true); 7658 true);
7659 SetLayerPropertiesForTesting(bottom_content.get(), 7659 SetLayerPropertiesForTesting(bottom_content.get(),
7660 bottom_transform, 7660 bottom_transform,
7661 gfx::Point3F(), 7661 gfx::Point3F(),
7662 gfx::PointF(), 7662 gfx::PointF(),
7663 gfx::Size(50, 50), 7663 gfx::Size(50, 50),
7664 false, 7664 false,
7665 true); 7665 true);
7666 7666
7667 scroll_child->SetShouldFlattenTransform(false); 7667 scroll_child->SetShouldFlattenTransform(false);
7668 scroll_child->SetIs3dSorted(true); 7668 scroll_child->Set3dSortingContextId(1);
7669 7669
7670 scroll_child->AddChild(top_content.Pass()); 7670 scroll_child->AddChild(top_content.Pass());
7671 scroll_child->AddChild(bottom_content.Pass()); 7671 scroll_child->AddChild(bottom_content.Pass());
7672 root->AddChild(scroll_child.Pass()); 7672 root->AddChild(scroll_child.Pass());
7673 7673
7674 scroll_parent_clip->AddChild(scroll_parent.Pass()); 7674 scroll_parent_clip->AddChild(scroll_parent.Pass());
7675 scroll_parent_border->AddChild(scroll_parent_clip.Pass()); 7675 scroll_parent_border->AddChild(scroll_parent_clip.Pass());
7676 root->AddChild(scroll_parent_border.Pass()); 7676 root->AddChild(scroll_parent_border.Pass());
7677 7677
7678 LayerImplList render_surface_layer_list; 7678 LayerImplList render_surface_layer_list;
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
8593 EXPECT_FLOAT_EQ(4.f, 8593 EXPECT_FLOAT_EQ(4.f,
8594 child1_layer->replica_layer() 8594 child1_layer->replica_layer()
8595 ->mask_layer() 8595 ->mask_layer()
8596 ->draw_properties() 8596 ->draw_properties()
8597 .device_scale_factor); 8597 .device_scale_factor);
8598 EXPECT_FLOAT_EQ(4.f, child2_layer->draw_properties().device_scale_factor); 8598 EXPECT_FLOAT_EQ(4.f, child2_layer->draw_properties().device_scale_factor);
8599 } 8599 }
8600 8600
8601 } // namespace 8601 } // namespace
8602 } // namespace cc 8602 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_perftest.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698