| 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..7ffba3080a9644b9125fb5bae3e08dd47f2dd1cc 100644
|
| --- a/tools/viewer/sk_app/android/surface_glue_android.h
|
| +++ b/tools/viewer/sk_app/android/surface_glue_android.h
|
| @@ -12,6 +12,7 @@
|
|
|
| #include <android/native_window_jni.h>
|
|
|
| +#include "../private/SkMutex.h"
|
| #include "../Application.h"
|
| #include "../Window.h"
|
|
|
| @@ -24,13 +25,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) {}
|
| @@ -49,6 +53,10 @@ struct SkiaAndroidApp {
|
|
|
| // This must be called in SkiaAndroidApp's own pthread because the JNIEnv is thread sensitive
|
| void setTitle(const char* title) const;
|
| +
|
| + // This posts a kContentInvalidated message if there's no such message currently in the queue
|
| + void inval();
|
| +
|
| private:
|
| pthread_t fThread;
|
| ANativeWindow* fNativeWindow;
|
| @@ -57,6 +65,9 @@ private:
|
| JNIEnv* fPThreadEnv;
|
| jmethodID fSetTitleMethodID;
|
|
|
| + bool fIsContentInvalidated = false; // use this to avoid duplicate invalidate events
|
| + SkMutex fMutex;
|
| +
|
| // This must be called in SkiaAndroidApp's own pthread because the JNIEnv is thread sensitive
|
| ~SkiaAndroidApp();
|
|
|
|
|