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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 782 |
783 if (!gesture_provider_.OnTouchEvent(event)) | 783 if (!gesture_provider_.OnTouchEvent(event)) |
784 return false; | 784 return false; |
785 | 785 |
786 if (host_->ShouldForwardTouchEvent()) { | 786 if (host_->ShouldForwardTouchEvent()) { |
787 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); | 787 blink::WebTouchEvent web_event = CreateWebTouchEventFromMotionEvent(event); |
788 host_->ForwardTouchEventWithLatencyInfo(web_event, | 788 host_->ForwardTouchEventWithLatencyInfo(web_event, |
789 CreateLatencyInfo(web_event)); | 789 CreateLatencyInfo(web_event)); |
790 } else { | 790 } else { |
791 const bool event_consumed = false; | 791 const bool event_consumed = false; |
792 gesture_provider_.OnTouchEventAck(event_consumed); | 792 gesture_provider_.OnAsyncTouchEventAck(event_consumed); |
793 } | 793 } |
794 | 794 |
795 // Send a proactive BeginFrame on the next vsync to reduce latency. | 795 // Send a proactive BeginFrame on the next vsync to reduce latency. |
796 // This is good enough as long as the first touch event has Begin semantics | 796 // This is good enough as long as the first touch event has Begin semantics |
797 // and the actual scroll happens on the next vsync. | 797 // and the actual scroll happens on the next vsync. |
798 if (observing_root_window_) | 798 if (observing_root_window_) |
799 RequestVSyncUpdate(BEGIN_FRAME); | 799 RequestVSyncUpdate(BEGIN_FRAME); |
800 | 800 |
801 return true; | 801 return true; |
802 } | 802 } |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 if (using_browser_compositor_) { | 1466 if (using_browser_compositor_) { |
1467 handle.parent_client_id = | 1467 handle.parent_client_id = |
1468 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); | 1468 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); |
1469 } | 1469 } |
1470 return handle; | 1470 return handle; |
1471 } | 1471 } |
1472 | 1472 |
1473 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( | 1473 void RenderWidgetHostViewAndroid::ProcessAckedTouchEvent( |
1474 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { | 1474 const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) { |
1475 const bool event_consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; | 1475 const bool event_consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; |
1476 gesture_provider_.OnTouchEventAck(event_consumed); | 1476 gesture_provider_.OnAsyncTouchEventAck(event_consumed); |
1477 } | 1477 } |
1478 | 1478 |
1479 void RenderWidgetHostViewAndroid::GestureEventAck( | 1479 void RenderWidgetHostViewAndroid::GestureEventAck( |
1480 const blink::WebGestureEvent& event, | 1480 const blink::WebGestureEvent& event, |
1481 InputEventAckState ack_result) { | 1481 InputEventAckState ack_result) { |
1482 if (overscroll_controller_) | 1482 if (overscroll_controller_) |
1483 overscroll_controller_->OnGestureEventAck(event, ack_result); | 1483 overscroll_controller_->OnGestureEventAck(event, ack_result); |
1484 | 1484 |
1485 if (content_view_core_) | 1485 if (content_view_core_) |
1486 content_view_core_->OnGestureEventAck(event, ack_result); | 1486 content_view_core_->OnGestureEventAck(event, ack_result); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 results->orientationAngle = display.RotationAsDegree(); | 1887 results->orientationAngle = display.RotationAsDegree(); |
1888 results->orientationType = | 1888 results->orientationType = |
1889 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1889 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1890 gfx::DeviceDisplayInfo info; | 1890 gfx::DeviceDisplayInfo info; |
1891 results->depth = info.GetBitsPerPixel(); | 1891 results->depth = info.GetBitsPerPixel(); |
1892 results->depthPerComponent = info.GetBitsPerComponent(); | 1892 results->depthPerComponent = info.GetBitsPerComponent(); |
1893 results->isMonochrome = (results->depthPerComponent == 0); | 1893 results->isMonochrome = (results->depthPerComponent == 0); |
1894 } | 1894 } |
1895 | 1895 |
1896 } // namespace content | 1896 } // namespace content |
OLD | NEW |