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

Side by Side Diff: content/test/layouttest_support.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/public/test/layouttest_support.h" 5 #include "content/public/test/layouttest_support.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 attributes.alpha_size = -1; 380 attributes.alpha_size = -1;
381 attributes.depth_size = 0; 381 attributes.depth_size = 0;
382 attributes.stencil_size = 0; 382 attributes.stencil_size = 0;
383 attributes.samples = 0; 383 attributes.samples = 0;
384 attributes.sample_buffers = 0; 384 attributes.sample_buffers = 0;
385 attributes.bind_generates_resource = false; 385 attributes.bind_generates_resource = false;
386 attributes.lose_context_when_out_of_memory = true; 386 attributes.lose_context_when_out_of_memory = true;
387 const bool automatic_flushes = false; 387 const bool automatic_flushes = false;
388 const bool support_locking = false; 388 const bool support_locking = false;
389 389
390 auto context_provider = make_scoped_refptr(new ContextProviderCommandBuffer(
391 gpu_channel_, gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL,
392 gpu::kNullSurfaceHandle,
393 GURL("chrome://gpu/"
394 "LayoutTestDependenciesImpl::CreateOutputSurface"),
395 automatic_flushes, support_locking, gpu::SharedMemoryLimits(),
396 attributes, nullptr,
397 command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING));
398 context_provider->BindToCurrentThread();
399
390 bool flipped_output_surface = false; 400 bool flipped_output_surface = false;
391 return base::MakeUnique<cc::PixelTestOutputSurface>( 401 return base::MakeUnique<cc::PixelTestOutputSurface>(
392 make_scoped_refptr(new ContextProviderCommandBuffer( 402 std::move(context_provider), flipped_output_surface);
393 gpu_channel_, gpu::GPU_STREAM_DEFAULT,
394 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle,
395 GURL("chrome://gpu/"
396 "LayoutTestDependenciesImpl::CreateOutputSurface"),
397 automatic_flushes, support_locking, gpu::SharedMemoryLimits(),
398 attributes, nullptr,
399 command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING)),
400 flipped_output_surface);
401 } 403 }
402 void DisplayReceivedCompositorFrame( 404 void DisplayReceivedCompositorFrame(
403 const cc::CompositorFrame& frame) override {} 405 const cc::CompositorFrame& frame) override {}
404 void DisplayWillDrawAndSwap( 406 void DisplayWillDrawAndSwap(
405 bool will_draw_and_swap, 407 bool will_draw_and_swap,
406 const cc::RenderPassList& render_passes) override {} 408 const cc::RenderPassList& render_passes) override {}
407 void DisplayDidDrawAndSwap() override {} 409 void DisplayDidDrawAndSwap() override {}
408 410
409 private: 411 private:
410 cc::TestCompositorFrameSink* FindCompositorFrameSink(int32_t routing_id) { 412 cc::TestCompositorFrameSink* FindCompositorFrameSink(int32_t routing_id) {
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 return result; 1123 return result;
1122 } 1124 }
1123 1125
1124 void SchedulerRunIdleTasks(const base::Closure& callback) { 1126 void SchedulerRunIdleTasks(const base::Closure& callback) {
1125 blink::scheduler::RendererScheduler* scheduler = 1127 blink::scheduler::RendererScheduler* scheduler =
1126 content::RenderThreadImpl::current()->GetRendererScheduler(); 1128 content::RenderThreadImpl::current()->GetRendererScheduler();
1127 blink::scheduler::RunIdleTasksForTesting(scheduler, callback); 1129 blink::scheduler::RunIdleTasksForTesting(scheduler, callback);
1128 } 1130 }
1129 1131
1130 } // namespace content 1132 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/android/synchronous_compositor_frame_sink.cc ('k') | services/ui/surfaces/direct_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698