Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: tools/viewer/sk_app/android/surface_glue_android.cpp

Issue 2254223002: Fix touch event parameter order (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/android/surface_glue_android.cpp
diff --git a/tools/viewer/sk_app/android/surface_glue_android.cpp b/tools/viewer/sk_app/android/surface_glue_android.cpp
index d001cd53677cb21ec6cacf85b4083efe3d3a7080..29d9ff089c0acc21386223c87d9a478c1f63a035 100644
--- a/tools/viewer/sk_app/android/surface_glue_android.cpp
+++ b/tools/viewer/sk_app/android/surface_glue_android.cpp
@@ -147,9 +147,12 @@ int SkiaAndroidApp::message_callback(int fd, int events, void* data) {
}
case kTouched: {
auto it = ANDROID_TO_WINDOW_STATEMAP.find(message.fTouchState);
- SkASSERT(it != ANDROID_TO_WINDOW_STATEMAP.end());
- skiaAndroidApp->fWindow->onTouch(message.fTouchOwner, it->second, message.fTouchX,
- message.fTouchY);
+ if (it != ANDROID_TO_WINDOW_STATEMAP.end()) {
+ skiaAndroidApp->fWindow->onTouch(message.fTouchOwner, it->second, message.fTouchX,
+ message.fTouchY);
+ } else {
+ SkDebugf("Unknown Touch State: %d\n", message.fTouchState);
+ }
break;
}
case kUIStateChanged: {
@@ -242,7 +245,7 @@ extern "C" JNIEXPORT void JNICALL Java_org_skia_viewer_ViewerActivity_onKeyPress
}
extern "C" JNIEXPORT void JNICALL Java_org_skia_viewer_ViewerActivity_onTouched(
- JNIEnv* env, jobject activity, jlong handle, jint owner, jfloat x, jfloat y, jint state) {
+ JNIEnv* env, jobject activity, jlong handle, jint owner, jint state, jfloat x, jfloat y) {
auto skiaAndroidApp = (SkiaAndroidApp*)handle;
Message message(kTouched);
message.fTouchOwner = owner;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698