From: Joogab Yun Date: Thu, 1 Dec 2016 04:56:15 +0000 (+0900) Subject: [evas_gl] support yuv and nv format X-Git-Tag: accepted/tizen/common/20170102.152350~99 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b27e1ab7b2c018167bf08d489fc129faf6ea1e74;p=platform%2Fupstream%2Fefl.git [evas_gl] support yuv and nv format Change-Id: I320d9b449dafd06ec6c0f46fae9bfbbe4167580d --- diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index 5f9ea18..f74a4fb 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -635,7 +635,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image) { if (glsym_glEGLImageTargetTexture2DOES) { - glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->ns_data.wl_surface.surface); + glsym_glEGLImageTargetTexture2DOES(img->native.target, n->ns_data.wl_surface.surface); GLERRV("glsym_glEGLImageTargetTexture2DOES"); } else @@ -1297,7 +1297,9 @@ eng_image_native_set(void *data, void *image, void *native) glsym_eglQueryWaylandBufferWL(ob->egl.disp, wl_buf, EGL_TEXTURE_FORMAT, &format); if ((format != EGL_TEXTURE_RGB) && - (format != EGL_TEXTURE_RGBA)) + (format != EGL_TEXTURE_RGBA)&& + (format != EGL_TEXTURE_Y_U_V_WL) && + (format != EGL_TEXTURE_Y_UV_WL)) { ERR("eglQueryWaylandBufferWL() %d format is not supported ", format); glsym_evas_gl_common_image_free(img); @@ -1351,7 +1353,11 @@ eng_image_native_set(void *data, void *image, void *native) img->native.func.bind = _native_cb_bind; img->native.func.unbind = _native_cb_unbind; img->native.func.free = _native_cb_free; - img->native.target = GL_TEXTURE_2D; + if ( (format == EGL_TEXTURE_Y_U_V_WL)|| + (format == EGL_TEXTURE_Y_UV_WL)) + img->native.target = GL_TEXTURE_EXTERNAL_OES; + else + img->native.target = GL_TEXTURE_2D; img->native.mipmap = 0; glsym_evas_gl_common_image_native_enable(img); diff --git a/src/modules/evas/engines/gl_tbm/evas_engine.c b/src/modules/evas/engines/gl_tbm/evas_engine.c old mode 100755 new mode 100644 index e07a70d..71dd9ac --- a/src/modules/evas/engines/gl_tbm/evas_engine.c +++ b/src/modules/evas/engines/gl_tbm/evas_engine.c @@ -1218,7 +1218,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image) { if (glsym_glEGLImageTargetTexture2DOES) { - glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->ns_data.wl_surface.surface); + glsym_glEGLImageTargetTexture2DOES(img->native.target, n->ns_data.wl_surface.surface); GLERRV("glsym_glEGLImageTargetTexture2DOES"); } else @@ -1581,7 +1581,9 @@ eng_image_native_set(void *data, void *image, void *native) glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf, EGL_TEXTURE_FORMAT, &format); if ((format != EGL_TEXTURE_RGB) && - (format != EGL_TEXTURE_RGBA)) + (format != EGL_TEXTURE_RGBA)&& + (format != EGL_TEXTURE_Y_U_V_WL) && + (format != EGL_TEXTURE_Y_UV_WL)) { ERR("eglQueryWaylandBufferWL() %d format is not supported ", format); glsym_evas_gl_common_image_free(img); @@ -1629,15 +1631,19 @@ eng_image_native_set(void *data, void *image, void *native) //XXX: workaround for mesa-10.2.8 // mesa's eglQueryWaylandBufferWL() with EGL_WAYLAND_Y_INVERTED_WL works incorrect. - //img->native.yinvert = yinvert; - img->native.yinvert = 1; + img->native.yinvert = yinvert; +// img->native.yinvert = 1; img->native.loose = 0; img->native.data = n; img->native.func.data = re; img->native.func.bind = _native_cb_bind; img->native.func.unbind = _native_cb_unbind; img->native.func.free = _native_cb_free; - img->native.target = GL_TEXTURE_2D; + if ( (format == EGL_TEXTURE_Y_U_V_WL)|| + (format == EGL_TEXTURE_Y_UV_WL)) + img->native.target = GL_TEXTURE_EXTERNAL_OES; + else + img->native.target = GL_TEXTURE_2D; img->native.mipmap = 0; glsym_evas_gl_common_image_native_enable(img); diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c old mode 100755 new mode 100644 index 1b25510..c477293 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -1234,7 +1234,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image) { if (glsym_glEGLImageTargetTexture2DOES) { - glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->ns_data.wl_surface.surface); + glsym_glEGLImageTargetTexture2DOES(img->native.target, n->ns_data.wl_surface.surface); GLERRV("glsym_glEGLImageTargetTexture2DOES"); } else @@ -1596,7 +1596,9 @@ eng_image_native_set(void *data, void *image, void *native) glsym_eglQueryWaylandBuffer(ob->egl_disp, wl_buf, EGL_TEXTURE_FORMAT, &format); if ((format != EGL_TEXTURE_RGB) && - (format != EGL_TEXTURE_RGBA)) + (format != EGL_TEXTURE_RGBA)&& + (format != EGL_TEXTURE_Y_U_V_WL) && + (format != EGL_TEXTURE_Y_UV_WL)) { ERR("eglQueryWaylandBuffer() %d format is not supported ", format); glsym_evas_gl_common_image_free(img); @@ -1652,7 +1654,11 @@ eng_image_native_set(void *data, void *image, void *native) img->native.func.bind = _native_cb_bind; img->native.func.unbind = _native_cb_unbind; img->native.func.free = _native_cb_free; - img->native.target = GL_TEXTURE_2D; + if ( (format == EGL_TEXTURE_Y_U_V_WL)|| + (format == EGL_TEXTURE_Y_UV_WL)) + img->native.target = GL_TEXTURE_EXTERNAL_OES; + else + img->native.target = GL_TEXTURE_2D; img->native.mipmap = 0; glsym_evas_gl_common_image_native_enable(img);