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 <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 cc::LayerTreeSettings RenderWidgetCompositor::GenerateLayerTreeSettings( | 270 cc::LayerTreeSettings RenderWidgetCompositor::GenerateLayerTreeSettings( |
271 const base::CommandLine& cmd, | 271 const base::CommandLine& cmd, |
272 CompositorDependencies* compositor_deps, | 272 CompositorDependencies* compositor_deps, |
273 float device_scale_factor) { | 273 float device_scale_factor) { |
274 cc::LayerTreeSettings settings; | 274 cc::LayerTreeSettings settings; |
275 | 275 |
276 // For web contents, layer transforms should scale up the contents of layers | 276 // For web contents, layer transforms should scale up the contents of layers |
277 // to keep content always crisp when possible. | 277 // to keep content always crisp when possible. |
278 settings.layer_transforms_should_scale_layer_contents = true; | 278 settings.layer_transforms_should_scale_layer_contents = true; |
279 | 279 |
280 if (cmd.HasSwitch(switches::kDisableGpuVsync)) { | |
281 std::string display_vsync_string = | |
282 cmd.GetSwitchValueASCII(switches::kDisableGpuVsync); | |
283 if (display_vsync_string == "gpu") { | |
284 settings.renderer_settings.disable_display_vsync = true; | |
285 } else if (display_vsync_string == "beginframe") { | |
286 settings.wait_for_beginframe_interval = false; | |
287 } else { | |
288 settings.renderer_settings.disable_display_vsync = true; | |
289 settings.wait_for_beginframe_interval = false; | |
290 } | |
291 } | |
292 settings.main_frame_before_activation_enabled = | 280 settings.main_frame_before_activation_enabled = |
293 cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); | 281 cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); |
294 | 282 |
295 // TODO(danakj): This should not be a setting O_O; it should change when the | 283 // TODO(danakj): This should not be a setting O_O; it should change when the |
296 // device scale factor on LayerTreeHost changes. | 284 // device scale factor on LayerTreeHost changes. |
297 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); | 285 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); |
298 if (cmd.HasSwitch(switches::kDefaultTileWidth)) { | 286 if (cmd.HasSwitch(switches::kDefaultTileWidth)) { |
299 int tile_width = 0; | 287 int tile_width = 0; |
300 GetSwitchValueAsInt(cmd, switches::kDefaultTileWidth, 1, | 288 GetSwitchValueAsInt(cmd, switches::kDefaultTileWidth, 1, |
301 std::numeric_limits<int>::max(), &tile_width); | 289 std::numeric_limits<int>::max(), &tile_width); |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 | 1129 |
1142 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); | 1130 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); |
1143 } | 1131 } |
1144 | 1132 |
1145 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1133 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
1146 float device_scale) { | 1134 float device_scale) { |
1147 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1135 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
1148 } | 1136 } |
1149 | 1137 |
1150 } // namespace content | 1138 } // namespace content |
OLD | NEW |