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

Side by Side Diff: cc/test/layer_test_common.cc

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: no-constructor Created 4 years, 5 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/test/fake_output_surface.cc ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/test/layer_test_common.h" 5 #include "cc/test/layer_test_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/animation/animation_id_provider.h" 10 #include "cc/animation/animation_id_provider.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect)); 112 EXPECT_TRUE(quad->rect.Contains(quad->visible_rect));
113 ++(*partially_occluded_count); 113 ++(*partially_occluded_count);
114 } 114 }
115 } 115 }
116 } 116 }
117 117
118 LayerTestCommon::LayerImplTest::LayerImplTest() 118 LayerTestCommon::LayerImplTest::LayerImplTest()
119 : LayerImplTest(LayerTreeSettingsForTesting()) {} 119 : LayerImplTest(LayerTreeSettingsForTesting()) {}
120 120
121 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) 121 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings)
122 : client_(FakeLayerTreeHostClient::DIRECT_3D), 122 : output_surface_(FakeOutputSurface::CreateDelegating3d()),
123 output_surface_(FakeOutputSurface::Create3d()),
124 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)), 123 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)),
125 render_pass_(RenderPass::Create()), 124 render_pass_(RenderPass::Create()),
126 layer_impl_id_(2) { 125 layer_impl_id_(2) {
127 std::unique_ptr<LayerImpl> root = 126 std::unique_ptr<LayerImpl> root =
128 LayerImpl::Create(host_->host_impl()->active_tree(), 1); 127 LayerImpl::Create(host_->host_impl()->active_tree(), 1);
129 host_->host_impl()->active_tree()->SetRootLayerForTesting(std::move(root)); 128 host_->host_impl()->active_tree()->SetRootLayerForTesting(std::move(root));
130 root_layer_for_testing()->SetHasRenderSurface(true); 129 root_layer_for_testing()->SetHasRenderSurface(true);
131 host_->host_impl()->SetVisible(true); 130 host_->host_impl()->SetVisible(true);
132 host_->host_impl()->InitializeRenderer(output_surface_.get()); 131 host_->host_impl()->InitializeRenderer(output_surface_.get());
133 132
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 205 }
207 206
208 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} 207 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {}
209 208
210 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { 209 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() {
211 root_layer_for_testing()->test_properties()->copy_requests.push_back( 210 root_layer_for_testing()->test_properties()->copy_requests.push_back(
212 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); 211 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback)));
213 } 212 }
214 213
215 } // namespace cc 214 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.cc ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698