summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-09-25 05:59:24 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-09-25 05:59:24 +0000
commit469f6ef303131f9b9266cb3077f4d1123b38c61e (patch)
tree4a46c7b3a58d9b26b9607cee3dd5fc0587349e91 /legacy
parent06fa0ad166fc0ee9031031868fc206d8d0f105b0 (diff)
and fill in some more apis and notes - still doesnt work.
SVN revision: 77044
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/src/modules/engines/software_x11/evas_x_egl.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/legacy/evas/src/modules/engines/software_x11/evas_x_egl.c b/legacy/evas/src/modules/engines/software_x11/evas_x_egl.c
index b91da996cc..5ea22aa338 100644
--- a/legacy/evas/src/modules/engines/software_x11/evas_x_egl.c
+++ b/legacy/evas/src/modules/engines/software_x11/evas_x_egl.c
@@ -69,6 +69,8 @@ static struct {
69 unsigned int (*QuerySurface) (void *ed, void *surf, int attr, int *val); 69 unsigned int (*QuerySurface) (void *ed, void *surf, int attr, int *val);
70 void * (*CreateWindowSurface) (void *ed, void *config, Window win, int *attr); 70 void * (*CreateWindowSurface) (void *ed, void *config, Window win, int *attr);
71 unsigned int (*DestroySurface) (void *ed, void *surf); 71 unsigned int (*DestroySurface) (void *ed, void *surf);
72 unsigned int (*SwapBuffers) (void *ed, void *surf);
73 unsigned int (*SwapInterval) (void *ed, int interval);
72 74
73 unsigned int (*LockSurface) (void *ed, void *surf, int *attr); 75 unsigned int (*LockSurface) (void *ed, void *surf, int *attr);
74 unsigned int (*UnlockSurface) (void *ed, void *surf); 76 unsigned int (*UnlockSurface) (void *ed, void *surf);
@@ -97,6 +99,8 @@ _egl_find(void)
97 SYM(QuerySurface, "eglQuerySurface"); 99 SYM(QuerySurface, "eglQuerySurface");
98 SYM(CreateWindowSurface, "eglCreateWindowSurface"); 100 SYM(CreateWindowSurface, "eglCreateWindowSurface");
99 SYM(DestroySurface, "eglDestroySurface"); 101 SYM(DestroySurface, "eglDestroySurface");
102 SYM(SwapBuffers, "eglSwapBuffers");
103 SYM(SwapInterval, "eglSwapInterval");
100 104
101#undef SYM 105#undef SYM
102#define SYM(x, y) egl.x = egl.GetProcAddress(y) 106#define SYM(x, y) egl.x = egl.GetProcAddress(y)
@@ -202,13 +206,13 @@ _egl_x_win_surf_free(void *ed, void *surf)
202} 206}
203 207
204void * 208void *
205_egl_x_map_surf(void *ed, void *surf, int *stride) 209_egl_x_surf_map(void *ed, void *surf, int *stride)
206{ 210{
207#ifdef BUILD_ENGINE_SOFTWARE_XLIB 211#ifdef BUILD_ENGINE_SOFTWARE_XLIB
208 int config_attrs[40], n = 0; 212 int config_attrs[40], n = 0;
209 void *ptr = NULL; 213 void *ptr = NULL;
210 int pitch = 0, origin = 0; 214 int pitch = 0, origin = 0;
211 int r_offset = 0, g_offset = 0, b_offset = 0, a_offset = 0; 215 int r_offset = 0, g_offset = 0, b_offset = 0;
212 216
213 if (!_egl_find()) return NULL; 217 if (!_egl_find()) return NULL;
214 218
@@ -225,14 +229,15 @@ _egl_x_map_surf(void *ed, void *surf, int *stride)
225 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_RED_OFFSET_KHR, &r_offset)) goto err; 229 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_RED_OFFSET_KHR, &r_offset)) goto err;
226 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR, &g_offset)) goto err; 230 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR, &g_offset)) goto err;
227 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR, &b_offset)) goto err; 231 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR, &b_offset)) goto err;
228 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR, &a_offset)) goto err;
229 232
230 if (!ptr) goto err; 233 if (!ptr) goto err;
231 if (pitch <= 0) goto err; 234 if (pitch <= 0) goto err;
232 // need to check rgb offset matiching sw pixel fmt 235 // must be top-left to bottom-right ordered
233 // do we add origin to ptr? 236 if (origin != EGL_UPPER_LEFT_KHR) goto err;
234 // is pitch in bytes? 237 // must be xRGB
235 *stride = pitch; 238 if (!((b_offset == 0) && (g_offset == 8) && (r_offset == 16))) goto err;
239 // return stride
240 *stride = pitch; // pitch is in bytes
236 return ptr; 241 return ptr;
237err: 242err:
238 egl.UnlockSurface(ed, surf); 243 egl.UnlockSurface(ed, surf);
@@ -243,9 +248,19 @@ err:
243} 248}
244 249
245void 250void
246_egl_x_unmap_surf(void *ed, void *surf) 251_egl_x_surf_unmap(void *ed, void *surf)
247{ 252{
248#ifdef BUILD_ENGINE_SOFTWARE_XLIB 253#ifdef BUILD_ENGINE_SOFTWARE_XLIB
249 egl.UnlockSurface(ed, surf); 254 egl.UnlockSurface(ed, surf);
250#endif 255#endif
251} 256}
257
258void
259_egl_x_surf_swap(void *ed, void *surf, int vsync)
260{
261#ifdef BUILD_ENGINE_SOFTWARE_XLIB
262 if (vsync) egl.SwapInterval(ed, 1);
263 else egl.SwapInterval(ed, 0);
264 egl.SwapBuffers(ed, surf);
265#endif
266}