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

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

Issue 1982643004: Implement touch control (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dedup Created 4 years, 7 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
Index: tools/viewer/sk_app/android/surface_glue_android.h
diff --git a/tools/viewer/sk_app/android/surface_glue_android.h b/tools/viewer/sk_app/android/surface_glue_android.h
index 1ce06674b9eead2ac60d6f13a5f8517f0d4797fe..d78be676829772c1cc5efe8e185537973548a759 100644
--- a/tools/viewer/sk_app/android/surface_glue_android.h
+++ b/tools/viewer/sk_app/android/surface_glue_android.h
@@ -24,13 +24,16 @@ enum MessageType {
kSurfaceDestroyed,
kDestroyApp,
kContentInvalidated,
- kKeyPressed
+ kKeyPressed,
+ kTouched
};
struct Message {
MessageType fType = kUndefined;
ANativeWindow* fNativeWindow = nullptr;
- int keycode = 0;
+ int fKeycode = 0;
+ int fTouchOwner, fTouchState;
+ float fTouchX, fTouchY;
Message() {}
Message(MessageType t) : fType(t) {}
@@ -40,6 +43,7 @@ struct SkiaAndroidApp {
Application* fApp;
Window* fWindow;
jobject fAndroidApp;
+ bool fIsContentInvalidated = false; // use this to avoid duplicate invalidate events
SkiaAndroidApp(JNIEnv* env, jobject androidApp);
@@ -49,6 +53,7 @@ struct SkiaAndroidApp {
// This must be called in SkiaAndroidApp's own pthread because the JNIEnv is thread sensitive
void setTitle(const char* title) const;
+
private:
pthread_t fThread;
ANativeWindow* fNativeWindow;

Powered by Google App Engine
This is Rietveld 408576698