| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/gfx/compositor/backend/gpu_output.h" | 5 #include "services/gfx/compositor/backend/gpu_output.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 GpuOutput::GpuOutput( | 31 GpuOutput::GpuOutput( |
| 32 mojo::InterfaceHandle<mojo::ContextProvider> context_provider, | 32 mojo::InterfaceHandle<mojo::ContextProvider> context_provider, |
| 33 const SchedulerCallbacks& scheduler_callbacks, | 33 const SchedulerCallbacks& scheduler_callbacks, |
| 34 const base::Closure& error_callback) | 34 const base::Closure& error_callback) |
| 35 : compositor_task_runner_(base::MessageLoop::current()->task_runner()), | 35 : compositor_task_runner_(base::MessageLoop::current()->task_runner()), |
| 36 vsync_scheduler_( | 36 vsync_scheduler_( |
| 37 new VsyncScheduler(compositor_task_runner_, scheduler_callbacks)), | 37 new VsyncScheduler(compositor_task_runner_, scheduler_callbacks)), |
| 38 error_callback_(error_callback), |
| 38 rasterizer_thread_(new base::Thread("gpu_rasterizer")), | 39 rasterizer_thread_(new base::Thread("gpu_rasterizer")), |
| 39 rasterizer_initialized_(true, false) { | 40 rasterizer_initialized_(true, false) { |
| 40 DCHECK(context_provider); | 41 DCHECK(context_provider); |
| 41 | 42 |
| 42 pipeline_depth_ = kDefaultPipelineDepth; | 43 pipeline_depth_ = kDefaultPipelineDepth; |
| 43 auto command_line = base::CommandLine::ForCurrentProcess(); | 44 auto command_line = base::CommandLine::ForCurrentProcess(); |
| 44 if (command_line->HasSwitch(kPipelineDepthSwitch)) { | 45 if (command_line->HasSwitch(kPipelineDepthSwitch)) { |
| 45 std::string str(command_line->GetSwitchValueASCII(kPipelineDepthSwitch)); | 46 std::string str(command_line->GetSwitchValueASCII(kPipelineDepthSwitch)); |
| 46 unsigned value; | 47 unsigned value; |
| 47 if (base::StringToUint(str, &value) && value >= kMinPipelineDepth && | 48 if (base::StringToUint(str, &value) && value >= kMinPipelineDepth && |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 : frame(frame), submit_time(submit_time), draw_time(0), wait_time(0) {} | 292 : frame(frame), submit_time(submit_time), draw_time(0), wait_time(0) {} |
| 292 | 293 |
| 293 GpuOutput::FrameData::~FrameData() {} | 294 GpuOutput::FrameData::~FrameData() {} |
| 294 | 295 |
| 295 void GpuOutput::FrameData::Recycle() { | 296 void GpuOutput::FrameData::Recycle() { |
| 296 draw_time = 0; | 297 draw_time = 0; |
| 297 wait_time = 0; | 298 wait_time = 0; |
| 298 } | 299 } |
| 299 | 300 |
| 300 } // namespace compositor | 301 } // namespace compositor |
| OLD | NEW |