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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/feature_list.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
17 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
18 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
20 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
21 #include "base/trace_event/trace_event.h" | 22 #include "base/trace_event/trace_event.h" |
22 #include "base/trace_event/trace_event_synthetic_delay.h" | 23 #include "base/trace_event/trace_event_synthetic_delay.h" |
23 #include "build/build_config.h" | 24 #include "build/build_config.h" |
24 #include "cc/base/switches.h" | 25 #include "cc/base/switches.h" |
25 #include "cc/debug/benchmark_instrumentation.h" | 26 #include "cc/debug/benchmark_instrumentation.h" |
26 #include "cc/output/output_surface.h" | 27 #include "cc/output/output_surface.h" |
27 #include "cc/scheduler/begin_frame_source.h" | 28 #include "cc/scheduler/begin_frame_source.h" |
28 #include "cc/trees/layer_tree_host.h" | 29 #include "cc/trees/layer_tree_host.h" |
29 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 30 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
30 #include "components/scheduler/renderer/renderer_scheduler.h" | 31 #include "components/scheduler/renderer/renderer_scheduler.h" |
31 #include "content/child/npapi/webplugin.h" | 32 #include "content/child/npapi/webplugin.h" |
32 #include "content/common/content_switches_internal.h" | 33 #include "content/common/content_switches_internal.h" |
33 #include "content/common/gpu/client/context_provider_command_buffer.h" | 34 #include "content/common/gpu/client/context_provider_command_buffer.h" |
34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
35 #include "content/common/gpu/gpu_process_launch_causes.h" | 36 #include "content/common/gpu/gpu_process_launch_causes.h" |
36 #include "content/common/input/synthetic_gesture_packet.h" | 37 #include "content/common/input/synthetic_gesture_packet.h" |
37 #include "content/common/input/web_input_event_traits.h" | 38 #include "content/common/input/web_input_event_traits.h" |
38 #include "content/common/input_messages.h" | 39 #include "content/common/input_messages.h" |
39 #include "content/common/swapped_out_messages.h" | 40 #include "content/common/swapped_out_messages.h" |
40 #include "content/common/view_messages.h" | 41 #include "content/common/view_messages.h" |
| 42 #include "content/public/common/content_features.h" |
41 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
42 #include "content/public/common/context_menu_params.h" | 44 #include "content/public/common/context_menu_params.h" |
43 #include "content/renderer/cursor_utils.h" | 45 #include "content/renderer/cursor_utils.h" |
44 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" | 46 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h" |
45 #include "content/renderer/external_popup_menu.h" | 47 #include "content/renderer/external_popup_menu.h" |
46 #include "content/renderer/gpu/compositor_output_surface.h" | 48 #include "content/renderer/gpu/compositor_output_surface.h" |
47 #include "content/renderer/gpu/delegated_compositor_output_surface.h" | 49 #include "content/renderer/gpu/delegated_compositor_output_surface.h" |
48 #include "content/renderer/gpu/frame_swap_message_queue.h" | 50 #include "content/renderer/gpu/frame_swap_message_queue.h" |
49 #include "content/renderer/gpu/mailbox_output_surface.h" | 51 #include "content/renderer/gpu/mailbox_output_surface.h" |
50 #include "content/renderer/gpu/queue_message_swap_promise.h" | 52 #include "content/renderer/gpu/queue_message_swap_promise.h" |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 void RenderWidget::set_next_paint_is_resize_ack() { | 1744 void RenderWidget::set_next_paint_is_resize_ack() { |
1743 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK; | 1745 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK; |
1744 } | 1746 } |
1745 | 1747 |
1746 void RenderWidget::set_next_paint_is_repaint_ack() { | 1748 void RenderWidget::set_next_paint_is_repaint_ack() { |
1747 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; | 1749 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; |
1748 } | 1750 } |
1749 | 1751 |
1750 bool RenderWidget::IsUsingImeThread() { | 1752 bool RenderWidget::IsUsingImeThread() { |
1751 #if defined(OS_ANDROID) | 1753 #if defined(OS_ANDROID) |
1752 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 1754 return base::FeatureList::IsEnabled(features::kImeThread); |
1753 switches::kEnableImeThread) && | |
1754 !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
1755 switches::kDisableImeThread); | |
1756 #else | 1755 #else |
1757 return false; | 1756 return false; |
1758 #endif | 1757 #endif |
1759 } | 1758 } |
1760 | 1759 |
1761 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) { | 1760 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) { |
1762 if (!ime_event_guard_) | 1761 if (!ime_event_guard_) |
1763 ime_event_guard_ = guard; | 1762 ime_event_guard_ = guard; |
1764 } | 1763 } |
1765 | 1764 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2159 } | 2158 } |
2160 | 2159 |
2161 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2160 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2162 return | 2161 return |
2163 screen_metrics_emulator_ ? | 2162 screen_metrics_emulator_ ? |
2164 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2163 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2165 device_scale_factor_; | 2164 device_scale_factor_; |
2166 } | 2165 } |
2167 | 2166 |
2168 } // namespace content | 2167 } // namespace content |
OLD | NEW |