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

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

Issue 2075343003: Use a cc::Display for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mailbox-test
Patch Set: layouttests-display2: rebase 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 | « no previous file | cc/test/pixel_test_delegating_output_surface.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 28 matching lines...) Expand all
39 LayerTreePixelTest::~LayerTreePixelTest() {} 39 LayerTreePixelTest::~LayerTreePixelTest() {}
40 40
41 void LayerTreePixelTest::InitializeSettings(LayerTreeSettings* settings) { 41 void LayerTreePixelTest::InitializeSettings(LayerTreeSettings* settings) {
42 // The PixelTestDelegatingOutputSurface will provide a BeginFrameSource. 42 // The PixelTestDelegatingOutputSurface will provide a BeginFrameSource.
43 settings->use_output_surface_begin_frame_source = true; 43 settings->use_output_surface_begin_frame_source = true;
44 } 44 }
45 45
46 std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { 46 std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
47 scoped_refptr<TestInProcessContextProvider> compositor; 47 scoped_refptr<TestInProcessContextProvider> compositor;
48 scoped_refptr<TestInProcessContextProvider> worker; 48 scoped_refptr<TestInProcessContextProvider> worker;
49 scoped_refptr<TestInProcessContextProvider> display;
49 if (test_type_ == PIXEL_TEST_GL) { 50 if (test_type_ == PIXEL_TEST_GL) {
50 compositor = new TestInProcessContextProvider(nullptr); 51 compositor = new TestInProcessContextProvider(nullptr);
51 worker = new TestInProcessContextProvider(compositor.get()); 52 worker = new TestInProcessContextProvider(compositor.get());
53 display = new TestInProcessContextProvider(nullptr);
52 } 54 }
53 const bool allow_force_reclaim_resources = !HasImplThread(); 55 const bool allow_force_reclaim_resources = !HasImplThread();
54 const bool synchronous_composite = 56 const bool synchronous_composite =
55 !layer_tree_host()->settings().single_thread_proxy_scheduler; 57 !layer_tree_host()->settings().single_thread_proxy_scheduler;
58 // Always test Webview shenanigans.
59 const gfx::Size surface_expansion_size(40, 60);
56 std::unique_ptr<PixelTestDelegatingOutputSurface> delegating_output_surface( 60 std::unique_ptr<PixelTestDelegatingOutputSurface> delegating_output_surface(
57 new PixelTestDelegatingOutputSurface( 61 new PixelTestDelegatingOutputSurface(
58 std::move(compositor), std::move(worker), shared_bitmap_manager(), 62 std::move(compositor), std::move(worker), std::move(display),
59 gpu_memory_buffer_manager(), allow_force_reclaim_resources, 63 RendererSettings(), shared_bitmap_manager(),
60 synchronous_composite)); 64 gpu_memory_buffer_manager(), surface_expansion_size,
65 allow_force_reclaim_resources, synchronous_composite));
61 delegating_output_surface->SetEnlargePassTextureAmount( 66 delegating_output_surface->SetEnlargePassTextureAmount(
62 enlarge_texture_amount_); 67 enlarge_texture_amount_);
63 return std::move(delegating_output_surface); 68 return std::move(delegating_output_surface);
64 } 69 }
65 70
66 std::unique_ptr<CopyOutputRequest> 71 std::unique_ptr<CopyOutputRequest>
67 LayerTreePixelTest::CreateCopyOutputRequest() { 72 LayerTreePixelTest::CreateCopyOutputRequest() {
68 return CopyOutputRequest::CreateBitmapRequest( 73 return CopyOutputRequest::CreateBitmapRequest(
69 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this))); 74 base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this)));
70 } 75 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 267 }
263 268
264 void LayerTreePixelTest::Finish() { 269 void LayerTreePixelTest::Finish() {
265 std::unique_ptr<gpu::GLInProcessContext> context = 270 std::unique_ptr<gpu::GLInProcessContext> context =
266 CreateTestInProcessContext(); 271 CreateTestInProcessContext();
267 GLES2Interface* gl = context->GetImplementation(); 272 GLES2Interface* gl = context->GetImplementation();
268 gl->Finish(); 273 gl->Finish();
269 } 274 }
270 275
271 } // namespace cc 276 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/pixel_test_delegating_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698