summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Vorobiov <s.vorobiov@samsung.com>2013-11-28 18:18:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-11-29 19:09:17 +0900
commit9e3b778acb851671c2f24454b80bdeafc20d1c65 (patch)
treeb023887f2d4d3252948a7e4335d0d1ed70af9c6f
parent62093d99d4d73668c1133b13fb496baf5e56be7a (diff)
downloadefl-9e3b778acb851671c2f24454b80bdeafc20d1c65.tar.gz
evas - fix gl egl textrue from pixmap support y invert query extension
Instead of hardcoding yinvert=1 we should query for EGL_NOK_texture_from_pixmap extension and if it's present use EGL_Y_INVERTED_NOK value
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index d25610f1f3..4e5c22cea9 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -71,6 +71,7 @@ struct _Render_Engine
static int initted = 0;
static int gl_wins = 0;
static int extn_have_buffer_age = 1;
+static int extn_have_y_inverted = 0;
typedef void (*_eng_fn) (void);
typedef _eng_fn (*glsym_func_eng_fn) ();
@@ -90,6 +91,9 @@ static Eina_Bool eng_preload_make_current(void *data, void *doit);
#ifndef EGL_BUFFER_AGE_EXT
# define EGL_BUFFER_AGE_EXT 0x313d
#endif
+#ifndef EGL_Y_INVERTED_NOK
+# define EGL_Y_INVERTED_NOK 0x307F
+#endif
_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL;
void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e) = NULL;
@@ -711,6 +715,10 @@ gl_extn_veto(Render_Engine *re)
{
extn_have_buffer_age = 0;
}
+ if (strstr(str, "EGL_NOK_texture_from_pixmap"))
+ {
+ extn_have_y_inverted = 1;
+ }
}
else
{
@@ -2225,6 +2233,7 @@ eng_image_native_set(void *data, void *image, void *native)
EGLConfig egl_config;
int config_attrs[20];
int num_config, i = 0;
+ int yinvert = 1;
eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im);
@@ -2250,6 +2259,15 @@ eng_image_native_set(void *data, void *image, void *native)
if (!eglChooseConfig(re->win->egl_disp, config_attrs,
&egl_config, 1, &num_config))
ERR("eglChooseConfig() failed for pixmap 0x%x, num_config = %i", (unsigned int)pm, num_config);
+ else
+ {
+ int val;
+ if (extn_have_y_inverted &&
+ eglGetConfigAttrib(re->win->egl_disp, egl_config,
+ EGL_Y_INVERTED_NOK, &val))
+ yinvert = val;
+ }
+
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
n->pixmap = pm;
n->visual = vis;
@@ -2263,7 +2281,7 @@ eng_image_native_set(void *data, void *image, void *native)
ERR("Try eglCreateImage on EGL with no support");
if (!n->egl_surface)
ERR("eglCreatePixmapSurface() for 0x%x failed", (unsigned int)pm);
- im->native.yinvert = 1;
+ im->native.yinvert = yinvert;
im->native.loose = 0;
im->native.data = n;
im->native.func.data = re;