Evas GL: Try to find the best matching config for GLES1 36/47436/4
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Tue, 3 Mar 2015 08:16:06 +0000 (17:16 +0900)
committerDaeKwang Ryu <dkdk.ryu@samsung.com>
Wed, 16 Sep 2015 12:04:02 +0000 (21:04 +0900)
When configuring an EGL surface, it is important to match
EGL and X Visual infos. In this commit, we list all
compatible EGL modes (wrt. color, depth, stencil & msaa),
and then find the matching visuals in X land.

Change-Id: I0c4fb527b17bafbc9adb104d89eee9d9deff82d7

src/modules/evas/engines/gl_common/evas_gl_core.c [changed mode: 0644->0755]
src/modules/evas/engines/gl_common/evas_gl_core_private.h [changed mode: 0644->0755]
src/modules/evas/engines/gl_x11/evas_engine.c

old mode 100644 (file)
new mode 100755 (executable)
index ad79887..2c1e4bc
@@ -1547,6 +1547,8 @@ void *
 evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
 {
    EVGL_Surface *sfc = NULL;
+   char *s = NULL;
+   int direct_override = 0, direct_mem_opt = 0, evgl_msaa = 0;
    Eina_Bool need_reconfigure = EINA_FALSE;
    Eina_Bool dbg;
 
@@ -1615,7 +1617,8 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
           }
 
         INF("Creating special surface for GLES 1.x rendering");
-        evgl_engine->funcs->gles1_surface_create(evgl_engine, eng_data, sfc, cfg, w, h);
+        evgl_msaa = evgl_engine->caps.msaa_samples[(int) cfg->multisample_bits - 1];
+        evgl_engine->funcs->gles1_surface_create(eng_data, sfc, cfg, w, h, evgl_msaa);
      }
 
    // Create internal buffers
old mode 100644 (file)
new mode 100755 (executable)
index 5d5fcca..0868f81
@@ -70,7 +70,7 @@ struct _EVGL_Interface
    int         (*pbuffer_surface_destroy)(void *data, void *surface);
 
    // Create a surface for 1.x rendering (could be pbuffer or xpixmap for instance)
-   void       *(*gles1_surface_create)(EVGL_Engine *evgl, void *data, EVGL_Surface *evgl_sfc, Evas_GL_Config *cfg, int w, int h);
+   void       *(*gles1_surface_create)(void *data, EVGL_Surface *evgl_sfc, Evas_GL_Config *cfg, int w, int h, int evgl_msaa);
 
    // Destroy 1.x surface (could be pbuffer or xpixmap for instance)
    int        (*gles1_surface_destroy)(void *data, EVGL_Surface *evgl_sfc);
index 1156147..a31da51 100755 (executable)
@@ -866,14 +866,11 @@ evgl_eng_pbuffer_surface_destroy(void *data, void *surface)
 // be shared with Evas.
 // FIXME: Avoid passing evgl_engine around like that.
 static void *
-evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
-                              EVGL_Surface *evgl_sfc,
-                              Evas_GL_Config *cfg, int w, int h)
+evgl_eng_gles1_surface_create(void *data, EVGL_Surface *evgl_sfc,
+                              Evas_GL_Config *cfg, int w, int h, int evgl_msaa)
 {
-   Render_Engine *re = data;
-#ifdef GL_GLES
+   Render_Engine *re = (Render_Engine *)data;
    Eina_Bool alpha = EINA_FALSE;
-#endif
    int colordepth;
    Pixmap px;
 
@@ -921,6 +918,7 @@ evgl_eng_gles1_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
    int msaa = 0, depth = 0, stencil = 0;
    Visual *visual = NULL;
    Eina_Bool retried = EINA_FALSE;
+   int val;
 
    /* Now we need to iterate over all EGL configurations to check the compatible
     * ones and finally check their visual ID. */