summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:51:56 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:51:56 -0700
commit89c34cda21e55fa1de7d0295d9a234039d1adbaa (patch)
tree3fcef8b23468ab2b2b9e4e5511b553981ba17ebb /src/modules
parentfc1b7f7835116bd03878e4b0c1ec2243665fc859 (diff)
evas: make function to find evas gl context from engine shared across backend.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h62
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c47
2 files changed, 62 insertions, 47 deletions
diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
index a78e588..043d7f7 100644
--- a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
+++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
@@ -103,4 +103,66 @@ evas_render_engine_gl_generic_init(Render_Engine_Software_Generic *engine,
103 return EINA_TRUE; 103 return EINA_TRUE;
104} 104}
105 105
106static inline Evas_Engine_GL_Context *
107gl_generic_context_get(Render_Output_GL_Generic *output)
108{
109 if (!output->software.ob) return NULL;
110 output->window_use(output->software.ob);
111 return output->window_gl_context_get(output->software.ob);
112
113}
114
115static inline void
116gl_generic_window_use(void *engine)
117{
118 Render_Output_GL_Generic *re = engine;
119
120 re->window_use(re->software.ob);
121}
122
123static inline Evas_Engine_GL_Context *
124gl_generic_context_find(Render_Engine_GL_Generic *engine)
125{
126 Render_Output_GL_Generic *output;
127 Evas_Engine_GL_Context *r = NULL;
128 Eina_List *l;
129
130 EINA_LIST_FOREACH(engine->software.outputs, l, output)
131 {
132 r = gl_generic_context_get(output);
133 if (r) return r;
134 }
135
136 return r;
137}
138
139static inline void
140gl_generic_window_find(Render_Engine_GL_Generic *engine)
141{
142 Render_Output_GL_Generic *output;
143 Eina_List *l;
144
145 EINA_LIST_FOREACH(engine->software.outputs, l, output)
146 {
147 if (!output->software.ob) continue;
148 gl_generic_window_use(output);
149 break;
150 }
151}
152
153static inline void *
154gl_generic_any_output_get(Render_Engine_GL_Generic *engine)
155{
156 Render_Output_GL_Generic *output;
157 Eina_List *l;
158
159 EINA_LIST_FOREACH(engine->software.outputs, l, output)
160 {
161 if (!output->software.ob) continue;
162 return output->software.ob;
163 }
164
165 return NULL;
166}
167
106#endif 168#endif
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 2b3f1f4..96f9afe 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -49,53 +49,6 @@ int _evas_engine_GL_log_dom = -1;
49# endif 49# endif
50#endif 50#endif
51 51
52static Evas_Engine_GL_Context *
53gl_generic_context_get(Render_Output_GL_Generic *output)
54{
55 if (!output->software.ob) return NULL;
56 output->window_use(output->software.ob);
57 return output->window_gl_context_get(output->software.ob);
58
59}
60
61static void
62gl_generic_window_use(void *engine)
63{
64 Render_Output_GL_Generic *re = engine;
65
66 re->window_use(re->software.ob);
67}
68
69static Evas_Engine_GL_Context *
70gl_generic_context_find(Render_Engine_GL_Generic *engine)
71{
72 Render_Output_GL_Generic *output;
73 Evas_Engine_GL_Context *r = NULL;
74 Eina_List *l;
75
76 EINA_LIST_FOREACH(engine->software.outputs, l, output)
77 {
78 r = gl_generic_context_get(output);
79 if (r) return r;
80 }
81
82 return r;
83}
84
85static void
86gl_generic_window_find(Render_Engine_GL_Generic *engine)
87{
88 Render_Output_GL_Generic *output;
89 Eina_List *l;
90
91 EINA_LIST_FOREACH(engine->software.outputs, l, output)
92 {
93 if (!output->software.ob) continue;
94 gl_generic_window_use(output);
95 break;
96 }
97}
98
99static int eng_gl_image_direct_get(void *data, void *image); 52static int eng_gl_image_direct_get(void *data, void *image);
100static int eng_gl_surface_destroy(void *data, void *surface); 53static int eng_gl_surface_destroy(void *data, void *surface);
101static Eina_Bool eng_gl_surface_lock(void *data, void *surface); 54static Eina_Bool eng_gl_surface_lock(void *data, void *surface);