OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 5555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5566 | 5566 |
5567 scoped_refptr<Layer> root = Layer::Create(); | 5567 scoped_refptr<Layer> root = Layer::Create(); |
5568 root->SetBounds(gfx::Size(500, 500)); | 5568 root->SetBounds(gfx::Size(500, 500)); |
5569 | 5569 |
5570 scoped_refptr<Layer> pinch = Layer::Create(); | 5570 scoped_refptr<Layer> pinch = Layer::Create(); |
5571 pinch->SetBounds(gfx::Size(500, 500)); | 5571 pinch->SetBounds(gfx::Size(500, 500)); |
5572 pinch->SetScrollClipLayerId(root->id()); | 5572 pinch->SetScrollClipLayerId(root->id()); |
5573 pinch->SetIsContainerForFixedPositionLayers(true); | 5573 pinch->SetIsContainerForFixedPositionLayers(true); |
5574 root->AddChild(pinch); | 5574 root->AddChild(pinch); |
5575 | 5575 |
5576 scoped_ptr<FakePicturePile> pile(new FakePicturePile); | 5576 scoped_ptr<FakePicturePile> pile( |
| 5577 new FakePicturePile(0, gfx::Size(100, 100))); |
5577 pile->SetPlaybackAllowedEvent(&playback_allowed_event_); | 5578 pile->SetPlaybackAllowedEvent(&playback_allowed_event_); |
5578 scoped_refptr<FakePictureLayer> layer = | 5579 scoped_refptr<FakePictureLayer> layer = |
5579 FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); | 5580 FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); |
5580 layer->SetBounds(gfx::Size(500, 500)); | 5581 layer->SetBounds(gfx::Size(500, 500)); |
5581 layer->SetContentsOpaque(true); | 5582 layer->SetContentsOpaque(true); |
5582 // Avoid LCD text on the layer so we don't cause extra commits when we | 5583 // Avoid LCD text on the layer so we don't cause extra commits when we |
5583 // pinch. | 5584 // pinch. |
5584 layer->disable_lcd_text(); | 5585 layer->disable_lcd_text(); |
5585 pinch->AddChild(layer); | 5586 pinch->AddChild(layer); |
5586 | 5587 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5778 | 5779 |
5779 scoped_refptr<Layer> root = Layer::Create(); | 5780 scoped_refptr<Layer> root = Layer::Create(); |
5780 root->SetBounds(gfx::Size(500, 500)); | 5781 root->SetBounds(gfx::Size(500, 500)); |
5781 | 5782 |
5782 scoped_refptr<Layer> pinch = Layer::Create(); | 5783 scoped_refptr<Layer> pinch = Layer::Create(); |
5783 pinch->SetBounds(gfx::Size(500, 500)); | 5784 pinch->SetBounds(gfx::Size(500, 500)); |
5784 pinch->SetScrollClipLayerId(root->id()); | 5785 pinch->SetScrollClipLayerId(root->id()); |
5785 pinch->SetIsContainerForFixedPositionLayers(true); | 5786 pinch->SetIsContainerForFixedPositionLayers(true); |
5786 root->AddChild(pinch); | 5787 root->AddChild(pinch); |
5787 | 5788 |
5788 scoped_ptr<FakePicturePile> pile(new FakePicturePile); | 5789 scoped_ptr<FakePicturePile> pile( |
| 5790 new FakePicturePile(0, gfx::Size(100, 100))); |
5789 pile->SetPlaybackAllowedEvent(&playback_allowed_event_); | 5791 pile->SetPlaybackAllowedEvent(&playback_allowed_event_); |
5790 scoped_refptr<FakePictureLayer> layer = | 5792 scoped_refptr<FakePictureLayer> layer = |
5791 FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); | 5793 FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); |
5792 layer->SetBounds(gfx::Size(500, 500)); | 5794 layer->SetBounds(gfx::Size(500, 500)); |
5793 layer->SetContentsOpaque(true); | 5795 layer->SetContentsOpaque(true); |
5794 // Avoid LCD text on the layer so we don't cause extra commits when we | 5796 // Avoid LCD text on the layer so we don't cause extra commits when we |
5795 // pinch. | 5797 // pinch. |
5796 layer->disable_lcd_text(); | 5798 layer->disable_lcd_text(); |
5797 pinch->AddChild(layer); | 5799 pinch->AddChild(layer); |
5798 | 5800 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6025 | 6027 |
6026 void AfterTest() override { EXPECT_TRUE(did_commit_); } | 6028 void AfterTest() override { EXPECT_TRUE(did_commit_); } |
6027 | 6029 |
6028 private: | 6030 private: |
6029 bool did_commit_; | 6031 bool did_commit_; |
6030 }; | 6032 }; |
6031 | 6033 |
6032 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); | 6034 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); |
6033 | 6035 |
6034 } // namespace cc | 6036 } // namespace cc |
OLD | NEW |