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 #if !defined(OS_MACOSX) |
205 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 205 settings.use_external_begin_frame_source = true; |
| 206 #endif |
206 settings.main_frame_before_activation_enabled = | 207 settings.main_frame_before_activation_enabled = |
207 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 208 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
208 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 209 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
209 settings.report_overscroll_only_for_scrollable_axes = | 210 settings.report_overscroll_only_for_scrollable_axes = |
210 !compositor_deps_->IsElasticOverscrollEnabled(); | 211 !compositor_deps_->IsElasticOverscrollEnabled(); |
211 settings.accelerated_animation_enabled = | 212 settings.accelerated_animation_enabled = |
212 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 213 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
213 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); | 214 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); |
214 | 215 |
215 settings.default_tile_size = CalculateDefaultTileSize(); | 216 settings.default_tile_size = CalculateDefaultTileSize(); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 cc::ContextProvider* provider = | 911 cc::ContextProvider* provider = |
911 compositor_deps_->GetSharedMainThreadContextProvider(); | 912 compositor_deps_->GetSharedMainThreadContextProvider(); |
912 // provider can be NULL after the GPU process crashed enough times and we | 913 // provider can be NULL after the GPU process crashed enough times and we |
913 // don't want to restart it any more (falling back to software). | 914 // don't want to restart it any more (falling back to software). |
914 if (!provider) | 915 if (!provider) |
915 return; | 916 return; |
916 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 917 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
917 } | 918 } |
918 | 919 |
919 } // namespace content | 920 } // namespace content |
OLD | NEW |