diff options
author | Huahui Wu <hwu@google.com> | 2011-01-13 15:57:11 -0800 |
---|---|---|
committer | Huahui Wu <hwu@google.com> | 2011-01-13 16:43:58 -0800 |
commit | 4ac825dd95a2c0a351748f85f8fcae2d7968c94d (patch) | |
tree | 63996d2d1f80a3bc937d5808c874093d4d7b3342 /WebKit | |
parent | 36d976165f994e4071601d8824987f25a0a8da07 (diff) | |
download | external_webkit-4ac825dd95a2c0a351748f85f8fcae2d7968c94d.zip external_webkit-4ac825dd95a2c0a351748f85f8fcae2d7968c94d.tar.gz external_webkit-4ac825dd95a2c0a351748f85f8fcae2d7968c94d.tar.bz2 |
b/3133123 Pass touch point ids to WebKit
This is the CL in WebKit side and it needs the framwork CL:
https://android-git.corp.google.com/g/#change,89630
Notice some changes touch open source WebKit's code, so b/3351313 is filed
to keep track of that.
Change-Id: I0ac5d75c4a90f14afeb2e3fc2dc5b1c437c631f8
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 14 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index f7f1058..902ab96 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -2784,7 +2784,7 @@ GraphicsLayerAndroid* WebViewCore::graphicsRootLayer() const } #endif -bool WebViewCore::handleTouchEvent(int action, Vector<IntPoint>& points, int metaState) +bool WebViewCore::handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int metaState) { bool preventDefault = false; @@ -2835,7 +2835,7 @@ bool WebViewCore::handleTouchEvent(int action, Vector<IntPoint>& points, int met points[c].setX(points[c].x() - m_scrollOffsetX); points[c].setY(points[c].y() - m_scrollOffsetY); } - WebCore::PlatformTouchEvent te(points, type, touchState, metaState); + WebCore::PlatformTouchEvent te(ids, points, type, touchState, metaState); preventDefault = m_mainFrame->eventHandler()->handleTouchEvent(te); #endif @@ -3756,7 +3756,7 @@ static jstring FindAddress(JNIEnv *env, jobject obj, jstring addr, return ret; } -static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, +static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, jintArray idArray, jintArray xArray, jintArray yArray, jint count, jint metaState) { #ifdef ANDROID_INSTRUMENT @@ -3764,17 +3764,21 @@ static jboolean HandleTouchEvent(JNIEnv *env, jobject obj, jint action, #endif WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); LOG_ASSERT(viewImpl, "viewImpl not set in %s", __FUNCTION__); + jint* ptrIdArray = env->GetIntArrayElements(idArray, 0); jint* ptrXArray = env->GetIntArrayElements(xArray, 0); jint* ptrYArray = env->GetIntArrayElements(yArray, 0); + Vector<int> ids(count); Vector<IntPoint> points(count); for (int c = 0; c < count; c++) { + ids[c] = ptrIdArray[c]; points[c].setX(ptrXArray[c]); points[c].setY(ptrYArray[c]); } + env->ReleaseIntArrayElements(idArray, ptrIdArray, JNI_ABORT); env->ReleaseIntArrayElements(xArray, ptrXArray, JNI_ABORT); env->ReleaseIntArrayElements(yArray, ptrYArray, JNI_ABORT); - return viewImpl->handleTouchEvent(action, points, metaState); + return viewImpl->handleTouchEvent(action, ids, points, metaState); } static void TouchUp(JNIEnv *env, jobject obj, jint touchGeneration, @@ -4200,7 +4204,7 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) SaveDocumentState }, { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", (void*) FindAddress }, - { "nativeHandleTouchEvent", "(I[I[III)Z", + { "nativeHandleTouchEvent", "(I[I[I[III)Z", (void*) HandleTouchEvent }, { "nativeTouchUp", "(IIIII)V", (void*) TouchUp }, diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index fa474ce..698b711 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -332,7 +332,7 @@ namespace android { /** * Handle touch event */ - bool handleTouchEvent(int action, Vector<IntPoint>& points, int metaState); + bool handleTouchEvent(int action, Vector<int>& ids, Vector<IntPoint>& points, int metaState); /** * Handle motionUp event from the UI thread (called touchUp in the |