diff options
author | Huahui Wu <hwu@google.com> | 2011-01-13 17:02:22 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-13 17:02:22 -0800 |
commit | 477950e01e53312a3b7c330e518dc9c8f65f7dc6 (patch) | |
tree | d14170c9a52530f4a1fc4df74f7aa3a25af21ad8 /WebKit/android/jni/WebViewCore.cpp | |
parent | cea368a1db92930c6a82d22d7b5ec1e67d890b92 (diff) | |
parent | 4ac825dd95a2c0a351748f85f8fcae2d7968c94d (diff) | |
download | external_webkit-477950e01e53312a3b7c330e518dc9c8f65f7dc6.zip external_webkit-477950e01e53312a3b7c330e518dc9c8f65f7dc6.tar.gz external_webkit-477950e01e53312a3b7c330e518dc9c8f65f7dc6.tar.bz2 |
Merge "b/3133123 Pass touch point ids to WebKit" into honeycomb
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 3de3810..f27cf1e 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -2801,7 +2801,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; @@ -2852,7 +2852,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 @@ -3777,7 +3777,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 @@ -3785,17 +3785,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, @@ -4221,7 +4225,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 }, |