OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef surface_glue_android_DEFINED | |
9 #define surface_glue_android_DEFINED | |
10 | |
11 #include <pthread.h> | |
12 | |
13 #include <android/native_window_jni.h> | |
14 #include <android_native_app_glue.h> | |
15 | |
16 #include "../Application.h" | |
17 #include "../Window.h" | |
18 | |
19 namespace sk_app { | |
20 | |
21 enum MessageType { kSurfaceCreated, kSurfaceChanged, kSurfaceDestroyed, kDestroy App }; | |
22 | |
23 struct Message { | |
24 MessageType type; | |
25 | |
26 Message() {} | |
27 Message(MessageType t) : type(t) {} | |
28 }; | |
29 | |
30 void* pthread_main(void* arg); | |
djsollen
2016/05/06 18:45:26
we don't need to expose this outside the cpp file.
djsollen
2016/05/06 18:58:53
Ignore this comment.
| |
31 | |
32 struct AppThread { | |
djsollen
2016/05/06 18:45:26
let's call it something more generic skia_android_
liyuqian
2016/05/06 20:42:30
Done.
| |
33 pthread_t thread; | |
jvanverth1
2016/05/06 17:02:07
Again: fThread, fPipes, etc.
djsollen
2016/05/06 18:45:26
make datastructures like fThread private.
liyuqian
2016/05/06 20:42:30
Done.
| |
34 int pipes[2]; // 0 is the read message pipe, 1 is the write message pipe | |
35 ANativeWindow* nativeWindow; | |
36 Application* app; | |
37 Window* window; | |
38 | |
djsollen
2016/05/06 18:45:26
add a function pointer here that look something li
djsollen
2016/05/06 18:58:53
Ignore this comment.
| |
39 AppThread(); | |
40 ~AppThread(); | |
41 void postMessage(const Message& message); | |
42 void readMessage(Message* message); | |
43 }; | |
44 | |
45 } // namespace sk_app | |
46 | |
47 #endif | |
OLD | NEW |