| 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 22 matching lines...) Expand all Loading... |
| 33 #include "content/common/content_switches_internal.h" | 33 #include "content/common/content_switches_internal.h" |
| 34 #include "content/common/gpu/client/context_provider_command_buffer.h" | 34 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 35 #include "content/public/common/content_switches.h" | 35 #include "content/public/common/content_switches.h" |
| 36 #include "content/renderer/input/input_handler_manager.h" | 36 #include "content/renderer/input/input_handler_manager.h" |
| 37 #include "content/renderer/scheduler/renderer_scheduler.h" | 37 #include "content/renderer/scheduler/renderer_scheduler.h" |
| 38 #include "gpu/command_buffer/client/gles2_interface.h" | 38 #include "gpu/command_buffer/client/gles2_interface.h" |
| 39 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 39 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
| 40 #include "third_party/WebKit/public/platform/WebSelectionBound.h" | 40 #include "third_party/WebKit/public/platform/WebSelectionBound.h" |
| 41 #include "third_party/WebKit/public/platform/WebSize.h" | 41 #include "third_party/WebKit/public/platform/WebSize.h" |
| 42 #include "third_party/WebKit/public/web/WebKit.h" | 42 #include "third_party/WebKit/public/web/WebKit.h" |
| 43 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 43 #include "third_party/WebKit/public/web/WebWidget.h" | 44 #include "third_party/WebKit/public/web/WebWidget.h" |
| 44 #include "ui/gfx/frame_time.h" | 45 #include "ui/gfx/frame_time.h" |
| 45 #include "ui/gl/gl_switches.h" | 46 #include "ui/gl/gl_switches.h" |
| 46 #include "ui/native_theme/native_theme_switches.h" | 47 #include "ui/native_theme/native_theme_switches.h" |
| 47 | 48 |
| 48 #if defined(OS_ANDROID) | 49 #if defined(OS_ANDROID) |
| 49 #include "content/renderer/android/synchronous_compositor_factory.h" | 50 #include "content/renderer/android/synchronous_compositor_factory.h" |
| 50 #include "ui/gfx/android/device_display_info.h" | 51 #include "ui/gfx/android/device_display_info.h" |
| 51 #endif | 52 #endif |
| 52 | 53 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 settings.use_external_begin_frame_source = | 205 settings.use_external_begin_frame_source = |
| 205 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 206 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); |
| 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); |
| 215 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { |
| 216 settings.use_compositor_animation_timelines = true; |
| 217 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); |
| 218 } |
| 214 | 219 |
| 215 settings.default_tile_size = CalculateDefaultTileSize(); | 220 settings.default_tile_size = CalculateDefaultTileSize(); |
| 216 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 221 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 217 int tile_width = 0; | 222 int tile_width = 0; |
| 218 GetSwitchValueAsInt(*cmd, | 223 GetSwitchValueAsInt(*cmd, |
| 219 switches::kDefaultTileWidth, | 224 switches::kDefaultTileWidth, |
| 220 1, | 225 1, |
| 221 std::numeric_limits<int>::max(), | 226 std::numeric_limits<int>::max(), |
| 222 &tile_width); | 227 &tile_width); |
| 223 settings.default_tile_size.set_width(tile_width); | 228 settings.default_tile_size.set_width(tile_width); |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 cc::ContextProvider* provider = | 920 cc::ContextProvider* provider = |
| 916 compositor_deps_->GetSharedMainThreadContextProvider(); | 921 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 917 // provider can be NULL after the GPU process crashed enough times and we | 922 // provider can be NULL after the GPU process crashed enough times and we |
| 918 // don't want to restart it any more (falling back to software). | 923 // don't want to restart it any more (falling back to software). |
| 919 if (!provider) | 924 if (!provider) |
| 920 return; | 925 return; |
| 921 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 926 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 922 } | 927 } |
| 923 | 928 |
| 924 } // namespace content | 929 } // namespace content |
| OLD | NEW |