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..d9c27b2a9bcb635568c80e9c737f8e332a62f28b 100644 |
| --- a/tools/viewer/sk_app/android/surface_glue_android.h |
| +++ b/tools/viewer/sk_app/android/surface_glue_android.h |
| @@ -37,19 +37,31 @@ 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(JNIEnv* env, jobject androidApp); |
| + |
| + // This must be called in SkiaAndroidApp's own pthread because the JNIEnv is thread sensitive |
|
djsollen
2016/05/13 14:56:27
do we have some way to enforce this behavior?
liyuqian
2016/05/13 15:18:41
One way that I can think of is to check the curren
|
| ~SkiaAndroidApp(); |
| - void postMessage(const Message& message); |
| - void readMessage(Message* message); |
| + |
| + 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 setAndroidTitle(const char* title) const; |
|
djsollen
2016/05/13 14:56:27
shorten to setTitle
liyuqian
2016/05/13 15:18:42
Done.
|
| + |
| + static int message_callback(int fd, int events, void* data); |
| + static void* pthread_main(void*); |
|
djsollen
2016/05/13 14:56:27
I think you should be able to make these functions
liyuqian
2016/05/13 15:18:42
Done.
|
| + |
| 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; |
| }; |
| } // namespace sk_app |