| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (cmd->HasSwitch(switches::kEnableSlimmingPaint)) { | 213 if (cmd->HasSwitch(switches::kEnableSlimmingPaint)) { |
| 214 settings.use_display_lists = true; | 214 settings.use_display_lists = true; |
| 215 blink::WebRuntimeFeatures::enableSlimmingPaint(true); | 215 blink::WebRuntimeFeatures::enableSlimmingPaint(true); |
| 216 settings.record_full_layer = | 216 settings.record_full_layer = |
| 217 !blink::WebRuntimeFeatures::slimmingPaintDisplayItemCacheEnabled(); | 217 !blink::WebRuntimeFeatures::slimmingPaintDisplayItemCacheEnabled(); |
| 218 } | 218 } |
| 219 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { |
| 220 settings.use_compositor_animation_timelines = true; |
| 221 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); |
| 222 } |
| 219 | 223 |
| 220 settings.default_tile_size = CalculateDefaultTileSize(); | 224 settings.default_tile_size = CalculateDefaultTileSize(); |
| 221 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 225 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 222 int tile_width = 0; | 226 int tile_width = 0; |
| 223 GetSwitchValueAsInt(*cmd, | 227 GetSwitchValueAsInt(*cmd, |
| 224 switches::kDefaultTileWidth, | 228 switches::kDefaultTileWidth, |
| 225 1, | 229 1, |
| 226 std::numeric_limits<int>::max(), | 230 std::numeric_limits<int>::max(), |
| 227 &tile_width); | 231 &tile_width); |
| 228 settings.default_tile_size.set_width(tile_width); | 232 settings.default_tile_size.set_width(tile_width); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 cc::ContextProvider* provider = | 911 cc::ContextProvider* provider = |
| 908 compositor_deps_->GetSharedMainThreadContextProvider(); | 912 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 909 // 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 |
| 910 // 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). |
| 911 if (!provider) | 915 if (!provider) |
| 912 return; | 916 return; |
| 913 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 917 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 914 } | 918 } |
| 915 | 919 |
| 916 } // namespace content | 920 } // namespace content |
| OLD | NEW |