OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "cc/debug/benchmark_instrumentation.h" | 26 #include "cc/debug/benchmark_instrumentation.h" |
27 #include "cc/output/output_surface.h" | 27 #include "cc/output/output_surface.h" |
28 #include "cc/scheduler/begin_frame_source.h" | 28 #include "cc/scheduler/begin_frame_source.h" |
29 #include "cc/trees/layer_tree_host.h" | 29 #include "cc/trees/layer_tree_host.h" |
30 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 30 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
31 #include "components/scheduler/renderer/renderer_scheduler.h" | 31 #include "components/scheduler/renderer/renderer_scheduler.h" |
32 #include "content/child/npapi/webplugin.h" | 32 #include "content/child/npapi/webplugin.h" |
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/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
36 #include "content/common/gpu/gpu_process_launch_causes.h" | |
37 #include "content/common/input/synthetic_gesture_packet.h" | 36 #include "content/common/input/synthetic_gesture_packet.h" |
38 #include "content/common/input/web_input_event_traits.h" | 37 #include "content/common/input/web_input_event_traits.h" |
39 #include "content/common/input_messages.h" | 38 #include "content/common/input_messages.h" |
40 #include "content/common/swapped_out_messages.h" | 39 #include "content/common/swapped_out_messages.h" |
41 #include "content/common/view_messages.h" | 40 #include "content/common/view_messages.h" |
42 #include "content/public/common/content_features.h" | 41 #include "content/public/common/content_features.h" |
43 #include "content/public/common/content_switches.h" | 42 #include "content/public/common/content_switches.h" |
44 #include "content/public/common/context_menu_params.h" | 43 #include "content/public/common/context_menu_params.h" |
45 #include "content/renderer/cursor_utils.h" | 44 #include "content/renderer/cursor_utils.h" |
46 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" | 45 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" |
47 #include "content/renderer/external_popup_menu.h" | 46 #include "content/renderer/external_popup_menu.h" |
48 #include "content/renderer/gpu/compositor_output_surface.h" | 47 #include "content/renderer/gpu/compositor_output_surface.h" |
49 #include "content/renderer/gpu/delegated_compositor_output_surface.h" | 48 #include "content/renderer/gpu/delegated_compositor_output_surface.h" |
50 #include "content/renderer/gpu/frame_swap_message_queue.h" | 49 #include "content/renderer/gpu/frame_swap_message_queue.h" |
51 #include "content/renderer/gpu/mailbox_output_surface.h" | 50 #include "content/renderer/gpu/mailbox_output_surface.h" |
52 #include "content/renderer/gpu/queue_message_swap_promise.h" | 51 #include "content/renderer/gpu/queue_message_swap_promise.h" |
53 #include "content/renderer/gpu/render_widget_compositor.h" | 52 #include "content/renderer/gpu/render_widget_compositor.h" |
54 #include "content/renderer/ime_event_guard.h" | 53 #include "content/renderer/ime_event_guard.h" |
55 #include "content/renderer/input/input_handler_manager.h" | 54 #include "content/renderer/input/input_handler_manager.h" |
56 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 55 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
57 #include "content/renderer/render_frame_impl.h" | 56 #include "content/renderer/render_frame_impl.h" |
58 #include "content/renderer/render_frame_proxy.h" | 57 #include "content/renderer/render_frame_proxy.h" |
59 #include "content/renderer/render_process.h" | 58 #include "content/renderer/render_process.h" |
60 #include "content/renderer/render_thread_impl.h" | 59 #include "content/renderer/render_thread_impl.h" |
61 #include "content/renderer/render_view_impl.h" | 60 #include "content/renderer/render_view_impl.h" |
62 #include "content/renderer/render_widget_owner_delegate.h" | 61 #include "content/renderer/render_widget_owner_delegate.h" |
63 #include "content/renderer/renderer_blink_platform_impl.h" | 62 #include "content/renderer/renderer_blink_platform_impl.h" |
64 #include "content/renderer/resizing_mode_selector.h" | 63 #include "content/renderer/resizing_mode_selector.h" |
| 64 #include "gpu/ipc/common/gpu_process_launch_causes.h" |
65 #include "ipc/ipc_sync_message.h" | 65 #include "ipc/ipc_sync_message.h" |
66 #include "skia/ext/platform_canvas.h" | 66 #include "skia/ext/platform_canvas.h" |
67 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 67 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
68 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 68 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
69 #include "third_party/WebKit/public/platform/WebPoint.h" | 69 #include "third_party/WebKit/public/platform/WebPoint.h" |
70 #include "third_party/WebKit/public/platform/WebRect.h" | 70 #include "third_party/WebKit/public/platform/WebRect.h" |
71 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 71 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
72 #include "third_party/WebKit/public/platform/WebSize.h" | 72 #include "third_party/WebKit/public/platform/WebSize.h" |
73 #include "third_party/WebKit/public/platform/WebString.h" | 73 #include "third_party/WebKit/public/platform/WebString.h" |
74 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" | 74 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 if (MojoShellConnection::Get() && !use_software && | 714 if (MojoShellConnection::Get() && !use_software && |
715 command_line.HasSwitch(switches::kUseMusInRenderer)) { | 715 command_line.HasSwitch(switches::kUseMusInRenderer)) { |
716 RenderWidgetMusConnection* connection = | 716 RenderWidgetMusConnection* connection = |
717 RenderWidgetMusConnection::GetOrCreate(routing_id()); | 717 RenderWidgetMusConnection::GetOrCreate(routing_id()); |
718 return connection->CreateOutputSurface(); | 718 return connection->CreateOutputSurface(); |
719 } | 719 } |
720 #endif | 720 #endif |
721 | 721 |
722 scoped_refptr<GpuChannelHost> gpu_channel_host; | 722 scoped_refptr<GpuChannelHost> gpu_channel_host; |
723 if (!use_software) { | 723 if (!use_software) { |
724 CauseForGpuLaunch cause = | 724 gpu::CauseForGpuLaunch cause = gpu:: |
725 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | 725 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
726 gpu_channel_host = | 726 gpu_channel_host = |
727 RenderThreadImpl::current()->EstablishGpuChannelSync(cause); | 727 RenderThreadImpl::current()->EstablishGpuChannelSync(cause); |
728 if (!gpu_channel_host.get()) { | 728 if (!gpu_channel_host.get()) { |
729 // Cause the compositor to wait and try again. | 729 // Cause the compositor to wait and try again. |
730 return nullptr; | 730 return nullptr; |
731 } | 731 } |
732 // We may get a valid channel, but with a software renderer. In that case, | 732 // We may get a valid channel, but with a software renderer. In that case, |
733 // disable GPU compositing. | 733 // disable GPU compositing. |
734 if (gpu_channel_host->gpu_info().software_rendering) | 734 if (gpu_channel_host->gpu_info().software_rendering) |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 } | 2149 } |
2150 | 2150 |
2151 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2151 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2152 return | 2152 return |
2153 screen_metrics_emulator_ ? | 2153 screen_metrics_emulator_ ? |
2154 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2154 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2155 device_scale_factor_; | 2155 device_scale_factor_; |
2156 } | 2156 } |
2157 | 2157 |
2158 } // namespace content | 2158 } // namespace content |
OLD | NEW |