| 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/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
| 21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
| 22 #include "base/trace_event/trace_event_synthetic_delay.h" | 22 #include "base/trace_event/trace_event_synthetic_delay.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "cc/base/switches.h" | 24 #include "cc/base/switches.h" |
| 25 #include "cc/debug/benchmark_instrumentation.h" | 25 #include "cc/debug/benchmark_instrumentation.h" |
| 26 #include "cc/output/output_surface.h" | 26 #include "cc/output/output_surface.h" |
| 27 #include "cc/scheduler/begin_frame_source.h" |
| 27 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
| 28 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 29 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
| 29 #include "components/scheduler/renderer/renderer_scheduler.h" | 30 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 30 #include "content/child/npapi/webplugin.h" | 31 #include "content/child/npapi/webplugin.h" |
| 31 #include "content/common/content_switches_internal.h" | 32 #include "content/common/content_switches_internal.h" |
| 32 #include "content/common/gpu/client/context_provider_command_buffer.h" | 33 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 34 #include "content/common/gpu/gpu_process_launch_causes.h" | 35 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 35 #include "content/common/input/synthetic_gesture_packet.h" | 36 #include "content/common/input/synthetic_gesture_packet.h" |
| 36 #include "content/common/input/web_input_event_traits.h" | 37 #include "content/common/input/web_input_event_traits.h" |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 | 951 |
| 951 void RenderWidget::OnRequestMoveAck() { | 952 void RenderWidget::OnRequestMoveAck() { |
| 952 DCHECK(pending_window_rect_count_); | 953 DCHECK(pending_window_rect_count_); |
| 953 pending_window_rect_count_--; | 954 pending_window_rect_count_--; |
| 954 } | 955 } |
| 955 | 956 |
| 956 GURL RenderWidget::GetURLForGraphicsContext3D() { | 957 GURL RenderWidget::GetURLForGraphicsContext3D() { |
| 957 return GURL(); | 958 return GURL(); |
| 958 } | 959 } |
| 959 | 960 |
| 961 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| 962 const ui::LatencyInfo& latency_info) { |
| 963 if (!input_event) |
| 964 return; |
| 965 input_handler_->HandleInputEvent(*input_event, latency_info); |
| 966 } |
| 967 |
| 968 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { |
| 969 if (webwidget_) |
| 970 webwidget_->setCursorVisibilityState(is_visible); |
| 971 } |
| 972 |
| 973 void RenderWidget::OnMouseCaptureLost() { |
| 974 if (webwidget_) |
| 975 webwidget_->mouseCaptureLost(); |
| 976 } |
| 977 |
| 978 void RenderWidget::OnSetFocus(bool enable) { |
| 979 if (webwidget_) |
| 980 webwidget_->setFocus(enable); |
| 981 } |
| 982 |
| 983 /////////////////////////////////////////////////////////////////////////////// |
| 984 // RenderWidgetCompositorDelegate |
| 985 |
| 986 void RenderWidget::ApplyViewportDeltas( |
| 987 const gfx::Vector2dF& inner_delta, |
| 988 const gfx::Vector2dF& outer_delta, |
| 989 const gfx::Vector2dF& elastic_overscroll_delta, |
| 990 float page_scale, |
| 991 float top_controls_delta) { |
| 992 webwidget_->applyViewportDeltas(inner_delta, outer_delta, |
| 993 elastic_overscroll_delta, page_scale, |
| 994 top_controls_delta); |
| 995 } |
| 996 |
| 997 void RenderWidget::BeginMainFrame(double frame_time_sec) { |
| 998 webwidget_->beginFrame(frame_time_sec); |
| 999 webwidget_->updateAllLifecyclePhases(); |
| 1000 } |
| 1001 |
| 960 scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { | 1002 scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { |
| 1003 // If the host is closing, then no more compositing is possible. This |
| 1004 // prevents shutdown races between handling the close message and |
| 1005 // the CreateOutputSurface task. |
| 1006 if (host_closing()) |
| 1007 return nullptr; |
| 1008 |
| 961 DCHECK(webwidget_); | 1009 DCHECK(webwidget_); |
| 962 // For widgets that are never visible, we don't start the compositor, so we | 1010 // For widgets that are never visible, we don't start the compositor, so we |
| 963 // never get a request for a cc::OutputSurface. | 1011 // never get a request for a cc::OutputSurface. |
| 964 DCHECK(!compositor_never_visible_); | 1012 DCHECK(!compositor_never_visible_); |
| 965 | 1013 |
| 966 const base::CommandLine& command_line = | 1014 const base::CommandLine& command_line = |
| 967 *base::CommandLine::ForCurrentProcess(); | 1015 *base::CommandLine::ForCurrentProcess(); |
| 968 bool use_software = fallback; | 1016 bool use_software = fallback; |
| 969 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1017 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
| 970 use_software = true; | 1018 use_software = true; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 return make_scoped_ptr(new CompositorOutputSurface( | 1090 return make_scoped_ptr(new CompositorOutputSurface( |
| 1043 routing_id(), output_surface_id, nullptr, nullptr, | 1091 routing_id(), output_surface_id, nullptr, nullptr, |
| 1044 std::move(software_device), frame_swap_message_queue_, true)); | 1092 std::move(software_device), frame_swap_message_queue_, true)); |
| 1045 } | 1093 } |
| 1046 | 1094 |
| 1047 return make_scoped_ptr(new MailboxOutputSurface( | 1095 return make_scoped_ptr(new MailboxOutputSurface( |
| 1048 routing_id(), output_surface_id, context_provider, | 1096 routing_id(), output_surface_id, context_provider, |
| 1049 worker_context_provider, frame_swap_message_queue_, cc::RGBA_8888)); | 1097 worker_context_provider, frame_swap_message_queue_, cc::RGBA_8888)); |
| 1050 } | 1098 } |
| 1051 | 1099 |
| 1100 scoped_ptr<cc::BeginFrameSource> |
| 1101 RenderWidget::CreateExternalBeginFrameSource() { |
| 1102 return compositor_deps_->CreateExternalBeginFrameSource(routing_id_); |
| 1103 } |
| 1104 |
| 1105 void RenderWidget::DidCommitAndDrawCompositorFrame() { |
| 1106 // NOTE: Tests may break if this event is renamed or moved. See |
| 1107 // tab_capture_performancetest.cc. |
| 1108 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); |
| 1109 // Notify subclasses that we initiated the paint operation. |
| 1110 DidInitiatePaint(); |
| 1111 } |
| 1112 |
| 1113 void RenderWidget::DidCommitCompositorFrame() { |
| 1114 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, |
| 1115 DidCommitCompositorFrame()); |
| 1116 FOR_EACH_OBSERVER(RenderFrameProxy, render_frame_proxies_, |
| 1117 DidCommitCompositorFrame()); |
| 1118 #if defined(VIDEO_HOLE) |
| 1119 FOR_EACH_OBSERVER(RenderFrameImpl, video_hole_frames_, |
| 1120 DidCommitCompositorFrame()); |
| 1121 #endif // defined(VIDEO_HOLE) |
| 1122 input_handler_->FlushPendingInputEventAck(); |
| 1123 } |
| 1124 |
| 1125 void RenderWidget::DidCompletePageScaleAnimation() {} |
| 1126 |
| 1127 void RenderWidget::DidCompleteSwapBuffers() { |
| 1128 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers"); |
| 1129 |
| 1130 // Notify subclasses threaded composited rendering was flushed to the screen. |
| 1131 DidFlushPaint(); |
| 1132 |
| 1133 if (!next_paint_flags_ && !need_update_rect_for_auto_resize_ && |
| 1134 !plugin_window_moves_.size()) { |
| 1135 return; |
| 1136 } |
| 1137 |
| 1138 ViewHostMsg_UpdateRect_Params params; |
| 1139 params.view_size = size_; |
| 1140 params.plugin_window_moves.swap(plugin_window_moves_); |
| 1141 params.flags = next_paint_flags_; |
| 1142 |
| 1143 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); |
| 1144 next_paint_flags_ = 0; |
| 1145 need_update_rect_for_auto_resize_ = false; |
| 1146 } |
| 1147 |
| 1148 bool RenderWidget::ForOOPIF() const { |
| 1149 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for |
| 1150 // OOPIF(crbug.com/471411). |
| 1151 return for_oopif_; |
| 1152 } |
| 1153 |
| 1154 void RenderWidget::ForwardCompositorProto(const std::vector<uint8_t>& proto) { |
| 1155 Send(new ViewHostMsg_ForwardCompositorProto(routing_id_, proto)); |
| 1156 } |
| 1157 |
| 1052 void RenderWidget::OnSwapBuffersAborted() { | 1158 void RenderWidget::OnSwapBuffersAborted() { |
| 1053 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted"); | 1159 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted"); |
| 1054 // Schedule another frame so the compositor learns about it. | 1160 // Schedule another frame so the compositor learns about it. |
| 1055 ScheduleComposite(); | 1161 ScheduleComposite(); |
| 1056 } | 1162 } |
| 1057 | 1163 |
| 1058 void RenderWidget::OnSwapBuffersPosted() { | |
| 1059 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersPosted"); | |
| 1060 } | |
| 1061 | |
| 1062 void RenderWidget::OnSwapBuffersComplete() { | 1164 void RenderWidget::OnSwapBuffersComplete() { |
| 1063 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersComplete"); | 1165 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersComplete"); |
| 1064 | 1166 |
| 1065 // Notify subclasses that composited rendering was flushed to the screen. | 1167 // Notify subclasses that composited rendering was flushed to the screen. |
| 1066 DidFlushPaint(); | 1168 DidFlushPaint(); |
| 1067 } | 1169 } |
| 1068 | 1170 |
| 1069 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 1171 void RenderWidget::OnSwapBuffersPosted() { |
| 1070 const ui::LatencyInfo& latency_info) { | 1172 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersPosted"); |
| 1071 if (!input_event) | |
| 1072 return; | |
| 1073 input_handler_->HandleInputEvent(*input_event, latency_info); | |
| 1074 } | 1173 } |
| 1075 | 1174 |
| 1076 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { | 1175 void RenderWidget::RecordFrameTimingEvents( |
| 1077 if (webwidget_) | 1176 scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events, |
| 1078 webwidget_->setCursorVisibilityState(is_visible); | 1177 scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 1178 for (const auto& composite_event : *composite_events) { |
| 1179 int64_t frameId = composite_event.first; |
| 1180 const std::vector<cc::FrameTimingTracker::CompositeTimingEvent>& events = |
| 1181 composite_event.second; |
| 1182 std::vector<blink::WebFrameTimingEvent> webEvents; |
| 1183 for (size_t i = 0; i < events.size(); ++i) { |
| 1184 webEvents.push_back(blink::WebFrameTimingEvent( |
| 1185 events[i].frame_id, |
| 1186 (events[i].timestamp - base::TimeTicks()).InSecondsF())); |
| 1187 } |
| 1188 webwidget_->recordFrameTimingEvent(blink::WebWidget::CompositeEvent, |
| 1189 frameId, webEvents); |
| 1190 } |
| 1191 for (const auto& main_frame_event : *main_frame_events) { |
| 1192 int64_t frameId = main_frame_event.first; |
| 1193 const std::vector<cc::FrameTimingTracker::MainFrameTimingEvent>& events = |
| 1194 main_frame_event.second; |
| 1195 std::vector<blink::WebFrameTimingEvent> webEvents; |
| 1196 for (size_t i = 0; i < events.size(); ++i) { |
| 1197 webEvents.push_back(blink::WebFrameTimingEvent( |
| 1198 events[i].frame_id, |
| 1199 (events[i].timestamp - base::TimeTicks()).InSecondsF(), |
| 1200 (events[i].end_time - base::TimeTicks()).InSecondsF())); |
| 1201 } |
| 1202 webwidget_->recordFrameTimingEvent(blink::WebWidget::RenderEvent, frameId, |
| 1203 webEvents); |
| 1204 } |
| 1079 } | 1205 } |
| 1080 | 1206 |
| 1081 void RenderWidget::OnMouseCaptureLost() { | 1207 void RenderWidget::ScheduleAnimation() { |
| 1082 if (webwidget_) | 1208 scheduleAnimation(); |
| 1083 webwidget_->mouseCaptureLost(); | |
| 1084 } | 1209 } |
| 1085 | 1210 |
| 1086 void RenderWidget::OnSetFocus(bool enable) { | 1211 void RenderWidget::WillBeginCompositorFrame() { |
| 1087 if (webwidget_) | 1212 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); |
| 1088 webwidget_->setFocus(enable); | 1213 |
| 1214 // The UpdateTextInputState can result in further layout and possibly |
| 1215 // enable GPU acceleration so they need to be called before any painting |
| 1216 // is done. |
| 1217 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); |
| 1218 UpdateSelectionBounds(); |
| 1089 } | 1219 } |
| 1090 | 1220 |
| 1091 /////////////////////////////////////////////////////////////////////////////// | 1221 /////////////////////////////////////////////////////////////////////////////// |
| 1092 // RenderWidgetInputHandlerDelegate | 1222 // RenderWidgetInputHandlerDelegate |
| 1093 | 1223 |
| 1094 void RenderWidget::FocusChangeComplete() {} | 1224 void RenderWidget::FocusChangeComplete() {} |
| 1095 | 1225 |
| 1096 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 1226 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
| 1097 return true; | 1227 return true; |
| 1098 } | 1228 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 | 1365 |
| 1236 void RenderWidget::AutoResizeCompositor() { | 1366 void RenderWidget::AutoResizeCompositor() { |
| 1237 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); | 1367 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); |
| 1238 if (compositor_) | 1368 if (compositor_) |
| 1239 compositor_->setViewportSize(physical_backing_size_); | 1369 compositor_->setViewportSize(physical_backing_size_); |
| 1240 } | 1370 } |
| 1241 | 1371 |
| 1242 void RenderWidget::initializeLayerTreeView() { | 1372 void RenderWidget::initializeLayerTreeView() { |
| 1243 DCHECK(!host_closing_); | 1373 DCHECK(!host_closing_); |
| 1244 | 1374 |
| 1245 compositor_ = RenderWidgetCompositor::Create(this, compositor_deps_); | 1375 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_, |
| 1376 compositor_deps_); |
| 1246 compositor_->setViewportSize(physical_backing_size_); | 1377 compositor_->setViewportSize(physical_backing_size_); |
| 1247 OnDeviceScaleFactorChanged(); | 1378 OnDeviceScaleFactorChanged(); |
| 1248 // For background pages and certain tests, we don't want to trigger | 1379 // For background pages and certain tests, we don't want to trigger |
| 1249 // OutputSurface creation. | 1380 // OutputSurface creation. |
| 1250 if (compositor_never_visible_ || !RenderThreadImpl::current()) | 1381 if (compositor_never_visible_ || !RenderThreadImpl::current()) |
| 1251 compositor_->SetNeverVisible(); | 1382 compositor_->SetNeverVisible(); |
| 1252 | 1383 |
| 1253 StartCompositor(); | 1384 StartCompositor(); |
| 1254 } | 1385 } |
| 1255 | 1386 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1273 void RenderWidget::didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) { | 1404 void RenderWidget::didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) { |
| 1274 if (layout_type == blink::WebMeaningfulLayout::VisuallyNonEmpty) { | 1405 if (layout_type == blink::WebMeaningfulLayout::VisuallyNonEmpty) { |
| 1275 QueueMessage(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_), | 1406 QueueMessage(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_), |
| 1276 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); | 1407 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); |
| 1277 } | 1408 } |
| 1278 | 1409 |
| 1279 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, | 1410 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, |
| 1280 DidMeaningfulLayout(layout_type)); | 1411 DidMeaningfulLayout(layout_type)); |
| 1281 } | 1412 } |
| 1282 | 1413 |
| 1283 void RenderWidget::WillBeginCompositorFrame() { | |
| 1284 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); | |
| 1285 | |
| 1286 // The UpdateTextInputState can result in further layout and possibly | |
| 1287 // enable GPU acceleration so they need to be called before any painting | |
| 1288 // is done. | |
| 1289 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); | |
| 1290 UpdateSelectionBounds(); | |
| 1291 } | |
| 1292 | |
| 1293 void RenderWidget::DidCommitCompositorFrame() { | |
| 1294 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, | |
| 1295 DidCommitCompositorFrame()); | |
| 1296 FOR_EACH_OBSERVER(RenderFrameProxy, render_frame_proxies_, | |
| 1297 DidCommitCompositorFrame()); | |
| 1298 #if defined(VIDEO_HOLE) | |
| 1299 FOR_EACH_OBSERVER(RenderFrameImpl, video_hole_frames_, | |
| 1300 DidCommitCompositorFrame()); | |
| 1301 #endif // defined(VIDEO_HOLE) | |
| 1302 input_handler_->FlushPendingInputEventAck(); | |
| 1303 } | |
| 1304 | |
| 1305 void RenderWidget::DidCommitAndDrawCompositorFrame() { | |
| 1306 // NOTE: Tests may break if this event is renamed or moved. See | |
| 1307 // tab_capture_performancetest.cc. | |
| 1308 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); | |
| 1309 // Notify subclasses that we initiated the paint operation. | |
| 1310 DidInitiatePaint(); | |
| 1311 } | |
| 1312 | |
| 1313 void RenderWidget::DidCompleteSwapBuffers() { | |
| 1314 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers"); | |
| 1315 | |
| 1316 // Notify subclasses threaded composited rendering was flushed to the screen. | |
| 1317 DidFlushPaint(); | |
| 1318 | |
| 1319 if (!next_paint_flags_ && | |
| 1320 !need_update_rect_for_auto_resize_ && | |
| 1321 !plugin_window_moves_.size()) { | |
| 1322 return; | |
| 1323 } | |
| 1324 | |
| 1325 ViewHostMsg_UpdateRect_Params params; | |
| 1326 params.view_size = size_; | |
| 1327 params.plugin_window_moves.swap(plugin_window_moves_); | |
| 1328 params.flags = next_paint_flags_; | |
| 1329 | |
| 1330 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); | |
| 1331 next_paint_flags_ = 0; | |
| 1332 need_update_rect_for_auto_resize_ = false; | |
| 1333 } | |
| 1334 | |
| 1335 void RenderWidget::ScheduleComposite() { | 1414 void RenderWidget::ScheduleComposite() { |
| 1336 if (compositor_ && | 1415 if (compositor_ && |
| 1337 compositor_deps_->GetCompositorImplThreadTaskRunner().get()) { | 1416 compositor_deps_->GetCompositorImplThreadTaskRunner().get()) { |
| 1338 compositor_->setNeedsAnimate(); | 1417 compositor_->setNeedsAnimate(); |
| 1339 } | 1418 } |
| 1340 } | 1419 } |
| 1341 | 1420 |
| 1342 void RenderWidget::ScheduleCompositeWithForcedRedraw() { | 1421 void RenderWidget::ScheduleCompositeWithForcedRedraw() { |
| 1343 if (compositor_) { | 1422 if (compositor_) { |
| 1344 // Regardless of whether threaded compositing is enabled, always | 1423 // Regardless of whether threaded compositing is enabled, always |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 selection_focus_rect_ = params.focus_rect; | 1956 selection_focus_rect_ = params.focus_rect; |
| 1878 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 1957 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
| 1879 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 1958 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
| 1880 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 1959 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
| 1881 } | 1960 } |
| 1882 } | 1961 } |
| 1883 | 1962 |
| 1884 UpdateCompositionInfo(false); | 1963 UpdateCompositionInfo(false); |
| 1885 } | 1964 } |
| 1886 | 1965 |
| 1887 void RenderWidget::ForwardCompositorProto(const std::vector<uint8_t>& proto) { | |
| 1888 Send(new ViewHostMsg_ForwardCompositorProto(routing_id_, proto)); | |
| 1889 } | |
| 1890 | |
| 1891 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. | 1966 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. |
| 1892 #define STATIC_ASSERT_WTIT_ENUM_MATCH(a, b) \ | 1967 #define STATIC_ASSERT_WTIT_ENUM_MATCH(a, b) \ |
| 1893 static_assert(int(blink::WebTextInputType##a) \ | 1968 static_assert(int(blink::WebTextInputType##a) \ |
| 1894 == int(ui::TEXT_INPUT_TYPE_##b), \ | 1969 == int(ui::TEXT_INPUT_TYPE_##b), \ |
| 1895 "mismatching enums: " #a) | 1970 "mismatching enums: " #a) |
| 1896 | 1971 |
| 1897 STATIC_ASSERT_WTIT_ENUM_MATCH(None, NONE); | 1972 STATIC_ASSERT_WTIT_ENUM_MATCH(None, NONE); |
| 1898 STATIC_ASSERT_WTIT_ENUM_MATCH(Text, TEXT); | 1973 STATIC_ASSERT_WTIT_ENUM_MATCH(Text, TEXT); |
| 1899 STATIC_ASSERT_WTIT_ENUM_MATCH(Password, PASSWORD); | 1974 STATIC_ASSERT_WTIT_ENUM_MATCH(Password, PASSWORD); |
| 1900 STATIC_ASSERT_WTIT_ENUM_MATCH(Search, SEARCH); | 1975 STATIC_ASSERT_WTIT_ENUM_MATCH(Search, SEARCH); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2264 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2190 video_hole_frames_.AddObserver(frame); | 2265 video_hole_frames_.AddObserver(frame); |
| 2191 } | 2266 } |
| 2192 | 2267 |
| 2193 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2268 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2194 video_hole_frames_.RemoveObserver(frame); | 2269 video_hole_frames_.RemoveObserver(frame); |
| 2195 } | 2270 } |
| 2196 #endif // defined(VIDEO_HOLE) | 2271 #endif // defined(VIDEO_HOLE) |
| 2197 | 2272 |
| 2198 } // namespace content | 2273 } // namespace content |
| OLD | NEW |