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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/public/common/content_switches.h" | 70 #include "content/public/common/content_switches.h" |
71 #include "gpu/command_buffer/client/gles2_implementation.h" | 71 #include "gpu/command_buffer/client/gles2_implementation.h" |
72 #include "gpu/command_buffer/client/gles2_interface.h" | 72 #include "gpu/command_buffer/client/gles2_interface.h" |
73 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 73 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
74 #include "skia/ext/image_operations.h" | 74 #include "skia/ext/image_operations.h" |
75 #include "third_party/khronos/GLES2/gl2.h" | 75 #include "third_party/khronos/GLES2/gl2.h" |
76 #include "third_party/khronos/GLES2/gl2ext.h" | 76 #include "third_party/khronos/GLES2/gl2ext.h" |
77 #include "third_party/skia/include/core/SkCanvas.h" | 77 #include "third_party/skia/include/core/SkCanvas.h" |
78 #include "ui/android/window_android.h" | 78 #include "ui/android/window_android.h" |
79 #include "ui/android/window_android_compositor.h" | 79 #include "ui/android/window_android_compositor.h" |
| 80 #include "ui/events/blink/blink_event_util.h" |
80 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" | 81 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" |
81 #include "ui/events/gesture_detection/motion_event.h" | 82 #include "ui/events/gesture_detection/motion_event.h" |
82 #include "ui/gfx/android/device_display_info.h" | 83 #include "ui/gfx/android/device_display_info.h" |
83 #include "ui/gfx/android/java_bitmap.h" | 84 #include "ui/gfx/android/java_bitmap.h" |
84 #include "ui/gfx/android/view_configuration.h" | 85 #include "ui/gfx/android/view_configuration.h" |
85 #include "ui/gfx/display.h" | 86 #include "ui/gfx/display.h" |
86 #include "ui/gfx/geometry/dip_util.h" | 87 #include "ui/gfx/geometry/dip_util.h" |
87 #include "ui/gfx/geometry/size_conversions.h" | 88 #include "ui/gfx/geometry/size_conversions.h" |
88 #include "ui/gfx/screen.h" | 89 #include "ui/gfx/screen.h" |
89 #include "ui/touch_selection/touch_selection_controller.h" | 90 #include "ui/touch_selection/touch_selection_controller.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 | 812 |
812 if (stylus_text_selector_.OnTouchEvent(event)) | 813 if (stylus_text_selector_.OnTouchEvent(event)) |
813 return true; | 814 return true; |
814 | 815 |
815 ui::FilteredGestureProvider::TouchHandlingResult result = | 816 ui::FilteredGestureProvider::TouchHandlingResult result = |
816 gesture_provider_.OnTouchEvent(event); | 817 gesture_provider_.OnTouchEvent(event); |
817 if (!result.succeeded) | 818 if (!result.succeeded) |
818 return false; | 819 return false; |
819 | 820 |
820 blink::WebTouchEvent web_event = | 821 blink::WebTouchEvent web_event = |
821 CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); | 822 ui::CreateWebTouchEventFromMotionEvent(event, result.did_generate_scroll); |
822 host_->ForwardTouchEventWithLatencyInfo(web_event, | 823 host_->ForwardTouchEventWithLatencyInfo(web_event, |
823 CreateLatencyInfo(web_event)); | 824 CreateLatencyInfo(web_event)); |
824 | 825 |
825 // Send a proactive BeginFrame on the next vsync to reduce latency. | 826 // Send a proactive BeginFrame on the next vsync to reduce latency. |
826 // This is good enough as long as the first touch event has Begin semantics | 827 // This is good enough as long as the first touch event has Begin semantics |
827 // and the actual scroll happens on the next vsync. | 828 // and the actual scroll happens on the next vsync. |
828 if (observing_root_window_) | 829 if (observing_root_window_) |
829 RequestVSyncUpdate(BEGIN_FRAME); | 830 RequestVSyncUpdate(BEGIN_FRAME); |
830 | 831 |
831 return true; | 832 return true; |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 cc::SurfaceDrawStatus status) { | 1872 cc::SurfaceDrawStatus status) { |
1872 while (!ack_callbacks_.empty()) { | 1873 while (!ack_callbacks_.empty()) { |
1873 ack_callbacks_.front().Run(); | 1874 ack_callbacks_.front().Run(); |
1874 ack_callbacks_.pop(); | 1875 ack_callbacks_.pop(); |
1875 } | 1876 } |
1876 } | 1877 } |
1877 | 1878 |
1878 void RenderWidgetHostViewAndroid::OnGestureEvent( | 1879 void RenderWidgetHostViewAndroid::OnGestureEvent( |
1879 const ui::GestureEventData& gesture) { | 1880 const ui::GestureEventData& gesture) { |
1880 blink::WebGestureEvent web_gesture = | 1881 blink::WebGestureEvent web_gesture = |
1881 CreateWebGestureEventFromGestureEventData(gesture); | 1882 ui::CreateWebGestureEventFromGestureEventData(gesture); |
1882 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to | 1883 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to |
1883 // stop providing shift meta values to synthetic MotionEvents. This prevents | 1884 // stop providing shift meta values to synthetic MotionEvents. This prevents |
1884 // unintended shift+click interpretation of all accessibility clicks. | 1885 // unintended shift+click interpretation of all accessibility clicks. |
1885 // See crbug.com/443247. | 1886 // See crbug.com/443247. |
1886 if (web_gesture.type == blink::WebInputEvent::GestureTap && | 1887 if (web_gesture.type == blink::WebInputEvent::GestureTap && |
1887 web_gesture.modifiers == blink::WebInputEvent::ShiftKey) { | 1888 web_gesture.modifiers == blink::WebInputEvent::ShiftKey) { |
1888 web_gesture.modifiers = 0; | 1889 web_gesture.modifiers = 0; |
1889 } | 1890 } |
1890 SendGestureEvent(web_gesture); | 1891 SendGestureEvent(web_gesture); |
1891 } | 1892 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 results->orientationAngle = display.RotationAsDegree(); | 2099 results->orientationAngle = display.RotationAsDegree(); |
2099 results->orientationType = | 2100 results->orientationType = |
2100 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2101 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2101 gfx::DeviceDisplayInfo info; | 2102 gfx::DeviceDisplayInfo info; |
2102 results->depth = info.GetBitsPerPixel(); | 2103 results->depth = info.GetBitsPerPixel(); |
2103 results->depthPerComponent = info.GetBitsPerComponent(); | 2104 results->depthPerComponent = info.GetBitsPerComponent(); |
2104 results->isMonochrome = (results->depthPerComponent == 0); | 2105 results->isMonochrome = (results->depthPerComponent == 0); |
2105 } | 2106 } |
2106 | 2107 |
2107 } // namespace content | 2108 } // namespace content |
OLD | NEW |