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

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

Issue 2659883003: cc: Remove direct calls to LayerImpl::SetHasRenderSurface from tests (Closed)
Patch Set: Created 3 years, 10 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_impl_unittest.cc ('k') | no next file » | 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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/layers/heads_up_display_layer_impl.h" 9 #include "cc/layers/heads_up_display_layer_impl.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 LayerImpl::Create(host_impl().active_tree(), 4); 1059 LayerImpl::Create(host_impl().active_tree(), 4);
1060 1060
1061 child->SetPosition(gfx::PointF(10.f, 10.f)); 1061 child->SetPosition(gfx::PointF(10.f, 10.f));
1062 child->SetBounds(gfx::Size(1, 1)); 1062 child->SetBounds(gfx::Size(1, 1));
1063 child->SetDrawsContent(true); 1063 child->SetDrawsContent(true);
1064 child->SetMasksToBounds(true); 1064 child->SetMasksToBounds(true);
1065 1065
1066 grand_child->SetPosition(gfx::PointF(0.f, 40.f)); 1066 grand_child->SetPosition(gfx::PointF(0.f, 40.f));
1067 grand_child->SetBounds(gfx::Size(100, 50)); 1067 grand_child->SetBounds(gfx::Size(100, 50));
1068 grand_child->SetDrawsContent(true); 1068 grand_child->SetDrawsContent(true);
1069 grand_child->SetHasRenderSurface(true); 1069 grand_child->test_properties()->force_render_surface = true;
1070 1070
1071 // This should let |grand_child| "escape" |child|'s clip. 1071 // This should let |grand_child| "escape" |child|'s clip.
1072 grand_child->test_properties()->clip_parent = root; 1072 grand_child->test_properties()->clip_parent = root;
1073 std::unique_ptr<std::set<LayerImpl*>> clip_children( 1073 std::unique_ptr<std::set<LayerImpl*>> clip_children(
1074 new std::set<LayerImpl*>); 1074 new std::set<LayerImpl*>);
1075 clip_children->insert(grand_child.get()); 1075 clip_children->insert(grand_child.get());
1076 root->test_properties()->clip_children.reset(clip_children.release()); 1076 root->test_properties()->clip_children.reset(clip_children.release());
1077 1077
1078 child->test_properties()->AddChild(std::move(grand_child)); 1078 child->test_properties()->AddChild(std::move(grand_child));
1079 root->test_properties()->AddChild(std::move(child)); 1079 root->test_properties()->AddChild(std::move(child));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 1111
1112 // This should cause scroll child and its descendants to be affected by 1112 // This should cause scroll child and its descendants to be affected by
1113 // |child|'s clip. 1113 // |child|'s clip.
1114 scroll_child->test_properties()->scroll_parent = child.get(); 1114 scroll_child->test_properties()->scroll_parent = child.get();
1115 child->test_properties()->scroll_children = 1115 child->test_properties()->scroll_children =
1116 base::MakeUnique<std::set<LayerImpl*>>(); 1116 base::MakeUnique<std::set<LayerImpl*>>();
1117 child->test_properties()->scroll_children->insert(scroll_child.get()); 1117 child->test_properties()->scroll_children->insert(scroll_child.get());
1118 1118
1119 grand_child->SetBounds(gfx::Size(200, 200)); 1119 grand_child->SetBounds(gfx::Size(200, 200));
1120 grand_child->SetDrawsContent(true); 1120 grand_child->SetDrawsContent(true);
1121 grand_child->SetHasRenderSurface(true); 1121 grand_child->test_properties()->force_render_surface = true;
1122 1122
1123 scroll_child->test_properties()->AddChild(std::move(grand_child)); 1123 scroll_child->test_properties()->AddChild(std::move(grand_child));
1124 root->test_properties()->AddChild(std::move(scroll_child)); 1124 root->test_properties()->AddChild(std::move(scroll_child));
1125 root->test_properties()->AddChild(std::move(child)); 1125 root->test_properties()->AddChild(std::move(child));
1126 } 1126 }
1127 1127
1128 host_impl().SetViewportSize(root->bounds()); 1128 host_impl().SetViewportSize(root->bounds());
1129 host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); 1129 host_impl().UpdateNumChildrenAndDrawPropertiesForActiveTree();
1130 1130
1131 gfx::PointF test_point(12.f, 52.f); 1131 gfx::PointF test_point(12.f, 52.f);
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2409 auto weak_promise = promise->AsWeakPtr(); 2409 auto weak_promise = promise->AsWeakPtr();
2410 host_impl().active_tree()->QueueSwapPromise(std::move(promise)); 2410 host_impl().active_tree()->QueueSwapPromise(std::move(promise));
2411 host_impl().active_tree()->BreakSwapPromises( 2411 host_impl().active_tree()->BreakSwapPromises(
2412 SwapPromise::DidNotSwapReason::SWAP_FAILS); 2412 SwapPromise::DidNotSwapReason::SWAP_FAILS);
2413 EXPECT_FALSE(weak_promise); 2413 EXPECT_FALSE(weak_promise);
2414 } 2414 }
2415 } 2415 }
2416 2416
2417 } // namespace 2417 } // namespace
2418 } // namespace cc 2418 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698