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

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: Merge 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 {
21 kUndefined,
22 kSurfaceCreated,
23 kSurfaceChanged,
24 kSurfaceDestroyed,
25 kDestroyApp,
26 kContentInvalidated
27 };
28
29 struct Message {
30 MessageType fType = kUndefined;
31 ANativeWindow* fNativeWindow = nullptr;
32
33 Message() {}
34 Message(MessageType t) : fType(t) {}
35 };
36
37 struct SkiaAndroidApp {
38 int fPipes[2]; // 0 is the read message pipe, 1 is the write message pipe
39 Application* fApp;
40 Window* fWindow;
41 ANativeWindow* fNativeWindow;
42
43 SkiaAndroidApp();
44 ~SkiaAndroidApp();
45 void postMessage(const Message& message);
46 void readMessage(Message* message);
47 void paintIfNeeded();
48
49 private:
50 pthread_t fThread;
51 };
52
53 } // namespace sk_app
54
55 #endif
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/android/Window_android.cpp ('k') | tools/viewer/sk_app/android/surface_glue_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698