| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 cc::LayerTreeSettings RenderWidgetCompositor::GenerateLayerTreeSettings( | 265 cc::LayerTreeSettings RenderWidgetCompositor::GenerateLayerTreeSettings( |
| 266 const base::CommandLine& cmd, | 266 const base::CommandLine& cmd, |
| 267 CompositorDependencies* compositor_deps, | 267 CompositorDependencies* compositor_deps, |
| 268 float device_scale_factor) { | 268 float device_scale_factor) { |
| 269 cc::LayerTreeSettings settings; | 269 cc::LayerTreeSettings settings; |
| 270 | 270 |
| 271 // For web contents, layer transforms should scale up the contents of layers | 271 // For web contents, layer transforms should scale up the contents of layers |
| 272 // to keep content always crisp when possible. | 272 // to keep content always crisp when possible. |
| 273 settings.layer_transforms_should_scale_layer_contents = true; | 273 settings.layer_transforms_should_scale_layer_contents = true; |
| 274 | 274 |
| 275 if (cmd.HasSwitch(switches::kDisableGpuVsync)) { | |
| 276 std::string display_vsync_string = | |
| 277 cmd.GetSwitchValueASCII(switches::kDisableGpuVsync); | |
| 278 if (display_vsync_string == "gpu") { | |
| 279 settings.renderer_settings.disable_display_vsync = true; | |
| 280 } else if (display_vsync_string == "beginframe") { | |
| 281 settings.wait_for_beginframe_interval = false; | |
| 282 } else { | |
| 283 settings.renderer_settings.disable_display_vsync = true; | |
| 284 settings.wait_for_beginframe_interval = false; | |
| 285 } | |
| 286 } | |
| 287 settings.main_frame_before_activation_enabled = | 275 settings.main_frame_before_activation_enabled = |
| 288 cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); | 276 cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation); |
| 289 | 277 |
| 290 // TODO(danakj): This should not be a setting O_O; it should change when the | 278 // TODO(danakj): This should not be a setting O_O; it should change when the |
| 291 // device scale factor on LayerTreeHost changes. | 279 // device scale factor on LayerTreeHost changes. |
| 292 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); | 280 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); |
| 293 if (cmd.HasSwitch(switches::kDefaultTileWidth)) { | 281 if (cmd.HasSwitch(switches::kDefaultTileWidth)) { |
| 294 int tile_width = 0; | 282 int tile_width = 0; |
| 295 GetSwitchValueAsInt(cmd, switches::kDefaultTileWidth, 1, | 283 GetSwitchValueAsInt(cmd, switches::kDefaultTileWidth, 1, |
| 296 std::numeric_limits<int>::max(), &tile_width); | 284 std::numeric_limits<int>::max(), &tile_width); |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 float device_scale) { | 1125 float device_scale) { |
| 1138 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1126 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
| 1139 } | 1127 } |
| 1140 | 1128 |
| 1141 void RenderWidgetCompositor::SetDeviceColorSpace( | 1129 void RenderWidgetCompositor::SetDeviceColorSpace( |
| 1142 const gfx::ColorSpace& color_space) { | 1130 const gfx::ColorSpace& color_space) { |
| 1143 // TODO(ccameron): Plumb this to the cc compositor. | 1131 // TODO(ccameron): Plumb this to the cc compositor. |
| 1144 } | 1132 } |
| 1145 | 1133 |
| 1146 } // namespace content | 1134 } // namespace content |
| OLD | NEW |