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

Side by Side Diff: tools/viewer/sk_app/android/surface_glue_android.h

Issue 1952323004: Initial commit of our new Android app to demo Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clang 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 unified diff | Download patch
OLDNEW
(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
15 #include "../Application.h"
16 #include "../Window.h"
17
18 namespace sk_app {
19
20 enum MessageType { kUndefined, kSurfaceCreated, kSurfaceChanged, kSurfaceDestroy ed, kDestroyApp };
djsollen 2016/05/09 13:17:14 you'll need to add something like... kContentInval
liyuqian 2016/05/09 14:27:27 Done.
21
22 struct Message {
23 MessageType fType = kUndefined;
24 ANativeWindow* fNativeWindow = nullptr;
25
26 Message() {}
27 Message(MessageType t) : fType(t) {}
28 };
29
30 struct SkiaAndroidApp {
31 int fPipes[2]; // 0 is the read message pipe, 1 is the write message pipe
32 Application* fApp;
33 Window* fWindow;
34 ANativeWindow* fNativeWindow;
35
36 SkiaAndroidApp();
37 ~SkiaAndroidApp();
38 void postMessage(const Message& message);
39 void readMessage(Message* message);
djsollen 2016/05/09 13:17:14 add method paintIfNeeded() that checks to make sur
liyuqian 2016/05/09 14:27:28 Done.
40
41 private:
42 pthread_t fThread;
43 };
44
45 } // namespace sk_app
46
47 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698