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

Side by Side Diff: services/gfx/compositor/backend/gpu_output.cc

Issue 1997513002: Mozart: Generalize frame scheduling. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank2
Patch Set: add comments Created 4 years, 7 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 | « services/gfx/compositor/BUILD.gn ('k') | services/gfx/compositor/compositor_engine.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 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
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
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
OLDNEW
« no previous file with comments | « services/gfx/compositor/BUILD.gn ('k') | services/gfx/compositor/compositor_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698