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

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

Issue 2443003004: cc: Make OutputSurface::BindToClient pure virtual and not return bool (Closed)
Patch Set: bindtoclient-pure-virtual: rebase 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/fake_output_surface_client.cc ('k') | cc/test/pixel_test_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 delegating_output_surface->SetEnlargePassTextureAmount( 62 delegating_output_surface->SetEnlargePassTextureAmount(
63 enlarge_texture_amount_); 63 enlarge_texture_amount_);
64 return delegating_output_surface; 64 return delegating_output_surface;
65 } 65 }
66 66
67 std::unique_ptr<OutputSurface> 67 std::unique_ptr<OutputSurface>
68 LayerTreePixelTest::CreateDisplayOutputSurfaceOnThread( 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 // Pixel tests use a separate context for the Display to more closely
73 // mimic texture transport from the renderer process to the Display
74 // compositor.
75 auto display_context_provider =
76 make_scoped_refptr(new TestInProcessContextProvider(nullptr));
77 display_context_provider->BindToCurrentThread();
78
72 bool flipped_output_surface = false; 79 bool flipped_output_surface = false;
73 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( 80 display_output_surface = base::MakeUnique<PixelTestOutputSurface>(
74 // Pixel tests use a separate context for the Display to more closely 81 std::move(display_context_provider), flipped_output_surface);
75 // mimic texture transport from the renderer process to the Display
76 // compositor.
77 make_scoped_refptr(new TestInProcessContextProvider(nullptr)),
78 flipped_output_surface);
79 } else { 82 } else {
80 display_output_surface = base::MakeUnique<PixelTestOutputSurface>( 83 display_output_surface = base::MakeUnique<PixelTestOutputSurface>(
81 base::MakeUnique<SoftwareOutputDevice>()); 84 base::MakeUnique<SoftwareOutputDevice>());
82 } 85 }
83 return std::move(display_output_surface); 86 return std::move(display_output_surface);
84 } 87 }
85 88
86 std::unique_ptr<CopyOutputRequest> 89 std::unique_ptr<CopyOutputRequest>
87 LayerTreePixelTest::CreateCopyOutputRequest() { 90 LayerTreePixelTest::CreateCopyOutputRequest() {
88 return CopyOutputRequest::CreateBitmapRequest( 91 return CopyOutputRequest::CreateBitmapRequest(
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 285 }
283 286
284 void LayerTreePixelTest::Finish() { 287 void LayerTreePixelTest::Finish() {
285 std::unique_ptr<gpu::GLInProcessContext> context = 288 std::unique_ptr<gpu::GLInProcessContext> context =
286 CreateTestInProcessContext(); 289 CreateTestInProcessContext();
287 GLES2Interface* gl = context->GetImplementation(); 290 GLES2Interface* gl = context->GetImplementation();
288 gl->Finish(); 291 gl->Finish();
289 } 292 }
290 293
291 } // namespace cc 294 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface_client.cc ('k') | cc/test/pixel_test_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698