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

Side by Side Diff: cc/surfaces/onscreen_display_client.cc

Issue 1177383005: cc: Add command line for frame production throttle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/surfaces/onscreen_display_client.h" 5 #include "cc/surfaces/onscreen_display_client.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/output/output_surface.h" 8 #include "cc/output/output_surface.h"
9 #include "cc/output/vsync_parameter_observer.h" 9 #include "cc/output/vsync_parameter_observer.h"
10 #include "cc/scheduler/begin_frame_source.h" 10 #include "cc/scheduler/begin_frame_source.h"
(...skipping 13 matching lines...) Expand all
24 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 24 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
25 : output_surface_(output_surface.Pass()), 25 : output_surface_(output_surface.Pass()),
26 display_(new Display(this, 26 display_(new Display(this,
27 manager, 27 manager,
28 bitmap_manager, 28 bitmap_manager,
29 gpu_memory_buffer_manager, 29 gpu_memory_buffer_manager,
30 settings)), 30 settings)),
31 vsync_observer_(nullptr), 31 vsync_observer_(nullptr),
32 task_runner_(task_runner), 32 task_runner_(task_runner),
33 output_surface_lost_(false), 33 output_surface_lost_(false),
34 disable_gpu_vsync_(settings.disable_gpu_vsync) { 34 disable_display_vsync_(settings.disable_display_vsync) {
35 } 35 }
36 36
37 OnscreenDisplayClient::~OnscreenDisplayClient() { 37 OnscreenDisplayClient::~OnscreenDisplayClient() {
38 } 38 }
39 39
40 bool OnscreenDisplayClient::Initialize() { 40 bool OnscreenDisplayClient::Initialize() {
41 int max_frames_pending = 41 int max_frames_pending =
42 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0; 42 output_surface_ ? output_surface_->capabilities().max_frames_pending : 0;
43 if (max_frames_pending <= 0) 43 if (max_frames_pending <= 0)
44 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; 44 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
45 45
46 if (disable_gpu_vsync_) { 46 if (disable_display_vsync_) {
47 begin_frame_source_ = 47 begin_frame_source_ =
48 BackToBackBeginFrameSource::Create(task_runner_.get()); 48 BackToBackBeginFrameSource::Create(task_runner_.get());
49 } else { 49 } else {
50 scoped_ptr<SyntheticBeginFrameSource> synthetic_source = 50 scoped_ptr<SyntheticBeginFrameSource> synthetic_source =
51 SyntheticBeginFrameSource::Create(task_runner_.get(), base::TimeTicks(), 51 SyntheticBeginFrameSource::Create(task_runner_.get(), base::TimeTicks(),
52 BeginFrameArgs::DefaultInterval()); 52 BeginFrameArgs::DefaultInterval());
53 vsync_observer_ = synthetic_source.get(); 53 vsync_observer_ = synthetic_source.get();
54 begin_frame_source_ = synthetic_source.Pass(); 54 begin_frame_source_ = synthetic_source.Pass();
55 } 55 }
56 56
(...skipping 19 matching lines...) Expand all
76 void OnscreenDisplayClient::OutputSurfaceLost() { 76 void OnscreenDisplayClient::OutputSurfaceLost() {
77 output_surface_lost_ = true; 77 output_surface_lost_ = true;
78 surface_display_output_surface_->DidLoseOutputSurface(); 78 surface_display_output_surface_->DidLoseOutputSurface();
79 } 79 }
80 80
81 void OnscreenDisplayClient::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { 81 void OnscreenDisplayClient::SetMemoryPolicy(const ManagedMemoryPolicy& policy) {
82 surface_display_output_surface_->SetMemoryPolicy(policy); 82 surface_display_output_surface_->SetMemoryPolicy(policy);
83 } 83 }
84 84
85 } // namespace cc 85 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698