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

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

Issue 1231453002: Compute if a layer is clipped outside CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialized is_clipped_ Created 5 years, 5 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_impl.cc ('k') | cc/trees/property_tree_builder.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include "cc/layers/heads_up_display_layer_impl.h" 7 #include "cc/layers/heads_up_display_layer_impl.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 position = gfx::PointF(); 965 position = gfx::PointF();
966 bounds = gfx::Size(200, 200); 966 bounds = gfx::Size(200, 200);
967 SetLayerPropertiesForTesting(scroll_child.get(), identity_matrix, 967 SetLayerPropertiesForTesting(scroll_child.get(), identity_matrix,
968 transform_origin, position, bounds, true, 968 transform_origin, position, bounds, true,
969 false, false); 969 false, false);
970 scroll_child->SetDrawsContent(true); 970 scroll_child->SetDrawsContent(true);
971 971
972 // This should cause scroll child and its descendants to be affected by 972 // This should cause scroll child and its descendants to be affected by
973 // |child|'s clip. 973 // |child|'s clip.
974 scroll_child->SetScrollParent(child.get()); 974 scroll_child->SetScrollParent(child.get());
975 scoped_ptr<std::set<LayerImpl*>> scroll_children(new std::set<LayerImpl*>);
976 scroll_children->insert(scroll_child.get());
977 child->SetScrollChildren(scroll_children.release());
975 978
976 SetLayerPropertiesForTesting(grand_child.get(), identity_matrix, 979 SetLayerPropertiesForTesting(grand_child.get(), identity_matrix,
977 transform_origin, position, bounds, true, 980 transform_origin, position, bounds, true,
978 false, false); 981 false, false);
979 grand_child->SetDrawsContent(true); 982 grand_child->SetDrawsContent(true);
980 grand_child->SetHasRenderSurface(true); 983 grand_child->SetHasRenderSurface(true);
981 984
982 scroll_child->AddChild(grand_child.Pass()); 985 scroll_child->AddChild(grand_child.Pass());
983 root->AddChild(scroll_child.Pass()); 986 root->AddChild(scroll_child.Pass());
984 root->AddChild(child.Pass()); 987 root->AddChild(child.Pass());
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers()); 1973 EXPECT_EQ(0u, host_impl().active_tree()->NumLayers());
1971 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1); 1974 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl().active_tree(), 1);
1972 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2)); 1975 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 2));
1973 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3)); 1976 root->AddChild(LayerImpl::Create(host_impl().active_tree(), 3));
1974 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4)); 1977 root->child_at(1)->AddChild(LayerImpl::Create(host_impl().active_tree(), 4));
1975 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); 1978 EXPECT_EQ(4u, host_impl().active_tree()->NumLayers());
1976 } 1979 }
1977 1980
1978 } // namespace 1981 } // namespace
1979 } // namespace cc 1982 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698