Chromium Code Reviews| 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 296112258e4ea5b3d92af374e90eb32e08f74a91..cdae4ec8d9eac7e2776963a17a4b3ba5d0451837 100644 |
| --- a/tools/viewer/sk_app/android/surface_glue_android.h |
| +++ b/tools/viewer/sk_app/android/surface_glue_android.h |
| @@ -37,19 +37,32 @@ struct Message { |
| }; |
| struct SkiaAndroidApp { |
| - int fPipes[2]; // 0 is the read message pipe, 1 is the write message pipe |
| Application* fApp; |
| Window* fWindow; |
| - ANativeWindow* fNativeWindow; |
| + jobject fAndroidApp; |
| - SkiaAndroidApp(); |
| - ~SkiaAndroidApp(); |
| - void postMessage(const Message& message); |
| - void readMessage(Message* message); |
| + SkiaAndroidApp(JNIEnv* env, jobject androidApp); |
| + |
| + void postMessage(const Message& message) const; |
| + void readMessage(Message* message) const; |
| void paintIfNeeded(); |
| + // 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; |
| + int fPipes[2]; // 0 is the read message pipe, 1 is the write message pipe |
| + JavaVM* fJavaVM; |
| + JNIEnv* fPThreadEnv; |
| + jclass fAppClass; |
|
djsollen
2016/05/13 16:19:12
We don't need to hold onto fAppClass
|
| + jmethodID fSetTitleMethodID; |
| + |
| + // This must be called in SkiaAndroidApp's own pthread because the JNIEnv is thread sensitive |
| + ~SkiaAndroidApp(); |
| + |
| + static int message_callback(int fd, int events, void* data); |
| + static void* pthread_main(void*); |
| }; |
| } // namespace sk_app |