| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 194 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 195 | 195 |
| 196 cc::LayerTreeSettings settings; | 196 cc::LayerTreeSettings settings; |
| 197 | 197 |
| 198 // For web contents, layer transforms should scale up the contents of layers | 198 // For web contents, layer transforms should scale up the contents of layers |
| 199 // to keep content always crisp when possible. | 199 // to keep content always crisp when possible. |
| 200 settings.layer_transforms_should_scale_layer_contents = true; | 200 settings.layer_transforms_should_scale_layer_contents = true; |
| 201 | 201 |
| 202 settings.throttle_frame_production = | 202 settings.throttle_frame_production = |
| 203 !cmd->HasSwitch(switches::kDisableGpuVsync); | 203 !cmd->HasSwitch(switches::kDisableGpuVsync); |
| 204 settings.use_external_begin_frame_source = | 204 // TODO(simonhong): Remove kEnableBeginFrameScheduling switch. |
| 205 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 205 settings.use_external_begin_frame_source = true; |
| 206 settings.main_frame_before_activation_enabled = | 206 settings.main_frame_before_activation_enabled = |
| 207 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 207 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
| 208 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 208 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
| 209 settings.report_overscroll_only_for_scrollable_axes = | 209 settings.report_overscroll_only_for_scrollable_axes = |
| 210 !compositor_deps_->IsElasticOverscrollEnabled(); | 210 !compositor_deps_->IsElasticOverscrollEnabled(); |
| 211 settings.accelerated_animation_enabled = | 211 settings.accelerated_animation_enabled = |
| 212 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 212 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 213 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); | 213 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); |
| 214 | 214 |
| 215 settings.default_tile_size = CalculateDefaultTileSize(); | 215 settings.default_tile_size = CalculateDefaultTileSize(); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 cc::ContextProvider* provider = | 906 cc::ContextProvider* provider = |
| 907 compositor_deps_->GetSharedMainThreadContextProvider(); | 907 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 908 // provider can be NULL after the GPU process crashed enough times and we | 908 // provider can be NULL after the GPU process crashed enough times and we |
| 909 // don't want to restart it any more (falling back to software). | 909 // don't want to restart it any more (falling back to software). |
| 910 if (!provider) | 910 if (!provider) |
| 911 return; | 911 return; |
| 912 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 912 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 913 } | 913 } |
| 914 | 914 |
| 915 } // namespace content | 915 } // namespace content |
| OLD | NEW |