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

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

Issue 820743002: cc: GPU rasterize tiles synchronously in PrepareToDraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override added :( Created 5 years, 11 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698