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 displayVsyncStr = |
danakj
2015/07/14 19:43:42
display_vsync_string
Jimmy Jo
2015/07/15 00:47:27
Done.
| |
232 cmd->GetSwitchValueASCII(switches::kDisableGpuVsync); | |
233 settings.renderer_settings.disable_display_vsync = | |
234 (displayVsyncStr == "gpu" || displayVsyncStr.empty()); | |
235 settings.wait_for_beginframe_interval = | |
236 !(displayVsyncStr == "beginframe" || displayVsyncStr.empty()); | |
237 } | |
232 settings.main_frame_before_activation_enabled = | 238 settings.main_frame_before_activation_enabled = |
233 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 239 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
234 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 240 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
235 settings.report_overscroll_only_for_scrollable_axes = | 241 settings.report_overscroll_only_for_scrollable_axes = |
236 !compositor_deps_->IsElasticOverscrollEnabled(); | 242 !compositor_deps_->IsElasticOverscrollEnabled(); |
237 settings.accelerated_animation_enabled = | 243 settings.accelerated_animation_enabled = |
238 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 244 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
239 const std::string slimming_group = | 245 const std::string slimming_group = |
240 base::FieldTrialList::FindFullName("SlimmingPaint"); | 246 base::FieldTrialList::FindFullName("SlimmingPaint"); |
241 settings.use_display_lists = | 247 settings.use_display_lists = |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1037 return; | 1043 return; |
1038 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 1044 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
1039 } | 1045 } |
1040 | 1046 |
1041 void RenderWidgetCompositor::SetSurfaceIdNamespace( | 1047 void RenderWidgetCompositor::SetSurfaceIdNamespace( |
1042 uint32_t surface_id_namespace) { | 1048 uint32_t surface_id_namespace) { |
1043 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); | 1049 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); |
1044 } | 1050 } |
1045 | 1051 |
1046 } // namespace content | 1052 } // namespace content |
OLD | NEW |