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 5743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5754 | 5754 |
5755 if (delegating_renderer()) | 5755 if (delegating_renderer()) |
5756 return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); | 5756 return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); |
5757 else | 5757 else |
5758 return FakeOutputSurface::Create3d(context3d.Pass()); | 5758 return FakeOutputSurface::Create3d(context3d.Pass()); |
5759 } | 5759 } |
5760 }; | 5760 }; |
5761 | 5761 |
5762 MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy); | 5762 MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy); |
5763 | 5763 |
| 5764 class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest { |
| 5765 protected: |
| 5766 RasterizeWithGpuRasterizationCreatesResources() {} |
| 5767 |
| 5768 void InitializeSettings(LayerTreeSettings* settings) override { |
| 5769 settings->impl_side_painting = true; |
| 5770 settings->gpu_rasterization_forced = true; |
| 5771 } |
| 5772 |
| 5773 void SetupTree() override { |
| 5774 client_.set_fill_with_nonsolid_color(true); |
| 5775 |
| 5776 scoped_refptr<Layer> root = Layer::Create(); |
| 5777 root->SetBounds(gfx::Size(500, 500)); |
| 5778 |
| 5779 scoped_ptr<FakePicturePile> pile(new FakePicturePile); |
| 5780 scoped_refptr<FakePictureLayer> layer = |
| 5781 FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); |
| 5782 layer->SetBounds(gfx::Size(500, 500)); |
| 5783 layer->SetContentsOpaque(true); |
| 5784 root->AddChild(layer); |
| 5785 |
| 5786 layer_tree_host()->SetRootLayer(root); |
| 5787 LayerTreeHostTest::SetupTree(); |
| 5788 } |
| 5789 |
| 5790 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 5791 |
| 5792 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| 5793 LayerTreeHostImpl::FrameData* frame_data, |
| 5794 DrawResult draw_result) override { |
| 5795 EXPECT_NE(0u, host_impl->resource_provider()->num_resources()); |
| 5796 EndTest(); |
| 5797 return draw_result; |
| 5798 } |
| 5799 void AfterTest() override {} |
| 5800 |
| 5801 FakeContentLayerClient client_; |
| 5802 }; |
| 5803 |
| 5804 MULTI_THREAD_IMPL_TEST_F(RasterizeWithGpuRasterizationCreatesResources); |
| 5805 |
5764 class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles | 5806 class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles |
5765 : public LayerTreeHostTest { | 5807 : public LayerTreeHostTest { |
5766 protected: | 5808 protected: |
5767 LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles() | 5809 LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles() |
5768 : playback_allowed_event_(true, true) {} | 5810 : playback_allowed_event_(true, true) {} |
5769 | 5811 |
5770 void InitializeSettings(LayerTreeSettings* settings) override { | 5812 void InitializeSettings(LayerTreeSettings* settings) override { |
5771 settings->impl_side_painting = true; | 5813 settings->impl_side_painting = true; |
5772 } | 5814 } |
5773 | 5815 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6069 | 6111 |
6070 void AfterTest() override { EXPECT_TRUE(did_commit_); } | 6112 void AfterTest() override { EXPECT_TRUE(did_commit_); } |
6071 | 6113 |
6072 private: | 6114 private: |
6073 bool did_commit_; | 6115 bool did_commit_; |
6074 }; | 6116 }; |
6075 | 6117 |
6076 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); | 6118 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); |
6077 | 6119 |
6078 } // namespace cc | 6120 } // namespace cc |
OLD | NEW |