| 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" | |
| 44 #include "third_party/WebKit/public/web/WebWidget.h" | 43 #include "third_party/WebKit/public/web/WebWidget.h" |
| 45 #include "ui/gfx/frame_time.h" | 44 #include "ui/gfx/frame_time.h" |
| 46 #include "ui/gl/gl_switches.h" | 45 #include "ui/gl/gl_switches.h" |
| 47 #include "ui/native_theme/native_theme_switches.h" | 46 #include "ui/native_theme/native_theme_switches.h" |
| 48 | 47 |
| 49 #if defined(OS_ANDROID) | 48 #if defined(OS_ANDROID) |
| 50 #include "content/renderer/android/synchronous_compositor_factory.h" | 49 #include "content/renderer/android/synchronous_compositor_factory.h" |
| 51 #include "ui/gfx/android/device_display_info.h" | 50 #include "ui/gfx/android/device_display_info.h" |
| 52 #endif | 51 #endif |
| 53 | 52 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 !cmd->HasSwitch(switches::kDisableGpuVsync); | 203 !cmd->HasSwitch(switches::kDisableGpuVsync); |
| 205 settings.use_external_begin_frame_source = | 204 settings.use_external_begin_frame_source = |
| 206 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 205 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); |
| 207 settings.main_frame_before_activation_enabled = | 206 settings.main_frame_before_activation_enabled = |
| 208 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 207 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
| 209 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 208 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
| 210 settings.report_overscroll_only_for_scrollable_axes = | 209 settings.report_overscroll_only_for_scrollable_axes = |
| 211 !compositor_deps_->IsElasticOverscrollEnabled(); | 210 !compositor_deps_->IsElasticOverscrollEnabled(); |
| 212 settings.accelerated_animation_enabled = | 211 settings.accelerated_animation_enabled = |
| 213 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 212 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 214 if (cmd->HasSwitch(switches::kEnableSlimmingPaint)) { | 213 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); |
| 215 settings.use_display_lists = true; | |
| 216 blink::WebRuntimeFeatures::enableSlimmingPaint(true); | |
| 217 settings.record_full_layer = | |
| 218 !blink::WebRuntimeFeatures::slimmingPaintDisplayItemCacheEnabled(); | |
| 219 } | |
| 220 | 214 |
| 221 settings.default_tile_size = CalculateDefaultTileSize(); | 215 settings.default_tile_size = CalculateDefaultTileSize(); |
| 222 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 216 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 223 int tile_width = 0; | 217 int tile_width = 0; |
| 224 GetSwitchValueAsInt(*cmd, | 218 GetSwitchValueAsInt(*cmd, |
| 225 switches::kDefaultTileWidth, | 219 switches::kDefaultTileWidth, |
| 226 1, | 220 1, |
| 227 std::numeric_limits<int>::max(), | 221 std::numeric_limits<int>::max(), |
| 228 &tile_width); | 222 &tile_width); |
| 229 settings.default_tile_size.set_width(tile_width); | 223 settings.default_tile_size.set_width(tile_width); |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 cc::ContextProvider* provider = | 906 cc::ContextProvider* provider = |
| 913 compositor_deps_->GetSharedMainThreadContextProvider(); | 907 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 914 // 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 |
| 915 // 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). |
| 916 if (!provider) | 910 if (!provider) |
| 917 return; | 911 return; |
| 918 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 912 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 919 } | 913 } |
| 920 | 914 |
| 921 } // namespace content | 915 } // namespace content |
| OLD | NEW |