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

Side by Side Diff: samples/android_sample/jni/dart_host.h

Issue 11434046: Android rayshader sample. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « samples/android_sample/jni/context.h ('k') | samples/android_sample/jni/dart_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef DART_HOST_H
2 #define DART_HOST_H
3
4 #include <android_native_app_glue.h>
5 #include "bin/dartutils.h"
6 #include "include/dart_api.h"
7 #include "jni/activity_handler.h"
8 #include "jni/context.h"
9 #include "jni/graphics.h"
10 #include "jni/input_service.h"
11 #include "jni/timer.h"
12 #include "jni/vm_glue.h"
13
14 // Currently the life cycle management is very crude. We conservatively
15 // shutdown the main isolate when we lose focus and create a new one when
16 // we resume. This needs to be improved later when we understand this better,
17 // and we need some hooks to tell the Dart script to save/restore state
18 // (and an API that will support that).
19
20 class DartHost : public ActivityHandler {
21 public:
22 explicit DartHost(Context* context);
23 virtual ~DartHost();
24
25 protected:
26 int32_t OnActivate();
27 void OnDeactivate();
28 int32_t OnStep();
29
30 void OnStart();
31 void OnResume();
32 void OnPause();
33 void OnStop();
34 void OnDestroy();
35
36 void OnSaveState(void** data, size_t size);
37 void OnConfigurationChanged();
38 void OnLowMemory();
39 void OnCreateWindow();
40 void OnDestroyWindow();
41 void OnGainedFocus();
42 void OnLostFocus();
43
44 private:
45 void Clear();
46 int32_t Activate();
47 void Deactivate();
48
49 ANativeWindow_Buffer window_buffer_;
50 InputHandler* input_handler_;
51 Timer* timer_;
52 Graphics* graphics_;
53 VMGlue* vm_glue_;
54 bool active_;
55 };
56
57 #endif
58
OLDNEW
« no previous file with comments | « samples/android_sample/jni/context.h ('k') | samples/android_sample/jni/dart_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698