OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 void RenderWidgetCompositor::Initialize() { | 221 void RenderWidgetCompositor::Initialize() { |
222 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 222 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
223 | 223 |
224 cc::LayerTreeSettings settings; | 224 cc::LayerTreeSettings settings; |
225 | 225 |
226 // For web contents, layer transforms should scale up the contents of layers | 226 // For web contents, layer transforms should scale up the contents of layers |
227 // to keep content always crisp when possible. | 227 // to keep content always crisp when possible. |
228 settings.layer_transforms_should_scale_layer_contents = true; | 228 settings.layer_transforms_should_scale_layer_contents = true; |
229 | 229 |
230 settings.renderer_settings.disable_gpu_vsync = | 230 if (cmd->HasSwitch(switches::kDisableGpuVsync)) { |
231 cmd->HasSwitch(switches::kDisableGpuVsync); | 231 std::string display_vsync_string = |
| 232 cmd->GetSwitchValueASCII(switches::kDisableGpuVsync); |
| 233 if (display_vsync_string == "gpu") { |
| 234 settings.renderer_settings.disable_display_vsync = true; |
| 235 } else if (display_vsync_string == "beginframe") { |
| 236 settings.wait_for_beginframe_interval = false; |
| 237 } else { |
| 238 settings.renderer_settings.disable_display_vsync = true; |
| 239 settings.wait_for_beginframe_interval = false; |
| 240 } |
| 241 } |
232 settings.main_frame_before_activation_enabled = | 242 settings.main_frame_before_activation_enabled = |
233 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 243 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
234 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 244 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
235 settings.report_overscroll_only_for_scrollable_axes = | 245 settings.report_overscroll_only_for_scrollable_axes = |
236 !compositor_deps_->IsElasticOverscrollEnabled(); | 246 !compositor_deps_->IsElasticOverscrollEnabled(); |
237 settings.accelerated_animation_enabled = | 247 settings.accelerated_animation_enabled = |
238 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 248 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
239 const std::string slimming_group = | 249 const std::string slimming_group = |
240 base::FieldTrialList::FindFullName("SlimmingPaint"); | 250 base::FieldTrialList::FindFullName("SlimmingPaint"); |
241 settings.use_display_lists = | 251 settings.use_display_lists = |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 return; | 1047 return; |
1038 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 1048 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
1039 } | 1049 } |
1040 | 1050 |
1041 void RenderWidgetCompositor::SetSurfaceIdNamespace( | 1051 void RenderWidgetCompositor::SetSurfaceIdNamespace( |
1042 uint32_t surface_id_namespace) { | 1052 uint32_t surface_id_namespace) { |
1043 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); | 1053 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); |
1044 } | 1054 } |
1045 | 1055 |
1046 } // namespace content | 1056 } // namespace content |
OLD | NEW |