| 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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
| 20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "cc/animation/animation_host.h" | 24 #include "cc/animation/animation_host.h" |
| 25 #include "cc/animation/animation_timeline.h" | 25 #include "cc/animation/animation_timeline.h" |
| 26 #include "cc/animation/layer_tree_mutator.h" |
| 26 #include "cc/base/switches.h" | 27 #include "cc/base/switches.h" |
| 27 #include "cc/blink/web_layer_impl.h" | 28 #include "cc/blink/web_layer_impl.h" |
| 28 #include "cc/debug/layer_tree_debug_state.h" | 29 #include "cc/debug/layer_tree_debug_state.h" |
| 29 #include "cc/debug/micro_benchmark.h" | 30 #include "cc/debug/micro_benchmark.h" |
| 30 #include "cc/input/layer_selection_bound.h" | 31 #include "cc/input/layer_selection_bound.h" |
| 31 #include "cc/layers/layer.h" | 32 #include "cc/layers/layer.h" |
| 32 #include "cc/output/begin_frame_args.h" | 33 #include "cc/output/begin_frame_args.h" |
| 33 #include "cc/output/copy_output_request.h" | 34 #include "cc/output/copy_output_request.h" |
| 34 #include "cc/output/copy_output_result.h" | 35 #include "cc/output/copy_output_result.h" |
| 35 #include "cc/output/latency_info_swap_promise.h" | 36 #include "cc/output/latency_info_swap_promise.h" |
| 36 #include "cc/output/swap_promise.h" | 37 #include "cc/output/swap_promise.h" |
| 37 #include "cc/proto/compositor_message.pb.h" | 38 #include "cc/proto/compositor_message.pb.h" |
| 38 #include "cc/resources/single_release_callback.h" | 39 #include "cc/resources/single_release_callback.h" |
| 39 #include "cc/scheduler/begin_frame_source.h" | 40 #include "cc/scheduler/begin_frame_source.h" |
| 40 #include "cc/trees/latency_info_swap_promise_monitor.h" | 41 #include "cc/trees/latency_info_swap_promise_monitor.h" |
| 41 #include "cc/trees/layer_tree_host.h" | 42 #include "cc/trees/layer_tree_host.h" |
| 42 #include "cc/trees/remote_proto_channel.h" | 43 #include "cc/trees/remote_proto_channel.h" |
| 43 #include "components/scheduler/renderer/renderer_scheduler.h" | 44 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 44 #include "content/common/content_switches_internal.h" | 45 #include "content/common/content_switches_internal.h" |
| 45 #include "content/common/gpu/client/context_provider_command_buffer.h" | 46 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 46 #include "content/common/input/input_event_utils.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" |
| 54 #include "third_party/WebKit/public/platform/WebCompositorMutatorClient.h" |
| 53 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" | 55 #include "third_party/WebKit/public/platform/WebLayoutAndPaintAsyncCallback.h" |
| 54 #include "third_party/WebKit/public/platform/WebSize.h" | 56 #include "third_party/WebKit/public/platform/WebSize.h" |
| 55 #include "third_party/WebKit/public/web/WebKit.h" | 57 #include "third_party/WebKit/public/web/WebKit.h" |
| 56 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 58 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 57 #include "third_party/WebKit/public/web/WebSelection.h" | 59 #include "third_party/WebKit/public/web/WebSelection.h" |
| 58 #include "ui/gl/gl_switches.h" | 60 #include "ui/gl/gl_switches.h" |
| 59 #include "ui/native_theme/native_theme_switches.h" | 61 #include "ui/native_theme/native_theme_switches.h" |
| 60 | 62 |
| 61 #if defined(OS_ANDROID) | 63 #if defined(OS_ANDROID) |
| 62 #include "base/android/build_info.h" | 64 #include "base/android/build_info.h" |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 } | 878 } |
| 877 | 879 |
| 878 void RenderWidgetCompositor::setShowScrollBottleneckRects(bool show) { | 880 void RenderWidgetCompositor::setShowScrollBottleneckRects(bool show) { |
| 879 cc::LayerTreeDebugState debug_state = layer_tree_host_->debug_state(); | 881 cc::LayerTreeDebugState debug_state = layer_tree_host_->debug_state(); |
| 880 debug_state.show_touch_event_handler_rects = show; | 882 debug_state.show_touch_event_handler_rects = show; |
| 881 debug_state.show_wheel_event_handler_rects = show; | 883 debug_state.show_wheel_event_handler_rects = show; |
| 882 debug_state.show_non_fast_scrollable_rects = show; | 884 debug_state.show_non_fast_scrollable_rects = show; |
| 883 layer_tree_host_->SetDebugState(debug_state); | 885 layer_tree_host_->SetDebugState(debug_state); |
| 884 } | 886 } |
| 885 | 887 |
| 888 void RenderWidgetCompositor::setMutatorClient( |
| 889 std::unique_ptr<blink::WebCompositorMutatorClient> client) { |
| 890 TRACE_EVENT0("compositor-worker", "RenderWidgetCompositor::setMutatorClient"); |
| 891 layer_tree_host_->SetLayerTreeMutator(std::move(client)); |
| 892 } |
| 893 |
| 886 void RenderWidgetCompositor::updateTopControlsState( | 894 void RenderWidgetCompositor::updateTopControlsState( |
| 887 WebTopControlsState constraints, | 895 WebTopControlsState constraints, |
| 888 WebTopControlsState current, | 896 WebTopControlsState current, |
| 889 bool animate) { | 897 bool animate) { |
| 890 layer_tree_host_->UpdateTopControlsState(ConvertTopControlsState(constraints), | 898 layer_tree_host_->UpdateTopControlsState(ConvertTopControlsState(constraints), |
| 891 ConvertTopControlsState(current), | 899 ConvertTopControlsState(current), |
| 892 animate); | 900 animate); |
| 893 } | 901 } |
| 894 | 902 |
| 895 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { | 903 void RenderWidgetCompositor::setTopControlsHeight(float height, bool shrink) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 #endif | 1147 #endif |
| 1140 return actual; | 1148 return actual; |
| 1141 } | 1149 } |
| 1142 | 1150 |
| 1143 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
| 1144 float device_scale) { | 1152 float device_scale) { |
| 1145 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
| 1146 } | 1154 } |
| 1147 | 1155 |
| 1148 } // namespace content | 1156 } // namespace content |
| OLD | NEW |