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

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

Issue 2827163005: Remove scroll layer ids from scrollbar layers (Closed)
Patch Set: 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 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 settings->layer_transforms_should_scale_layer_contents = true; 1743 settings->layer_transforms_should_scale_layer_contents = true;
1744 } 1744 }
1745 1745
1746 void SetupTree() override { 1746 void SetupTree() override {
1747 root_layer_ = Layer::Create(); 1747 root_layer_ = Layer::Create();
1748 root_layer_->SetBounds(gfx::Size(10, 20)); 1748 root_layer_->SetBounds(gfx::Size(10, 20));
1749 1749
1750 bool paint_scrollbar = true; 1750 bool paint_scrollbar = true;
1751 bool has_thumb = false; 1751 bool has_thumb = false;
1752 scrollbar_ = FakePaintedScrollbarLayer::Create(paint_scrollbar, has_thumb, 1752 scrollbar_ = FakePaintedScrollbarLayer::Create(paint_scrollbar, has_thumb,
1753 root_layer_->id(),
1754 root_layer_->element_id()); 1753 root_layer_->element_id());
1755 scrollbar_->SetPosition(gfx::PointF(0.f, 10.f)); 1754 scrollbar_->SetPosition(gfx::PointF(0.f, 10.f));
1756 scrollbar_->SetBounds(gfx::Size(10, 10)); 1755 scrollbar_->SetBounds(gfx::Size(10, 10));
1757 1756
1758 root_layer_->AddChild(scrollbar_); 1757 root_layer_->AddChild(scrollbar_);
1759 1758
1760 layer_tree_host()->SetRootLayer(root_layer_); 1759 layer_tree_host()->SetRootLayer(root_layer_);
1761 LayerTreeHostTest::SetupTree(); 1760 LayerTreeHostTest::SetupTree();
1762 client_.set_bounds(root_layer_->bounds()); 1761 client_.set_bounds(root_layer_->bounds());
1763 } 1762 }
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 protected: 3730 protected:
3732 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 3731 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
3733 3732
3734 void SetupTree() override { 3733 void SetupTree() override {
3735 root_ = Layer::Create(); 3734 root_ = Layer::Create();
3736 root_->SetBounds(gfx::Size(1, 1)); 3735 root_->SetBounds(gfx::Size(1, 1));
3737 3736
3738 bool paint_scrollbar = true; 3737 bool paint_scrollbar = true;
3739 bool has_thumb = false; 3738 bool has_thumb = false;
3740 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( 3739 scrollbar_layer_ = FakePaintedScrollbarLayer::Create(
3741 paint_scrollbar, has_thumb, root_->id(), root_->element_id()); 3740 paint_scrollbar, has_thumb, root_->element_id());
3742 3741
3743 root_->AddChild(scrollbar_layer_); 3742 root_->AddChild(scrollbar_layer_);
3744 3743
3745 layer_tree_host()->SetRootLayer(root_); 3744 layer_tree_host()->SetRootLayer(root_);
3746 LayerTreeHostTest::SetupTree(); 3745 LayerTreeHostTest::SetupTree();
3747 } 3746 }
3748 3747
3749 void DidCommitAndDrawFrame() override { 3748 void DidCommitAndDrawFrame() override {
3750 switch (layer_tree_host()->SourceFrameNumber()) { 3749 switch (layer_tree_host()->SourceFrameNumber()) {
3751 case 0: 3750 case 0:
(...skipping 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after
7596 void AfterTest() override {} 7595 void AfterTest() override {}
7597 7596
7598 private: 7597 private:
7599 bool received_ack_ = false; 7598 bool received_ack_ = false;
7600 }; 7599 };
7601 7600
7602 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease); 7601 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease);
7603 7602
7604 } // namespace 7603 } // namespace
7605 } // namespace cc 7604 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698