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 | 1082 // Unconsumed touchmove acks should never be throttled as they're required to |
brianderson
2014/10/23 20:55:51
Update comment? Removing throttling of TouchMove s
jdduke (slow)
2014/10/23 22:12:49
Done.
| |
1083 // dispatch compositor-handled scroll gestures. | 1083 // dispatch compositor-handled scroll gestures. |
1084 bool event_type_can_be_rate_limited = | 1084 bool event_type_can_be_rate_limited = |
1085 input_event->type == WebInputEvent::MouseMove || | 1085 input_event->type == WebInputEvent::MouseMove || |
1086 input_event->type == WebInputEvent::MouseWheel || | 1086 input_event->type == WebInputEvent::MouseWheel; |
1087 (input_event->type == WebInputEvent::TouchMove && | |
1088 ack_result == INPUT_EVENT_ACK_STATE_CONSUMED); | |
1089 | 1087 |
1090 bool frame_pending = compositor_ && compositor_->BeginMainFrameRequested(); | 1088 bool frame_pending = compositor_ && compositor_->BeginMainFrameRequested(); |
1091 | 1089 |
1092 // If we don't have a fast and accurate HighResNow, we assume the input | 1090 // If we don't have a fast and accurate HighResNow, we assume the input |
1093 // handlers are heavy and rate limit them. | 1091 // handlers are heavy and rate limit them. |
1094 bool rate_limiting_wanted = true; | 1092 bool rate_limiting_wanted = true; |
1095 if (base::TimeTicks::IsHighResNowFastAndReliable()) { | 1093 if (base::TimeTicks::IsHighResNowFastAndReliable()) { |
1096 base::TimeTicks end_time = base::TimeTicks::HighResNow(); | 1094 base::TimeTicks end_time = base::TimeTicks::HighResNow(); |
1097 total_input_handling_time_this_frame_ += (end_time - start_time); | 1095 total_input_handling_time_this_frame_ += (end_time - start_time); |
1098 rate_limiting_wanted = | 1096 rate_limiting_wanted = |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2246 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2244 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2247 video_hole_frames_.AddObserver(frame); | 2245 video_hole_frames_.AddObserver(frame); |
2248 } | 2246 } |
2249 | 2247 |
2250 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2248 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2251 video_hole_frames_.RemoveObserver(frame); | 2249 video_hole_frames_.RemoveObserver(frame); |
2252 } | 2250 } |
2253 #endif // defined(VIDEO_HOLE) | 2251 #endif // defined(VIDEO_HOLE) |
2254 | 2252 |
2255 } // namespace content | 2253 } // namespace content |
OLD | NEW |