[EGIT] [core/efl] master 01/01: EvasGL: Do internal make current if context changed.

2017-04-11 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=78d266e1897cc524522caa7bc8c9b8908f1096e8

commit 78d266e1897cc524522caa7bc8c9b8908f1096e8
Author: Minkyoung Kim <sleepi...@gmail.com>
Date:   Tue Apr 11 16:20:07 2017 +0900

EvasGL: Do internal make current if context changed.

Summary:
Before, rsc->current_ctx is always same with ctx.
So checking context change was meaningless.
From now, it has meaning.

Test Plan: App call evas_gl_make_current more than twice in pixels 
callback. Those surfaces are indirect rendering surface.

Reviewers: jpeg, dkdk, wonsik

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4773
---
 src/modules/evas/engines/gl_common/evas_gl_core.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c 
b/src/modules/evas/engines/gl_common/evas_gl_core.c
index d558a9d..c4d3541 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -2460,6 +2460,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, 
EVGL_Context *ctx)
Eina_Bool dbg = EINA_FALSE;
EVGL_Resource *rsc;
int curr_fbo = 0, curr_draw_fbo = 0, curr_read_fbo = 0;
+   Eina_Bool ctx_changed = EINA_FALSE;
 
// Check the input validity. If either sfc is valid but ctx is NULL, it's 
also error.
// sfc can be NULL as evas gl supports surfaceless make current
@@ -2550,6 +2551,10 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, 
EVGL_Context *ctx)
 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONTEXT);
 return 0;
  }
+
+   if (rsc->current_ctx != ctx)
+ ctx_changed = EINA_TRUE;
+
rsc->current_ctx = ctx;
rsc->current_eng = eng_data;
 
@@ -2807,7 +2812,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, 
EVGL_Context *ctx)
_framebuffer_create(>surface_fbo, ctx->version);
 
  // Attach fbo and the buffers
- if ((rsc->current_ctx != ctx) || (ctx->current_sfc != sfc) || 
(rsc->direct.rendered))
+ if ((ctx_changed) || (ctx->current_sfc != sfc) || 
(rsc->direct.rendered))
{
   sfc->current_ctx = ctx;
   if ((sfc->direct_mem_opt) && (sfc->direct_override))

-- 




[EGIT] [core/efl] master 01/01: evas: If there isn't clipper when recalcing clip, set mask.clip = NULL.

2017-04-11 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=60a97c9be30ce429c9609f631c0b24d748c9b3d7

commit 60a97c9be30ce429c9609f631c0b24d748c9b3d7
Author: Minkyoung Kim <sleepi...@gmail.com>
Date:   Tue Apr 11 13:47:55 2017 +0900

evas: If there isn't clipper when recalcing clip, set mask.clip = NULL.

Summary:
There's problem in Tizen3.0.

1. Clip set mask_obj to obj for masking.
2. Unset mask_obj from obj, and del mask_obj.
3. obj has clip.mask still. So obj is trying to do mask_subrender() for 
freeed mask_obj.

So reset clip.mask to NULL, If there isn't clipper.

Now, there's no routine for reseting clip.mask when clipper object is 
freed. isn't it?
Actually I'm not sure that clip.mask=NULL should be there as this patch.

Test Plan: Tizen3.0 wearable

Reviewers: cedric, raster, wonsik, jpeg

Subscribers: scholb.kim, dkdk

Differential Revision: https://phab.enlightenment.org/D4721

Signed-off-by: Jean-Philippe Andre <jp.an...@samsung.com>
---
 src/lib/evas/canvas/evas_object_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_main.c 
b/src/lib/evas/canvas/evas_object_main.c
index adae7d5..dcfecfc 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -311,6 +311,9 @@ evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, 
Evas_Object_Protecte
 cb = (cb * (nb + 1)) >> 8;
 ca = (ca * (na + 1)) >> 8;
  }
+   else obj->clip.mask = NULL;
+   if (!EVAS_OBJECT_DATA_VALID(obj->clip.mask))
+ obj->clip.mask = NULL;
 
if (((ca == 0) && (obj->cur->render_op == EVAS_RENDER_BLEND)) ||
(cw <= 0) || (ch <= 0))

-- 




[EGIT] [core/efl] master 01/03: ecore_evas_extn: do not update plug image when lockfile is invalid.

2017-03-21 Thread Minkyoung Kim
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=38e6780262906ffd8f6ad8de7c8a42868a13a914

commit 38e6780262906ffd8f6ad8de7c8a42868a13a914
Author: Minkyoung Kim <sleepi...@gmail.com>
Date:   Tue Mar 21 11:05:43 2017 -0700

ecore_evas_extn: do not update plug image when lockfile is invalid.

Summary:
This prevent invalid shared memory access.
Invalid access occur when server is resized sequentially from now to A-size
to B-size, and client receive A resize message after resizing B.
Then client try to render plug image with A-size, but shared memory is 
B-size
buffer. Size are mismatch. This makes segmentation fault when uploading 
texture(gl)
or rendering image(sw).

Test Plan: Indicator rendering on Tizen3.0 platform.

Reviewers: jypark, wonsik, dkdk, scholb.kim, jiin.moon, jpeg, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4711

Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c 
b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index 24b230b..af5f3de 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -1021,6 +1021,17 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void 
*event)
{
   Ipc_Data_Update *ipc;
   int n = e->response;
+  /* b->lockfd is not enough to ensure the size is same 
+   * between what server knows, and client knows.
+   * So should check file lock also. */
+  if (extn->b[n].buf && (!_extnbuf_lock_file_get(extn->b[n].buf)))
+{  
+   EINA_LIST_FREE(extn->file.updates, ipc)
+ {
+free(ipc);
+ }
+   break;
+}
 
   EINA_LIST_FREE(extn->file.updates, ipc)
 {

-- 




[EGIT] [core/efl] master 01/05: EvasGL: For depth, use renderbuffer instead of texture

2017-02-13 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c2e1eb7c54fbf2bc6848d727e78b85dafe2bbbeb

commit c2e1eb7c54fbf2bc6848d727e78b85dafe2bbbeb
Author: Minkyoung Kim <sleepi...@gmail.com>
Date:   Mon Feb 13 15:11:56 2017 +0900

EvasGL: For depth, use renderbuffer instead of texture

Summary:
glFramebufferTexture2DMultisampleEXT() supports color attachment only.
so depth attachment should be bound via renderbuffer not texture.

According to 
http://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_multisampled_render_to_texture.txt
In order to allow the use of multisampled depth and stencil buffers
when performing multisampled rendering to a texture, the extension
also adds the command RenderbufferStorageMultisampleEXT.
target, textarget, texture, and level correspond to the same
parameters for FramebufferTexture2D and have the same restrictions.
attachment must be COLOR_ATTACHMENT0.

Test Plan: Evas GL on GLES 3

Reviewers: jpeg, raster, dkdk, wonsik

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4648
---
 src/modules/evas/engines/gl_common/evas_gl_core.c | 75 +++
 1 file changed, 48 insertions(+), 27 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c 
b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 8292b5c..c81d8ec 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -500,26 +500,32 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
 _texture_attach_2d(color_buf, GL_COLOR_ATTACHMENT0, 0, mult_samples, 
EVAS_GL_GLES_2_X);
  }
 
-   // Check Depth_Stencil Format First
+  // Check Depth_Stencil Format First
 #ifdef GL_GLES
-   if (depth_fmt == GL_DEPTH_STENCIL_OES)
+   if ((depth_fmt == GL_DEPTH_STENCIL_OES) && (!mult_samples))
  {
 _texture_create(_stencil_buf);
 _texture_allocate_2d(depth_stencil_buf, depth_fmt,
depth_fmt, GL_UNSIGNED_INT_24_8_OES, w, h);
 _texture_attach_2d(depth_stencil_buf, GL_DEPTH_ATTACHMENT,
-   GL_STENCIL_ATTACHMENT, mult_samples, 
EVAS_GL_GLES_2_X);
+   GL_STENCIL_ATTACHMENT, mult_samples, EINA_FALSE);
 depth_stencil = 1;
  }
+   else if ((depth_fmt == GL_DEPTH24_STENCIL8_OES) && (mult_samples))
 #else
if (depth_fmt == GL_DEPTH24_STENCIL8)
+#endif
  {
 _renderbuffer_create(_stencil_buf);
 _renderbuffer_allocate(depth_stencil_buf, depth_fmt, w, h, 
mult_samples);
+#ifdef GL_GLES
+_renderbuffer_attach(depth_stencil_buf, GL_DEPTH_ATTACHMENT, 
EINA_FALSE);
+_renderbuffer_attach(depth_stencil_buf, GL_STENCIL_ATTACHMENT, 
EINA_FALSE);
+#else
 _renderbuffer_attach(depth_stencil_buf, GL_DEPTH_STENCIL_ATTACHMENT, 
EINA_FALSE);
+#endif
 depth_stencil = 1;
  }
-#endif
 
// Depth Attachment
if ((!depth_stencil) && (depth_fmt))
@@ -627,6 +633,7 @@ _surface_cap_check()
GL_Format depth[]   = {
{ DEPTH_NONE,   0 },
{ DEPTH_STENCIL, GL_DEPTH_STENCIL_OES },
+   { DEPTH_STENCIL, GL_DEPTH24_STENCIL8_OES },
{ DEPTH_BIT_8,   GL_DEPTH_COMPONENT },
{ DEPTH_BIT_16,  GL_DEPTH_COMPONENT16 },
{ DEPTH_BIT_24,  GL_DEPTH_COMPONENT24_OES },
@@ -1010,6 +1017,8 @@ _glenum_string_get(GLenum e)
  return "GL_DEPTH_COMPONENT16";
   case GL_DEPTH_COMPONENT24_OES:
  return "GL_DEPTH_COMPONENT24_OES";
+  case GL_DEPTH_COMPONENT32_OES:
+   return "GL_DEPTH_COMPONENT32_OES";
 
  // Stencil
   case GL_STENCIL_INDEX1_OES:
@@ -1022,6 +1031,8 @@ _glenum_string_get(GLenum e)
  // Depth_Stencil
   case GL_DEPTH_STENCIL_OES:
  return "GL_DEPTH_STENCIL_OES";
+  case GL_DEPTH24_STENCIL8_OES:
+ return "GL_DEPTH24_STENCIL8_OES";
 #else
  // Depth
   case GL_DEPTH_COMPONENT:
@@ -1193,10 +1204,16 @@ _surface_buffers_fbo_set(EVGL_Surface *sfc, GLuint fbo, 
Evas_GL_Context_Version
if (sfc->depth_stencil_buf)
  {
 #ifdef GL_GLES
-_texture_attach_2d(sfc->depth_stencil_buf, GL_DEPTH_ATTACHMENT,
-   GL_STENCIL_ATTACHMENT, sfc->msaa_samples, version);
+if (sfc->depth_stencil_fmt == GL_DEPTH_STENCIL_OES)
+  _texture_attach_2d(sfc->depth_stencil_buf, GL_DEPTH_ATTACHMENT,
+ GL_STENCIL_ATTACHMENT, sfc->msaa_samples, 
version);
+else
+  {
+ _renderbuffer_attach(sfc->depth_stencil_buf, GL_DEPTH_ATTACHMENT, 
version);
+ _renderbuffer_attach(sfc->depth_stencil_buf, 
GL_STENCIL_ATTACHMENT, version);
+  

[EGIT] [core/efl] master 05/06: Evas GL:Bind texture to correct one.

2017-01-01 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=40e9da0101e2c9afb6f823c7b21c02a011cc5300

commit 40e9da0101e2c9afb6f823c7b21c02a011cc5300
Author: Minkyoung Kim <sleepi...@gmail.com>
Date:   Mon Jan 2 15:29:48 2017 +0900

Evas GL:Bind texture to correct one.

Summary:
If user bind textureA and want to use it continuously, do not call 
glBindTexture(textureA) again.
But expect that textureA will be binding.
So EvasGL sould not change binded texture silently.
Restore texture to previous bound one after allocating new texture.
And when destroy texture, reset texture to 0 if it is current bound texture.

Test Plan: Tizen 3.0

Reviewers: wonsik, dkdk, cedric, jpeg

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D4524
---
 src/modules/evas/engines/gl_common/evas_gl_core.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c 
b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 14d17f6..8292b5c 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -234,19 +234,26 @@ _texture_allocate_2d(GLuint tex, GLint ifmt, GLenum fmt, 
GLenum type, int w, int
 {
//if (!(*tex))
//   glGenTextures(1, tex);
+   GLint curr_tex = 0;
+   glGetIntegerv(GL_TEXTURE_BINDING_2D, _tex);
+
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, ifmt, w, h, 0, fmt, type, NULL);
-   glBindTexture(GL_TEXTURE_2D, 0);
+   glBindTexture(GL_TEXTURE_2D, (GLuint)curr_tex);
 }
 
 // Destroy Texture
 static void
 _texture_destroy(GLuint *tex)
 {
+   GLint curr_tex = 0;
+   glGetIntegerv(GL_TEXTURE_BINDING_2D, _tex);
+
+   if ((GLuint)curr_tex == *tex) glBindTexture(GL_TEXTURE_2D, 0);
if (*tex)
  {
 glDeleteTextures(1, tex);

-- 




[EGIT] [core/efl] master 01/01: evas/gl_x11 : Add multiple_buffer member in native surface x11 type union.

2016-08-17 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=042e94f10d821494bc79eb84637abfdff6e04bf7

commit 042e94f10d821494bc79eb84637abfdff6e04bf7
Author: Minkyoung Kim <mer@samsung.com>
Date:   Wed Aug 17 17:50:18 2016 +0900

evas/gl_x11 : Add multiple_buffer member in native surface x11 type union.

Summary:
If native surface is multiple buffer pixmap such as named pixmap, Evas 
should recreate eglImage everyframe.
Because DDK get the buffer ID once at eglImageCreate time.
So if internal buffer ID is changed, should recreate eglImage.

Test Plan: Wearable Tizen.

Reviewers: wonsik, raster, cedric, jpeg

Reviewed By: jpeg

Subscribers: spacegrapher, dkdk, cedric

Differential Revision: https://phab.enlightenment.org/D4211
---
 src/lib/evas/Evas_Legacy.h |  3 +-
 src/modules/evas/engines/gl_x11/evas_engine.c  | 32 ++
 .../engines/software_generic/evas_native_common.h  |  1 +
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 9608891..b200c28 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -3245,7 +3245,7 @@ EAPI void  
evas_object_image_memfile_set(Evas_Object *ob
  * Magic version number to know what the native surface struct looks like
  */
 
-#define EVAS_NATIVE_SURFACE_VERSION 3
+#define EVAS_NATIVE_SURFACE_VERSION 4
 
 /**
  * Native surface types that image object supports
@@ -3300,6 +3300,7 @@ typedef struct _Evas_Native_Surface
   {
  void *visual; /**< visual of the pixmap to use (Visual) */
  unsigned long pixmap; /**< pixmap id to use (Pixmap) */
+ unsigned int  multiple_buffer; /**< From version 4. 1 if pixmap is 
multiple buffer pixmap such as named pixmap created by enlightenment. driver 
dependent. @since 1.19 */
   } x11; /**< Set this struct fields if surface data is X11 based. */
 
   struct
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c 
b/src/modules/evas/engines/gl_x11/evas_engine.c
index 34e04e5..093a025 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2037,6 +2037,31 @@ _native_bind_cb(void *image)
 #ifdef GL_GLES
if (n->ns_data.x11.surface)
  {
+if (n->ns_data.x11.multiple_buffer)
+  {
+ EGLint err;
+ if (!glsym_eglDestroyImage || !glsym_eglCreateImage)
+   {
+  ERR("Try eglDestroyImage()/eglCreateImage() on EGL with 
no support");
+  return;
+   }
+
+ glsym_eglDestroyImage(im->native.disp, 
n->ns_data.x11.surface);
+ if ((err = eglGetError()) != EGL_SUCCESS)
+   {
+  ERR("eglDestroyImage() failed.");
+  glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
+   }
+
+ n->ns_data.x11.surface = glsym_eglCreateImage(im->native.disp,
+   EGL_NO_CONTEXT,
+   EGL_NATIVE_PIXMAP_KHR,
+   (void 
*)n->ns_data.x11.pixmap,
+   NULL);
+ if (!n->ns_data.x11.surface)
+   ERR("eglCreateImage() for Pixmap 0x%#lx failed: %#x", 
n->ns_data.x11.pixmap, eglGetError());
+
+  }
 if (glsym_glEGLImageTargetTexture2DOES)
   {
  glsym_glEGLImageTargetTexture2DOES(im->native.target, 
n->ns_data.x11.surface);
@@ -2628,6 +2653,13 @@ eng_image_native_set(void *data, void *image, void 
*native)
EGL_NO_CONTEXT,

EGL_NATIVE_PIXMAP_KHR,
(void *)pm, 
NULL);
+
+ if ((ns->version < 4) ||
+ ((ns->version == 4) && !(ns->data.x11.multiple_buffer == 
1)))
+   n->ns_data.x11.multiple_buffer = 0;
+ else
+   n->ns_data.x11.multiple_buffer = 1;
+
  if (!n->ns_data.x11.surface)
{
   ERR("eglCreateImage() for Pixmap %#lx failed: %#x", pm, 
eglGetError());
diff --git a/src/modules/evas/engines/software_generic/evas_native_common.h 
b/src/modules/evas/engines/software_generic/evas_native_common.h
index a13b7a0..a3b721d 100644
--- a/src/modules/evas/engines/software_generic/evas_native_common.h
+++ b/src/modules/evas/engines/software_

[EGIT] [core/efl] master 01/01: ecore_evas_extn: Check whether server_data sender is client's server.

2016-07-13 Thread Minkyoung Kim
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1733b09e1b33b8a25dfee3731e8097db3b97b136

commit 1733b09e1b33b8a25dfee3731e8097db3b97b136
Author: Minkyoung Kim <mer@samsung.com>
Date:   Wed Jul 13 21:00:07 2016 +0900

ecore_evas_extn: Check whether server_data sender is client's server.

Summary:
Sometimes, In ipc_server_data, extn->ipc.server's data is different with 
e->server's data.

The case is as follows.

Process'A' has a server.
Process'B' has 'A's client(ee address : 0xB0).
Process'B's client die, and 'B's server created. and server's ee address is 
same with destroyed client's ee(0xB0).
At the same time, 'A's server send the message to 'B's client.
but 'B's client is died! so _ipc_server_data would manipulate 'B's server 
data.

Test Plan: Tizen Mobile Text.

Reviewers: raster, spacegrapher, jpeg, wonsik, dkdk

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4158
---
 src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c 
b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index 06f1ca8..d705df3 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -986,6 +986,8 @@ _ipc_server_data(void *data, int type EINA_UNUSED, void 
*event)
if (!extn) return ECORE_CALLBACK_PASS_ON;
if (e->major != MAJOR)
  return ECORE_CALLBACK_PASS_ON;
+   if (ee != ecore_ipc_server_data_get(extn->ipc.server))
+ return ECORE_CALLBACK_PASS_ON;
switch (e->minor)
  {
   case OP_UPDATE:

-- 




[EGIT] [core/efl] master 01/01: evas/gl_generic: Recreate texture when native surface image size is changed.

2016-07-11 Thread Minkyoung Kim
raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fd1917e90d19126f22b982c3dcaed60e28a47f34

commit fd1917e90d19126f22b982c3dcaed60e28a47f34
Author: Minkyoung Kim <mer@samsung.com>
Date:   Tue Jul 12 14:11:36 2016 +0900

evas/gl_generic: Recreate texture when native surface image size is changed.

Summary:
Now, if image is native, do not recreate texture when image size is changed.
Recreate next native surface set time. So during the time between 
image_size_set and native_surface_set, native image is fragile. Fix it.

Test Plan: Local Test

Reviewers: spacegrapher, jpeg, wonsik, dkdk, raster

Reviewed By: raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4153
---
 src/modules/evas/engines/gl_generic/evas_engine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index 0a683e5..07771f5 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -594,6 +594,7 @@ eng_image_size_set(void *data, void *image, int w, int h)
  {
 im->w = w;
 im->h = h;
+evas_gl_common_image_native_enable(im);
 return image;
  }
re->window_use(re->software.ob);

-- 




[EGIT] [core/efl] master 01/01: evas-native-tbm: fix stride mismatch and allocate image data for converting from yuv to rgb.

2016-06-13 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93b4df1f5a506492bb322a9761b5379f5f9cf6ad

commit 93b4df1f5a506492bb322a9761b5379f5f9cf6ad
Author: Minkyoung Kim <mer@samsung.com>
Date:   Mon Jun 13 15:24:14 2016 +0900

evas-native-tbm: fix stride mismatch and allocate image data for converting 
from yuv to rgb.

Summary:
1. For converting tbm buffer from yuv to rgb, image.data should be 
allocated.
2. Stride should be set by info of tbm surface.
3. The number of row is height*2. but if height is odd, last row is invalid 
in process of _evas_video_i420.

Test Plan: Local Test, Tizen2.4 Mobile

Reviewers: spacegrapher, wonsik, jpeg

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3870
---
 .../engines/software_generic/evas_native_common.h  |  2 +
 .../engines/software_generic/evas_native_tbm.c | 45 +-
 .../evas/engines/software_x11/evas_engine.c| 16 ++--
 src/modules/evas/engines/wayland_shm/evas_engine.c | 16 ++--
 4 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/src/modules/evas/engines/software_generic/evas_native_common.h 
b/src/modules/evas/engines/software_generic/evas_native_common.h
index 7bcc5ea..a13b7a0 100644
--- a/src/modules/evas/engines/software_generic/evas_native_common.h
+++ b/src/modules/evas/engines/software_generic/evas_native_common.h
@@ -107,11 +107,13 @@ struct _Native
 };
 
 EAPI void *_evas_native_tbm_surface_image_set(void *data, void *image, void 
*native);
+EAPI int _evas_native_tbm_surface_stride_get(void *data, void *native);
 EAPI int _evas_native_tbm_init(void);
 EAPI void _evas_native_tbm_shutdown(void);
 
 void *_evas_native_dmabuf_surface_image_set(void *image, void *native);
 
 typedef void *(*Evas_Native_Tbm_Surface_Image_Set_Call)(void *data, void 
*image, void *native);
+typedef int (*Evas_Native_Tbm_Surface_Stride_Get_Call)(void *data, void 
*native);
 
 #endif //_EVAS_NATIVE_COMMON_H
diff --git a/src/modules/evas/engines/software_generic/evas_native_tbm.c 
b/src/modules/evas/engines/software_generic/evas_native_tbm.c
index 752d750..af6a1ab 100644
--- a/src/modules/evas/engines/software_generic/evas_native_tbm.c
+++ b/src/modules/evas/engines/software_generic/evas_native_tbm.c
@@ -66,6 +66,7 @@ typedef struct _tbm_surface_info
 /* returns 0 on success */
 static int (*sym_tbm_surface_map) (tbm_surface_h surface, int opt, 
tbm_surface_info_s *info) = NULL;
 static int (*sym_tbm_surface_unmap) (tbm_surface_h surface) = NULL;
+static int (*sym_tbm_surface_get_info) (tbm_surface_h surface, 
tbm_surface_info_s *info) = NULL;
 
 EAPI int
 _evas_native_tbm_init(void)
@@ -100,6 +101,7 @@ _evas_native_tbm_init(void)
  fail = 0;
  SYM(tbm_lib, tbm_surface_map);
  SYM(tbm_lib, tbm_surface_unmap);
+ SYM(tbm_lib, tbm_surface_get_info);
  if (fail)
{
   dlclose(tbm_lib);
@@ -171,18 +173,18 @@ _evas_video_i420(unsigned char *evas_data, const unsigned 
char *source_data, uns
 
rows = (const unsigned char **)evas_data;
 
-   stride_y = EVAS_ROUND_UP_4(w);
-   stride_uv = EVAS_ROUND_UP_8(w) / 2;
+   stride_y = w;
+   stride_uv = w / 2;
 
for (i = 0; i < rh; i++)
  rows[i] = _data[i * stride_y];
 
-   for (j = 0; j < (rh / 2); j++, i++)
+   for (j = 0; j < ((rh + 1) / 2); j++, i++)
  rows[i] = _data[h * stride_y + j * stride_uv];
 
for (j = 0; j < (rh / 2); j++, i++)
  rows[i] = _data[h * stride_y +
-(rh / 2) * stride_uv +
+((rh + 1) / 2) * stride_uv +
 j * stride_uv];
 }
 
@@ -245,17 +247,40 @@ _native_free_cb(void *image)
Native *n = im->native.data;
 
if (!im) return;
+
im->native.data= NULL;
im->native.func.bind   = NULL;
im->native.func.unbind = NULL;
im->native.func.free   = NULL;
-   im->image.data = NULL;
 
free(n);
 
_evas_native_tbm_shutdown();
 }
 
+EAPI int
+_evas_native_tbm_surface_stride_get(void *data EINA_UNUSED, void *native)
+{
+   Evas_Native_Surface *ns = native;
+   tbm_surface_info_s info;
+   int stride;
+
+   if (!ns)
+ return -1;
+
+   if (!_evas_native_tbm_init())
+ {
+ERR("Could not initialize TBM!");
+return -1;
+ }
+
+   if (sym_tbm_surface_get_info(ns->data.tbm.buffer, ))
+ return -1;
+
+   stride = info.planes[0].stride;
+   return stride;
+ }
+
 EAPI void *
 _evas_native_tbm_surface_image_set(void *data EINA_UNUSED, void *image, void 
*native)
 {
@@ -277,13 +302,13 @@ _evas_native_tbm_surface_image_set(void *data 
EINA_UNUSED, void *image, void *na
   return NULL;
 
 tbm_surf = ns->data.tbm.buffer;
-
+/*
 if (!_evas_native_tbm_init())
   {
  ERR("Could not initialize TBM!");
 

[EGIT] [core/efl] master 01/01: evas/software_x11: Environment can influence the flow when the value is 1 not else.

2015-03-30 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=22fafce84d015368ac4838d7fd129f76218df9da

commit 22fafce84d015368ac4838d7fd129f76218df9da
Author: Minkyoung Kim mer@samsung.com
Date:   Tue Mar 31 14:13:06 2015 +0900

evas/software_x11: Environment can influence the flow when the value is 1 
not else.

Summary: Do not try swapbuf init only if value of env 'EVAS_NO_DRI_SWAPBUF' 
is 1.

Reviewers: jpeg

Subscribers: spacegrapher, cedric, wonsik

Differential Revision: https://phab.enlightenment.org/D2259
---
 src/modules/evas/engines/software_x11/evas_engine.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/software_x11/evas_engine.c 
b/src/modules/evas/engines/software_x11/evas_engine.c
index 65bb4df..91cf336 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -442,10 +442,15 @@ eng_setup(Evas *eo_e, void *in)
 if (info-info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB)
   {
  static int try_swapbuf = -1;
+ char* s;
 
  if (try_swapbuf == -1)
{
-  if (getenv(EVAS_NO_DRI_SWAPBUF)) try_swapbuf = 0;
+  if ((s = getenv(EVAS_NO_DRI_SWAPBUF)) != NULL)
+{
+   if (atoi(s) == 1) try_swapbuf = 0;
+   else try_swapbuf = 1;
+}
   else try_swapbuf = 1;
}
  if (try_swapbuf)
@@ -459,7 +464,7 @@ eng_setup(Evas *eo_e, void *in)
   info-info.mask, 
info-info.shape_dither,
   info-info.destination_alpha);
  if (re) re-outbuf_alpha_get = 
evas_software_xlib_swapbuf_alpha_get;
- else if (!re)
+ else
{
   re = _output_xlib_setup(e-output.w, e-output.h,
   info-info.rotation, 
info-info.connection,

-- 




[EGIT] [core/efl] master 01/02: evas/gl_x11: Optimize out calls to make current

2015-03-16 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0585540bb3558b2ff834a1bb730e897c6301a224

commit 0585540bb3558b2ff834a1bb730e897c6301a224
Author: Minkyoung Kim mer@samsung.com
Date:   Tue Mar 17 11:17:26 2015 +0900

evas/gl_x11: Optimize out calls to make current

Summary: Reducing the number of calling eglMakeCurrent.

Reviewers: jpeg

Subscribers: wonsik, cedric, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2094
---
 src/modules/evas/engines/gl_drm/evas_engine.c  |  1 +
 .../engines/gl_generic/Evas_Engine_GL_Generic.h|  4 +++
 src/modules/evas/engines/gl_generic/evas_engine.c  | 33 +-
 src/modules/evas/engines/gl_sdl/evas_engine.c  |  1 +
 src/modules/evas/engines/gl_x11/evas_engine.c  |  1 +
 src/modules/evas/engines/gl_x11/evas_engine.h  |  4 +++
 src/modules/evas/engines/gl_x11/evas_x_main.c  | 27 +-
 src/modules/evas/engines/wayland_egl/evas_engine.c |  1 +
 8 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c 
b/src/modules/evas/engines/gl_drm/evas_engine.c
index 11a20b6..8736e99 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -641,6 +641,7 @@ eng_setup(Evas *eo_e, void *in)
 eng_outbuf_egl_display_get,
 eng_gl_context_new,
 eng_gl_context_use,
+
NULL,//eng_outbuf_context_is_current_set
 evgl_funcs,
 epd-output.w, epd-output.h))
   {
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 e5743ee..f74bef4 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
@@ -14,6 +14,7 @@ typedef Evas_Engine_GL_Context 
*(*Window_GL_Context_Get)(Outbuf *ob);
 typedef void *(*Window_EGL_Display_Get)(Outbuf *ob);
 typedef Context_3D *(*Window_GL_Context_New)(Outbuf *ob);
 typedef void (*Window_GL_Context_Use)(Context_3D *ctx);
+typedef void (*Window_Context_Is_Current_Set)(Outbuf *ob, Eina_Bool 
context_current);
 
 struct _Render_Engine_GL_Generic
 {
@@ -24,6 +25,7 @@ struct _Render_Engine_GL_Generic
Window_EGL_Display_Get window_egl_display_get;
Window_GL_Context_New window_gl_context_new;
Window_GL_Context_Use window_gl_context_use;
+   Window_Context_Is_Current_Set window_context_is_current_set;
 
struct {
   Evas_Object_Image_Pixels_Get_Cb  get_pixels;
@@ -56,6 +58,7 @@ evas_render_engine_gl_generic_init(Render_Engine_GL_Generic 
*re,
Window_EGL_Display_Get 
window_egl_display_get,
Window_GL_Context_New window_gl_context_new,
Window_GL_Context_Use window_gl_context_use,
+   Window_Context_Is_Current_Set 
window_context_is_current_set,
const EVGL_Interface *evgl_funcs,
int w, int h)
 {
@@ -78,6 +81,7 @@ evas_render_engine_gl_generic_init(Render_Engine_GL_Generic 
*re,
re-window_egl_display_get = window_egl_display_get;
re-window_gl_context_new = window_gl_context_new;
re-window_gl_context_use = window_gl_context_use;
+   re-window_context_is_current_set = window_context_is_current_set;
 
re-func.get_pixels = NULL;
re-func.get_pixels_data = NULL;
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index 67c6deb..236a4bc 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -805,6 +805,23 @@ eng_image_data_preload_cancel(void *data EINA_UNUSED, void 
*image, const Eo *tar
evas_gl_preload_target_unregister(gim-tex, (Eo*) target);
 }
 
+static void
+eng_gl_get_pixels_pre(void *data EINA_UNUSED)
+{
+   evgl_get_pixels_pre();
+}
+
+static void
+eng_gl_get_pixels_post(void *data)
+{
+   Render_Engine_GL_Generic *re = data;
+   if (!re) return;
+
+   evgl_get_pixels_post();
+   if (re-window_context_is_current_set)
+ re-window_context_is_current_set(re-software.ob, EINA_FALSE);
+}
+
 static Eina_Bool
 eng_image_draw(void *data, void *context, void *surface, void *image, int 
src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int 
dst_h, int smooth, Eina_Bool do_async EINA_UNUSED)
 {
@@ -856,9 +873,9 @@ eng_image_draw(void *data, void *context, void *surface, 
void *image, int src_x,
  direct_surface);
 
 // Call pixel get

[EGIT] [core/efl] master 01/01: Evas GL: Fix abnormal extension name.

2015-03-01 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=de797bbd3bb5e6c137a9908c29cb124e4d396eb5

commit de797bbd3bb5e6c137a9908c29cb124e4d396eb5
Author: Minkyoung Kim mer@samsung.com
Date:   Mon Mar 2 16:16:32 2015 +0900

Evas GL: Fix abnormal extension name.

Summary: Fix abnormal extension name.

Test Plan: local test.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: wonsik, cedric, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2056

Signed-off-by: Jean-Philippe Andre jp.an...@samsung.com
---
 src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index ae738cb..c176bba 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -133,7 +133,7 @@ _EVASGL_EXT_END()
 
 
 _EVASGL_EXT_BEGIN(AMD_performance_monitor)
-   _EVASGL_EXT_DRVNAME(AMD_performance_monitor)
+   _EVASGL_EXT_DRVNAME(GL_AMD_performance_monitor)
 
_EVASGL_EXT_FUNCTION_BEGIN(void, glGetPerfMonitorGroupsAMD, (GLint* 
numGroups, GLsizei groupsSize, GLuint* groups))
 
_EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(glGetPerfMonitorGroupsAMD)

-- 




[EGIT] [core/efl] master 02/03: Evas GL: Wrap glGetString() for gles1.x.

2015-02-24 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9a0f5913144da3def33e246e0438c8529f367298

commit 9a0f5913144da3def33e246e0438c8529f367298
Author: Minkyoung Kim mer@samsung.com
Date:   Tue Feb 24 19:32:35 2015 +0900

Evas GL: Wrap glGetString() for gles1.x.

Summary:
- Implement glGetString() wrapper func in the same way as gles2.x.
- Small bug fix glGetString() for gles2.x.

Reviewers: cedric, raster, jpeg

Subscribers: cedric, mythri, wonsik, spacegrapher

Differential Revision: https://phab.enlightenment.org/D2033
---
 src/modules/evas/engines/gl_common/evas_gl_api.c   |  4 +-
 .../evas/engines/gl_common/evas_gl_api_gles1.c | 57 --
 2 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c 
b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 2628aff..2bad209 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -689,7 +689,7 @@ _evgl_glGetString(GLenum name)
 ret = glGetString(GL_SHADING_LANGUAGE_VERSION);
 if (!ret) return NULL;
 #ifdef GL_GLES
-if (ret[15] != (GLubyte) '1')
+if (ret[18] != (GLubyte) '1')
   {
  // We try not to remove the vendor fluff
  snprintf(_glsl, sizeof(_glsl), OpenGL ES GLSL ES 1.00 Evas GL 
(%s), ((char *) ret) + 18);
@@ -708,7 +708,7 @@ _evgl_glGetString(GLenum name)
 ret = glGetString(GL_VERSION);
 if (!ret) return NULL;
 #ifdef GL_GLES
-if (ret[11] != (GLubyte) '2')
+if (ret[10] != (GLubyte) '2')
   {
  // We try not to remove the vendor fluff
  snprintf(_version, sizeof(_version), OpenGL ES 2.0 Evas GL 
(%s), ((char *) ret) + 10);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c 
b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
index 18f9689..fbc5449 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
@@ -1016,11 +1016,62 @@ _evgl_gles1_glGetPointerv(GLenum pname, GLvoid **params)
 static const GLubyte *
 _evgl_gles1_glGetString(GLenum name)
 {
-   const GLubyte * ret;
+   static char _version[128] = {0};
+   EVGL_Resource *rsc;
+   const GLubyte *ret;
+
if (!_gles1_api.glGetString)
  return NULL;
-   ret = _gles1_api.glGetString(name);
-   return ret;
+
+   if ((!(rsc = _evgl_tls_resource_get())) || !rsc-current_ctx)
+ {
+ERR(Current context is NULL, not calling glGetString);
+// This sets evas_gl_error_get instead of glGetError...
+evas_gl_common_error_set(NULL, EVAS_GL_BAD_CONTEXT);
+return NULL;
+ }
+
+   if (rsc-current_ctx-version != EVAS_GL_GLES_1_X)
+ {
+ERR(Invalid context version %d, (int) rsc-current_ctx-version);
+evas_gl_common_error_set(NULL, EVAS_GL_BAD_MATCH);
+return NULL;
+ }
+
+   switch (name)
+ {
+  case GL_VENDOR:
+  case GL_RENDERER:
+  case GL_SHADING_LANGUAGE_VERSION:
+break;
+  case GL_VERSION:
+ret = glGetString(GL_VERSION);
+if (!ret) return NULL;
+#ifdef GL_GLES
+if (ret[13] != (GLubyte) '1')
+  {
+ // We try not to remove the vendor fluff
+ snprintf(_version, sizeof(_version), OpenGL ES-CM 1.1 Evas GL 
(%s), ((char *) ret) + 10);
+ _version[sizeof(_version) - 1] = '\0';
+ return (const GLubyte *) _version;
+  }
+return ret;
+#else
+// Desktop GL, we still keep the official name
+snprintf(_version, sizeof(_version), OpenGL ES-CM 1.1 Evas GL (%s), 
(char *) ret);
+_version[sizeof(_version) - 1] = '\0';
+return (const GLubyte *) _version;
+#endif
+
+  case GL_EXTENSIONS:
+return (GLubyte *) evgl_api_ext_string_get(EINA_TRUE, EINA_TRUE);
+
+  default:
+WRN(Unknown string requested: %x, (unsigned int) name);
+break;
+ }
+
+   return _gles1_api.glGetString(name);
 }
 
 static void

-- 




[EGIT] [core/efl] master 01/01: Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'.

2015-02-23 Thread Minkyoung Kim
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=65775c2e0421139951f17dd582c254a3e3e1f325

commit 65775c2e0421139951f17dd582c254a3e3e1f325
Author: Minkyoung Kim mer@samsung.com
Date:   Mon Feb 23 21:31:41 2015 +0900

Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'.

Summary:
To distinguish supported extension name from not supported.
This patch can be solution to the problem, glGetString() returns 
non-supported extention name.

Test Plan: Local tests

Reviewers: raster, jpeg, Hermet, cedric

Subscribers: cedric, spacegrapher, wonsik

Differential Revision: https://phab.enlightenment.org/D1981

Signed-off-by: Jean-Philippe Andre jp.an...@samsung.com
---
 .../evas/engines/gl_common/evas_gl_api_ext.c   | 53 +++---
 .../evas/engines/gl_common/evas_gl_api_ext.h   |  4 ++
 .../evas/engines/gl_common/evas_gl_api_ext_def.h   | 26 ---
 3 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index 248b476..87869ed 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -28,6 +28,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #define _EVASGL_EXT_BEGIN(name)
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_DRVNAME(name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
ret (*gl_ext_sym_##name) param = NULL; \
@@ -45,6 +46,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -64,6 +66,9 @@ typedef _getproc_fn (*fp_getproc)(const char *);
int _gles1_ext_support_##name = 0;
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_DRVNAME(name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+   int _gl_ext_support_func_##name = 0; \
+   int _gles1_ext_support_func_##name = 0;
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
@@ -79,6 +84,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -357,6 +363,9 @@ re-info-info.screen);
 #define _EVASGL_EXT_DRVNAME(name) \
if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1;
 
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+   if (_EVASGL_EXT_CHECK_SUPPORT(#name)) { *ext_support = 1; 
_gl_ext_support_func_##name = 1; }
+
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
 
@@ -398,6 +407,7 @@ re-info-info.screen);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -407,6 +417,10 @@ re-info-info.screen);
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
 #undef GETPROCADDR
+   
/
+
+   _gl_ext_string[0] = 0x00; //NULL;
+   _gl_ext_string_official[0] = 0x00;
 

/
// Extension HEADER
@@ -422,12 +436,18 @@ re-info-info.screen);
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_CHECK_SUPPORT(name)
 #define _EVASGL_EXT_DISCARD_SUPPORT()
+#define _EVASGL_EXT_DRVNAME_PRINT(name) \
+   { \
+  strncat(_gl_ext_string, name , MAX_EXTENSION_STRING_BUFFER); \
+  if ((strncmp(name, GL, 2) == 0)  
(strstr(_gl_ext_string_official, name) == NULL)) \
+strncat(_gl_ext_string_official, name , 
MAX_EXTENSION_STRING_BUFFER); \
+   }
 #define _EVASGL_EXT_DRVNAME(name) \
-   if (_curext_supported) \
- { \
-strncat(_gl_ext_string, #name , MAX_EXTENSION_STRING_BUFFER); \
-strncat(_gl_ext_string_official, #name , 
MAX_EXTENSION_STRING_BUFFER); \
- }
+ if (_curext_supported) \
+   _EVASGL_EXT_DRVNAME_PRINT(#name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+ if (_curext_supported  _gl_ext_support_func_##name) \
+   _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
@@ -442,8 +462,10 @@ re-info-info.screen);
 #undef _EVASGL_EXT_DISCARD_SUPPORT
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
+#undef

[EGIT] [core/efl] efl-1.13 02/02: Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'.

2015-02-23 Thread Minkyoung Kim
jpeg pushed a commit to branch efl-1.13.

http://git.enlightenment.org/core/efl.git/commit/?id=70d9ed501bd041a5d514f04917c4828eeba7c09d

commit 70d9ed501bd041a5d514f04917c4828eeba7c09d
Author: Minkyoung Kim mer@samsung.com
Date:   Mon Feb 23 21:31:41 2015 +0900

Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'.

Summary:
To distinguish supported extension name from not supported.
This patch can be solution to the problem, glGetString() returns 
non-supported extention name.

Test Plan: Local tests

Reviewers: raster, jpeg, Hermet, cedric

Subscribers: cedric, spacegrapher, wonsik

Differential Revision: https://phab.enlightenment.org/D1981

Signed-off-by: Jean-Philippe Andre jp.an...@samsung.com
---
 .../evas/engines/gl_common/evas_gl_api_ext.c   | 53 +++---
 .../evas/engines/gl_common/evas_gl_api_ext.h   |  4 ++
 .../evas/engines/gl_common/evas_gl_api_ext_def.h   | 26 ---
 3 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c 
b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index 248b476..87869ed 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -28,6 +28,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #define _EVASGL_EXT_BEGIN(name)
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_DRVNAME(name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
ret (*gl_ext_sym_##name) param = NULL; \
@@ -45,6 +46,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -64,6 +66,9 @@ typedef _getproc_fn (*fp_getproc)(const char *);
int _gles1_ext_support_##name = 0;
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_DRVNAME(name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+   int _gl_ext_support_func_##name = 0; \
+   int _gles1_ext_support_func_##name = 0;
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
@@ -79,6 +84,7 @@ typedef _getproc_fn (*fp_getproc)(const char *);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -357,6 +363,9 @@ re-info-info.screen);
 #define _EVASGL_EXT_DRVNAME(name) \
if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1;
 
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+   if (_EVASGL_EXT_CHECK_SUPPORT(#name)) { *ext_support = 1; 
_gl_ext_support_func_##name = 1; }
+
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
 
@@ -398,6 +407,7 @@ re-info-info.screen);
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
 #undef _EVASGL_EXT_DRVNAME
+#undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
 #undef _EVASGL_EXT_FUNCTION_END
@@ -407,6 +417,10 @@ re-info-info.screen);
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
 
 #undef GETPROCADDR
+   
/
+
+   _gl_ext_string[0] = 0x00; //NULL;
+   _gl_ext_string_official[0] = 0x00;
 

/
// Extension HEADER
@@ -422,12 +436,18 @@ re-info-info.screen);
 #define _EVASGL_EXT_END()
 #define _EVASGL_EXT_CHECK_SUPPORT(name)
 #define _EVASGL_EXT_DISCARD_SUPPORT()
+#define _EVASGL_EXT_DRVNAME_PRINT(name) \
+   { \
+  strncat(_gl_ext_string, name , MAX_EXTENSION_STRING_BUFFER); \
+  if ((strncmp(name, GL, 2) == 0)  
(strstr(_gl_ext_string_official, name) == NULL)) \
+strncat(_gl_ext_string_official, name , 
MAX_EXTENSION_STRING_BUFFER); \
+   }
 #define _EVASGL_EXT_DRVNAME(name) \
-   if (_curext_supported) \
- { \
-strncat(_gl_ext_string, #name , MAX_EXTENSION_STRING_BUFFER); \
-strncat(_gl_ext_string_official, #name , 
MAX_EXTENSION_STRING_BUFFER); \
- }
+ if (_curext_supported) \
+   _EVASGL_EXT_DRVNAME_PRINT(#name)
+#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
+ if (_curext_supported  _gl_ext_support_func_##name) \
+   _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
 #define _EVASGL_EXT_FUNCTION_END()
@@ -442,8 +462,10 @@ re-info-info.screen);
 #undef _EVASGL_EXT_DISCARD_SUPPORT
 #undef _EVASGL_EXT_BEGIN
 #undef _EVASGL_EXT_END
+#undef

[EGIT] [core/efl] master 02/02: evas: fix error checking of eglBindAPI.

2015-02-17 Thread Minkyoung Kim
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4aeb8a4e7dcbc79207535c49b3766aea4ea86f79

commit 4aeb8a4e7dcbc79207535c49b3766aea4ea86f79
Author: Minkyoung Kim mer@samsung.com
Date:   Tue Feb 17 16:34:35 2015 +0100

evas: fix error checking of eglBindAPI.

Summary: If eglGetError sequencially called, second eglGetError() doesn't 
give the information of real Error.

@fix

Reviewers: raster, jpeg, cedric, Hermet

Subscribers: cedric, spacegrapher, wonsik

Differential Revision: https://phab.enlightenment.org/D1982

Signed-off-by: Cedric BAIL ced...@osg.samsung.com
---
 src/modules/evas/engines/gl_x11/evas_x_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c 
b/src/modules/evas/engines/gl_x11/evas_x_main.c
index 0c96f55..db8d70a 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -175,8 +175,7 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info,
 eng_window_free(gw);
 return NULL;
  }
-   eglBindAPI(EGL_OPENGL_ES_API);
-   if (eglGetError() != EGL_SUCCESS)
+   if (!eglBindAPI(EGL_OPENGL_ES_API))
  {
 ERR(eglBindAPI() fail. code=%#x, eglGetError());
 eng_window_free(gw);

-- 




[EGIT] [core/efl] master 01/05: evas: Evas GL - add glGetError() after surface capability test.

2015-02-16 Thread Minkyoung Kim
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c972994e01aafc2e9408cbd8abea00a35f139e32

commit c972994e01aafc2e9408cbd8abea00a35f139e32
Author: Minkyoung Kim mer@samsung.com
Date:   Mon Feb 16 11:54:23 2015 +0100

evas: Evas GL - add glGetError() after surface capability test.

Summary:
After using gl funcs, must call glGetError().
To prevent wrong error catch for subsequent glGetError().

Test Plan: Local tests

Reviewers: raster, jpeg, Hermet, cedric

Reviewed By: cedric

Subscribers: spacegrapher, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D1978

Signed-off-by: Cedric BAIL ced...@osg.samsung.com
---
 src/modules/evas/engines/gl_common/evas_gl_core.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c 
b/src/modules/evas/engines/gl_common/evas_gl_core.c
index ca37da4..d2078dd 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -340,9 +340,13 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
 
// Return the result
if (fb_status != GL_FRAMEBUFFER_COMPLETE)
-   {
-   // Put Error Log...
-  return 0;
+ {
+int err = glGetError();
+
+if (err != GL_NO_ERROR)
+   DBG(glGetError() returns %x , err);
+
+return 0;
}
else
   return 1;

--