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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 1072 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
1073 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && | 1073 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && |
1074 HasTouchEventHandlersAt( | 1074 HasTouchEventHandlersAt( |
1075 gfx::ToFlooredPoint(touch_event.touches[i].position))) { | 1075 gfx::ToFlooredPoint(touch_event.touches[i].position))) { |
1076 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1076 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
1077 break; | 1077 break; |
1078 } | 1078 } |
1079 } | 1079 } |
1080 } | 1080 } |
1081 | 1081 |
1082 // Unconsumed touchmove acks should never be throttled as they're required to | |
1083 // dispatch compositor-handled scroll gestures. | |
1084 bool event_type_can_be_rate_limited = | 1082 bool event_type_can_be_rate_limited = |
1085 input_event->type == WebInputEvent::MouseMove || | 1083 input_event->type == WebInputEvent::MouseMove || |
1086 input_event->type == WebInputEvent::MouseWheel || | 1084 input_event->type == WebInputEvent::MouseWheel; |
1087 (input_event->type == WebInputEvent::TouchMove && | |
1088 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED); | |
1089 | 1085 |
1090 bool frame_pending = compositor_ && compositor_->BeginMainFrameRequested(); | 1086 bool frame_pending = compositor_ && compositor_->BeginMainFrameRequested(); |
1091 | 1087 |
1092 // If we don't have a fast and accurate HighResNow, we assume the input | 1088 // If we don't have a fast and accurate HighResNow, we assume the input |
1093 // handlers are heavy and rate limit them. | 1089 // handlers are heavy and rate limit them. |
1094 bool rate_limiting_wanted = true; | 1090 bool rate_limiting_wanted = true; |
1095 if (base::TimeTicks::IsHighResNowFastAndReliable()) { | 1091 if (base::TimeTicks::IsHighResNowFastAndReliable()) { |
1096 base::TimeTicks end_time = base::TimeTicks::HighResNow(); | 1092 base::TimeTicks end_time = base::TimeTicks::HighResNow(); |
1097 total_input_handling_time_this_frame_ += (end_time - start_time); | 1093 total_input_handling_time_this_frame_ += (end_time - start_time); |
1098 rate_limiting_wanted = | 1094 rate_limiting_wanted = |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2246 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2242 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2247 video_hole_frames_.AddObserver(frame); | 2243 video_hole_frames_.AddObserver(frame); |
2248 } | 2244 } |
2249 | 2245 |
2250 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2246 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2251 video_hole_frames_.RemoveObserver(frame); | 2247 video_hole_frames_.RemoveObserver(frame); |
2252 } | 2248 } |
2253 #endif // defined(VIDEO_HOLE) | 2249 #endif // defined(VIDEO_HOLE) |
2254 | 2250 |
2255 } // namespace content | 2251 } // namespace content |
OLD | NEW |