| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "cc/output/swap_promise.h" | 37 #include "cc/output/swap_promise.h" |
| 38 #include "cc/proto/compositor_message.pb.h" | 38 #include "cc/proto/compositor_message.pb.h" |
| 39 #include "cc/resources/single_release_callback.h" | 39 #include "cc/resources/single_release_callback.h" |
| 40 #include "cc/scheduler/begin_frame_source.h" | 40 #include "cc/scheduler/begin_frame_source.h" |
| 41 #include "cc/trees/latency_info_swap_promise_monitor.h" | 41 #include "cc/trees/latency_info_swap_promise_monitor.h" |
| 42 #include "cc/trees/layer_tree_host.h" | 42 #include "cc/trees/layer_tree_host.h" |
| 43 #include "cc/trees/remote_proto_channel.h" | 43 #include "cc/trees/remote_proto_channel.h" |
| 44 #include "components/scheduler/renderer/renderer_scheduler.h" | 44 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 45 #include "content/common/content_switches_internal.h" | 45 #include "content/common/content_switches_internal.h" |
| 46 #include "content/common/gpu/client/context_provider_command_buffer.h" | 46 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 47 #include "content/common/input/input_event_utils.h" |
| 47 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
| 48 #include "content/renderer/gpu/render_widget_compositor_delegate.h" | 49 #include "content/renderer/gpu/render_widget_compositor_delegate.h" |
| 49 #include "content/renderer/input/input_handler_manager.h" | 50 #include "content/renderer/input/input_handler_manager.h" |
| 50 #include "gpu/command_buffer/client/gles2_interface.h" | 51 #include "gpu/command_buffer/client/gles2_interface.h" |
| 51 #include "gpu/command_buffer/service/gpu_switches.h" | 52 #include "gpu/command_buffer/service/gpu_switches.h" |
| 52 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 53 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
| 53 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" | 54 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" |
| 54 #include "third_party/WebKit/public/platform/WebSize.h" | 55 #include "third_party/WebKit/public/platform/WebSize.h" |
| 55 #include "third_party/WebKit/public/web/WebKit.h" | 56 #include "third_party/WebKit/public/web/WebKit.h" |
| 56 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 57 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 251 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
| 251 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 252 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
| 252 settings.accelerated_animation_enabled = | 253 settings.accelerated_animation_enabled = |
| 253 compositor_deps_->IsThreadedAnimationEnabled(); | 254 compositor_deps_->IsThreadedAnimationEnabled(); |
| 254 | 255 |
| 255 settings.use_compositor_animation_timelines = | 256 settings.use_compositor_animation_timelines = |
| 256 !cmd->HasSwitch(switches::kDisableCompositorAnimationTimelines); | 257 !cmd->HasSwitch(switches::kDisableCompositorAnimationTimelines); |
| 257 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines( | 258 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines( |
| 258 settings.use_compositor_animation_timelines); | 259 settings.use_compositor_animation_timelines); |
| 259 | 260 |
| 260 settings.use_mouse_wheel_gestures = | 261 settings.use_mouse_wheel_gestures = UseGestureBasedWheelScrolling(); |
| 261 cmd->HasSwitch(switches::kEnableWheelGestures); | |
| 262 | 262 |
| 263 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); | 263 settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); |
| 264 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 264 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 265 int tile_width = 0; | 265 int tile_width = 0; |
| 266 GetSwitchValueAsInt(*cmd, | 266 GetSwitchValueAsInt(*cmd, |
| 267 switches::kDefaultTileWidth, | 267 switches::kDefaultTileWidth, |
| 268 1, | 268 1, |
| 269 std::numeric_limits<int>::max(), | 269 std::numeric_limits<int>::max(), |
| 270 &tile_width); | 270 &tile_width); |
| 271 settings.default_tile_size.set_width(tile_width); | 271 settings.default_tile_size.set_width(tile_width); |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 #endif | 1147 #endif |
| 1148 return actual; | 1148 return actual; |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1152 float device_scale) { | 1152 float device_scale) { |
| 1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 } // namespace content | 1156 } // namespace content |
| OLD | NEW |