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