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

Side by Side Diff: cc/trees/layer_tree_settings.cc

Issue 1177383005: cc: Add command line for frame production throttle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: followed Brian`s comment Created 5 years, 6 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_settings.h" 5 #include "cc/trees/layer_tree_settings.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "cc/base/switches.h"
14 #include "ui/gl/gl_switches.h"
13 15
14 namespace cc { 16 namespace cc {
15 17
16 LayerSettings::LayerSettings() : use_compositor_animation_timelines(false) { 18 LayerSettings::LayerSettings() : use_compositor_animation_timelines(false) {
17 } 19 }
18 20
19 LayerSettings::~LayerSettings() { 21 LayerSettings::~LayerSettings() {
20 } 22 }
21 23
22 LayerTreeSettings::LayerTreeSettings() 24 LayerTreeSettings::LayerTreeSettings()
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 use_display_lists(false), 76 use_display_lists(false),
75 verify_property_trees(false), 77 verify_property_trees(false),
76 gather_pixel_refs(false), 78 gather_pixel_refs(false),
77 use_compositor_animation_timelines(false), 79 use_compositor_animation_timelines(false),
78 invert_viewport_scroll_order(false) { 80 invert_viewport_scroll_order(false) {
79 } 81 }
80 82
81 LayerTreeSettings::~LayerTreeSettings() {} 83 LayerTreeSettings::~LayerTreeSettings() {}
82 84
83 SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const { 85 SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const {
86 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
87
84 SchedulerSettings scheduler_settings; 88 SchedulerSettings scheduler_settings;
85 scheduler_settings.use_external_begin_frame_source = 89 scheduler_settings.use_external_begin_frame_source =
86 use_external_begin_frame_source; 90 use_external_begin_frame_source;
87 scheduler_settings.main_frame_before_activation_enabled = 91 scheduler_settings.main_frame_before_activation_enabled =
88 main_frame_before_activation_enabled; 92 main_frame_before_activation_enabled;
89 scheduler_settings.impl_side_painting = impl_side_painting; 93 scheduler_settings.impl_side_painting = impl_side_painting;
90 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 94 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
91 timeout_and_draw_when_animation_checkerboards; 95 timeout_and_draw_when_animation_checkerboards;
92 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 96 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
93 maximum_number_of_failed_draws_before_draw_is_forced_; 97 maximum_number_of_failed_draws_before_draw_is_forced_;
94 scheduler_settings.using_synchronous_renderer_compositor = 98 scheduler_settings.using_synchronous_renderer_compositor =
95 using_synchronous_renderer_compositor; 99 using_synchronous_renderer_compositor;
100
96 scheduler_settings.throttle_frame_production = 101 scheduler_settings.throttle_frame_production =
97 !renderer_settings.disable_gpu_vsync; 102 (cmd->HasSwitch(::switches::kDisableGpuVsync)
brianderson 2015/06/24 01:16:45 We try to avoid checking the command line flags di
Jimmy Jo 2015/06/24 09:38:31 Done.
103 ? false
104 : !cmd->HasSwitch(switches::kDisableCompositorVsync));
105
98 scheduler_settings.main_thread_should_always_be_low_latency = false; 106 scheduler_settings.main_thread_should_always_be_low_latency = false;
99 scheduler_settings.background_frame_interval = 107 scheduler_settings.background_frame_interval =
100 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); 108 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate);
101 return scheduler_settings; 109 return scheduler_settings;
102 } 110 }
103 111
104 } // namespace cc 112 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698