tizen 2.4 release
[framework/graphics/coregl.git] / src / modules / coregl_module.c
1 #include "../coregl_internal.h"
2
3 // TRACEPATH module
4 #include "tracepath/coregl_tracepath.h"
5 #undef MY_MODULE_ID
6 #undef MY_MODULE_TSTATE
7
8 // FASTPATH module
9 #include "fastpath/coregl_fastpath.h"
10 #undef MY_MODULE_ID
11 #undef MY_MODULE_TSTATE
12
13 // APIOPT module
14 #include "appopt/coregl_appopt.h"
15 #undef MY_MODULE_ID
16 #undef MY_MODULE_TSTATE
17
18 void
19 init_modules()
20 {
21         init_modules_fastpath();
22         init_modules_appopt();
23         init_modules_tracepath();
24
25         reset_modules_override();
26 }
27
28 void
29 deinit_modules()
30 {
31         deinit_modules_tracepath();
32         deinit_modules_appopt();
33         deinit_modules_fastpath();
34 }
35
36 void
37 reset_modules_override()
38 {
39         // Step 1 : Initialization
40         init_export();
41
42         // Step 2 : User Define Modules : Sequence is important! (Last module's API is called first)
43         fastpath_apply_overrides();
44         appopt_apply_overrides();
45
46         // Step 3 : Common Wrapping Modules
47         tracepath_apply_overrides();
48 }
49
50 void
51 init_modules_tstate(GLThreadState *tstate)
52 {
53         // Initialization for each thread state : Sequence is important!
54         init_modules_tstate_tracepath(tstate);
55         init_modules_tstate_fastpath(tstate);
56         init_modules_tstate_appopt(tstate);
57 }
58
59 void
60 deinit_modules_tstate(GLThreadState *tstate)
61 {
62         // De-Initialization for each thread state(rollback) : Sequence is important!
63         deinit_modules_tstate_appopt(tstate);
64         deinit_modules_tstate_fastpath(tstate);
65         deinit_modules_tstate_tracepath(tstate);
66 }
67