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

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

Issue 2445553002: cc: Make OutputSurface entirely live on one thread in tests. (Closed)
Patch Set: osonthread: fixcontextdeleteintest Created 4 years, 1 month 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/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 new TestInProcessContextProvider(compositor_context_provider.get()); 49 new TestInProcessContextProvider(compositor_context_provider.get());
50 } 50 }
51 bool synchronous_composite = 51 bool synchronous_composite =
52 !HasImplThread() && 52 !HasImplThread() &&
53 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler; 53 !layer_tree_host()->GetSettings().single_thread_proxy_scheduler;
54 // Allow resource reclaiming for partial raster tests to get back 54 // Allow resource reclaiming for partial raster tests to get back
55 // resources from the Display. 55 // resources from the Display.
56 bool force_disable_reclaim_resources = false; 56 bool force_disable_reclaim_resources = false;
57 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>( 57 auto delegating_output_surface = base::MakeUnique<TestCompositorFrameSink>(
58 compositor_context_provider, std::move(worker_context_provider), 58 compositor_context_provider, std::move(worker_context_provider),
59 CreateDisplayOutputSurface(compositor_context_provider),
60 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(), 59 shared_bitmap_manager(), gpu_memory_buffer_manager(), RendererSettings(),
61 ImplThreadTaskRunner(), synchronous_composite, 60 ImplThreadTaskRunner(), synchronous_composite,
62 force_disable_reclaim_resources); 61 force_disable_reclaim_resources);
63 delegating_output_surface->SetEnlargePassTextureAmount( 62 delegating_output_surface->SetEnlargePassTextureAmount(
64 enlarge_texture_amount_); 63 enlarge_texture_amount_);
65 return delegating_output_surface; 64 return delegating_output_surface;
66 } 65 }
67 66
68 std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateDisplayOutputSurface( 67 std::unique_ptr<OutputSurface>
68 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread(
69 scoped_refptr<ContextProvider> compositor_context_provider) { 69 scoped_refptr<ContextProvider> compositor_context_provider) {
70 std::unique_ptr<PixelTestOutputSurface> display_output_surface; 70 std::unique_ptr<PixelTestOutputSurface> display_output_surface;
71 if (test_type_ == PIXEL_TEST_GL) { 71 if (test_type_ == PIXEL_TEST_GL) {
72 bool flipped_output_surface = false; 72 bool flipped_output_surface = false;
73 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( 73 display_output_surface = base::MakeUnique<PixelTestOutputSurface>(
74 // Pixel tests use a separate context for the Display to more closely 74 // Pixel tests use a separate context for the Display to more closely
75 // mimic texture transport from the renderer process to the Display 75 // mimic texture transport from the renderer process to the Display
76 // compositor. 76 // compositor.
77 make_scoped_refptr(new TestInProcessContextProvider(nullptr)), 77 make_scoped_refptr(new TestInProcessContextProvider(nullptr)),
78 flipped_output_surface); 78 flipped_output_surface);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 void LayerTreePixelTest::Finish() { 284 void LayerTreePixelTest::Finish() {
285 std::unique_ptr<gpu::GLInProcessContext> context = 285 std::unique_ptr<gpu::GLInProcessContext> context =
286 CreateTestInProcessContext(); 286 CreateTestInProcessContext();
287 GLES2Interface* gl = context->GetImplementation(); 287 GLES2Interface* gl = context->GetImplementation();
288 gl->Finish(); 288 gl->Finish();
289 } 289 }
290 290
291 } // namespace cc 291 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698