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/browser/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 648 |
649 if (!gesture_provider_.OnTouchEvent(event)) | 649 if (!gesture_provider_.OnTouchEvent(event)) |
650 return false; | 650 return false; |
651 | 651 |
652 if (host_->ShouldForwardTouchEvent()) { | 652 if (host_->ShouldForwardTouchEvent()) { |
653 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); | 653 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); |
654 host_->ForwardTouchEventWithLatencyInfo(web_event, | 654 host_->ForwardTouchEventWithLatencyInfo(web_event, |
655 CreateLatencyInfo(web_event)); | 655 CreateLatencyInfo(web_event)); |
656 } else { | 656 } else { |
657 const bool event_consumed = false; | 657 const bool event_consumed = false; |
658 gesture_provider_.OnTouchEventAck(event_consumed); | 658 gesture_provider_.OnAsyncTouchEventAck(event_consumed); |
659 } | 659 } |
660 | 660 |
661 // Send a proactive BeginFrame on the next vsync to reduce latency. | 661 // Send a proactive BeginFrame on the next vsync to reduce latency. |
662 // This is good enough as long as the first touch event has Begin semantics | 662 // This is good enough as long as the first touch event has Begin semantics |
663 // and the actual scroll happens on the next vsync. | 663 // and the actual scroll happens on the next vsync. |
664 if (observing_root_window_) | 664 if (observing_root_window_) |
665 RequestVSyncUpdate(BEGIN_FRAME); | 665 RequestVSyncUpdate(BEGIN_FRAME); |
666 | 666 |
667 return true; | 667 return true; |
668 } | 668 } |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); | 1322 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NULL_TRANSPORT); |
1323 if (CompositorImpl::IsInitialized()) { | 1323 if (CompositorImpl::IsInitialized()) { |
1324 handle.parent_client_id = ImageTransportFactoryAndroid::GetChannelID(); | 1324 handle.parent_client_id = ImageTransportFactoryAndroid::GetChannelID(); |
1325 } | 1325 } |
1326 return handle; | 1326 return handle; |
1327 } | 1327 } |
1328 | 1328 |
1329 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( | 1329 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( |
1330 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { | 1330 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { |
1331 const bool event_consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; | 1331 const bool event_consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; |
1332 gesture_provider_.OnTouchEventAck(event_consumed); | 1332 gesture_provider_.OnAsyncTouchEventAck(event_consumed); |
1333 } | 1333 } |
1334 | 1334 |
1335 void RenderWidgetHostViewAndroid::GestureEventAck( | 1335 void RenderWidgetHostViewAndroid::GestureEventAck( |
1336 const blink::WebGestureEvent& event, | 1336 const blink::WebGestureEvent& event, |
1337 InputEventAckState ack_result) { | 1337 InputEventAckState ack_result) { |
1338 if (overscroll_controller_) | 1338 if (overscroll_controller_) |
1339 overscroll_controller_->OnGestureEventAck(event, ack_result); | 1339 overscroll_controller_->OnGestureEventAck(event, ack_result); |
1340 | 1340 |
1341 if (content_view_core_) | 1341 if (content_view_core_) |
1342 content_view_core_->OnGestureEventAck(event, ack_result); | 1342 content_view_core_->OnGestureEventAck(event, ack_result); |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 results->orientationAngle = display.RotationAsDegree(); | 1745 results->orientationAngle = display.RotationAsDegree(); |
1746 results->orientationType = | 1746 results->orientationType = |
1747 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1747 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1748 gfx::DeviceDisplayInfo info; | 1748 gfx::DeviceDisplayInfo info; |
1749 results->depth = info.GetBitsPerPixel(); | 1749 results->depth = info.GetBitsPerPixel(); |
1750 results->depthPerComponent = info.GetBitsPerComponent(); | 1750 results->depthPerComponent = info.GetBitsPerComponent(); |
1751 results->isMonochrome = (results->depthPerComponent == 0); | 1751 results->isMonochrome = (results->depthPerComponent == 0); |
1752 } | 1752 } |
1753 | 1753 |
1754 } // namespace content | 1754 } // namespace content |
OLD | NEW |