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

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

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Fix flaky LayerTreeHostImplTestScrollbarOpacity.Android Created 3 years, 8 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/base/filter_operations.h" 9 #include "cc/base/filter_operations.h"
10 #include "cc/layers/heads_up_display_layer.h" 10 #include "cc/layers/heads_up_display_layer.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 hw_frame_provider_.set_frame(hw_video_frame_); 964 hw_frame_provider_.set_frame(hw_video_frame_);
965 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); 965 scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
966 966
967 // Enable the hud. 967 // Enable the hud.
968 LayerTreeDebugState debug_state; 968 LayerTreeDebugState debug_state;
969 debug_state.show_property_changed_rects = true; 969 debug_state.show_property_changed_rects = true;
970 layer_tree_host()->SetDebugState(debug_state); 970 layer_tree_host()->SetDebugState(debug_state);
971 971
972 scoped_refptr<PaintedScrollbarLayer> scrollbar = 972 scoped_refptr<PaintedScrollbarLayer> scrollbar =
973 PaintedScrollbarLayer::Create( 973 PaintedScrollbarLayer::Create(
974 std::unique_ptr<Scrollbar>(new FakeScrollbar), layer->id()); 974 std::unique_ptr<Scrollbar>(new FakeScrollbar), layer->id(),
975 layer->element_id());
975 scrollbar->SetBounds(gfx::Size(10, 10)); 976 scrollbar->SetBounds(gfx::Size(10, 10));
976 scrollbar->SetIsDrawable(true); 977 scrollbar->SetIsDrawable(true);
977 root->AddChild(scrollbar); 978 root->AddChild(scrollbar);
978 979
979 layer_tree_host()->SetRootLayer(root); 980 layer_tree_host()->SetRootLayer(root);
980 LayerTreeHostContextTest::SetupTree(); 981 LayerTreeHostContextTest::SetupTree();
981 } 982 }
982 983
983 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 984 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
984 985
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 }; 1080 };
1080 1081
1081 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); 1082 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting);
1082 1083
1083 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { 1084 class ScrollbarLayerLostContext : public LayerTreeHostContextTest {
1084 public: 1085 public:
1085 ScrollbarLayerLostContext() : commits_(0) {} 1086 ScrollbarLayerLostContext() : commits_(0) {}
1086 1087
1087 void BeginTest() override { 1088 void BeginTest() override {
1088 scoped_refptr<Layer> scroll_layer = Layer::Create(); 1089 scoped_refptr<Layer> scroll_layer = Layer::Create();
1089 scrollbar_layer_ = 1090 scrollbar_layer_ = FakePaintedScrollbarLayer::Create(
1090 FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id()); 1091 false, true, scroll_layer->id(), scroll_layer->element_id());
1091 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); 1092 scrollbar_layer_->SetBounds(gfx::Size(10, 100));
1092 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); 1093 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
1093 layer_tree_host()->root_layer()->AddChild(scroll_layer); 1094 layer_tree_host()->root_layer()->AddChild(scroll_layer);
1094 PostSetNeedsCommitToMainThread(); 1095 PostSetNeedsCommitToMainThread();
1095 } 1096 }
1096 1097
1097 void AfterTest() override {} 1098 void AfterTest() override {}
1098 1099
1099 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { 1100 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
1100 LayerTreeHostContextTest::CommitCompleteOnThread(impl); 1101 LayerTreeHostContextTest::CommitCompleteOnThread(impl);
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1637
1637 FakeContentLayerClient client_; 1638 FakeContentLayerClient client_;
1638 int num_draws_ = 0; 1639 int num_draws_ = 0;
1639 }; 1640 };
1640 1641
1641 MULTI_THREAD_TEST_F( 1642 MULTI_THREAD_TEST_F(
1642 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles); 1643 LayerTreeHostContextTestLoseWorkerContextDuringPrepareTiles);
1643 1644
1644 } // namespace 1645 } // namespace
1645 } // namespace cc 1646 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698