[evas_gl] Evas GL Render Threading Patch 30/103330/2
authorJoogab Yun <joogab.yun@samsung.com>
Thu, 8 Dec 2016 05:32:25 +0000 (14:32 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 9 Dec 2016 06:50:17 +0000 (22:50 -0800)
Change-Id: Ifefc491ec2b927130c6ac04c13cf32a0d1231922

50 files changed:
configure.ac
src/Makefile_Evas.am
src/lib/evas/Evas_GL.h
src/lib/evas/canvas/evas_main.c
src/lib/evas/canvas/evas_object_image.c
src/lib/evas/common/evas_thread_render.c
src/lib/evas/include/evas_common_private.h
src/lib/evas/include/evas_private.h
src/modules/evas/engines/gl_common/evas_gl_3d.c
src/modules/evas/engines/gl_common/evas_gl_3d_renderer.c
src/modules/evas/engines/gl_common/evas_gl_3d_shader.c
src/modules/evas/engines/gl_common/evas_gl_api.c
src/modules/evas/engines/gl_common/evas_gl_api_ext.c
src/modules/evas/engines/gl_common/evas_gl_api_ext.h
src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
src/modules/evas/engines/gl_common/evas_gl_common.h
src/modules/evas/engines/gl_common/evas_gl_context.c
src/modules/evas/engines/gl_common/evas_gl_core.c
src/modules/evas/engines/gl_common/evas_gl_core_private.h
src/modules/evas/engines/gl_common/evas_gl_file_cache.c
src/modules/evas/engines/gl_common/evas_gl_line.c
src/modules/evas/engines/gl_common/evas_gl_shader.c
src/modules/evas/engines/gl_common/evas_gl_texture.c
src/modules/evas/engines/gl_common/evas_gl_thread.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_egl.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_egl.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.h [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_glx.c [new file with mode: 0644]
src/modules/evas/engines/gl_common/evas_gl_thread_glx.h [new file with mode: 0644]
src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
src/modules/evas/engines/gl_generic/evas_engine.c
src/modules/evas/engines/gl_x11/evas_engine.c
src/modules/evas/engines/gl_x11/evas_engine.h
src/modules/evas/engines/gl_x11/evas_x_main.c
src/modules/evas/engines/wayland_egl/evas_engine.c
src/modules/evas/engines/wayland_egl/evas_engine.h
src/modules/evas/engines/wayland_egl/evas_wl_main.c

index 3382ac1..8aaba7b 100755 (executable)
@@ -1996,7 +1996,7 @@ fi
 # OpenGL common
 evas_engine_gl_common_cflags=""
 if test "x${have_egl}" = "xyes"; then
-   evas_engine_gl_common_libs="-lEGL"
+   evas_engine_gl_common_libs="-lEGL -lGLESv2"
 else
    evas_engine_gl_common_libs="-lGL"
 fi
index 54cbcd4..b6187ed 100755 (executable)
@@ -676,6 +676,16 @@ BUILT_SOURCES += \
 modules/evas/engines/gl_generic/ector_cairo_software_surface.eo.c \
 modules/evas/engines/gl_generic/ector_cairo_software_surface.eo.h
 
+GL_COMMON_THREAD_SOURCES = \
+modules/evas/engines/gl_common/evas_gl_thread.h \
+modules/evas/engines/gl_common/evas_gl_thread.c \
+modules/evas/engines/gl_common/evas_gl_thread_egl.h \
+modules/evas/engines/gl_common/evas_gl_thread_egl.c \
+modules/evas/engines/gl_common/evas_gl_thread_glx.h \
+modules/evas/engines/gl_common/evas_gl_thread_glx.c \
+modules/evas/engines/gl_common/evas_gl_thread_gl.h \
+modules/evas/engines/gl_common/evas_gl_thread_gl.c
+
 GL_COMMON_SOURCES = \
 modules/evas/engines/gl_common/evas_gl_private.h \
 modules/evas/engines/gl_common/evas_gl_common.h \
@@ -701,6 +711,7 @@ modules/evas/engines/gl_common/evas_gl_api_gles1.c \
 modules/evas/engines/gl_common/evas_gl_api_gles3_def.h \
 modules/evas/engines/gl_common/evas_gl_api_ext.c \
 modules/evas/engines/gl_common/evas_gl_surface_cache.c \
+$(GL_COMMON_THREAD_SOURCES) \
 modules/evas/engines/gl_common/shader/evas_gl_shaders.x \
 modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x \
 $(NULL)
@@ -766,7 +777,9 @@ lib_evas_libevas_la_LIBADD += @evas_engine_gl_common_libs@ @TTRACE_LIBS@
 else
 noinst_LTLIBRARIES += modules/evas/engines/gl_common/libevas_engine_gl_common.la
 modules_evas_engines_gl_common_libevas_engine_gl_common_la_SOURCES = $(GL_COMMON_SOURCES)
-modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
+modules_evas_engines_gl_common_libevas_engine_gl_common_la_CPPFLAGS = \
+-DEVAS_GL_RENDER_THREAD_IS_GENERIC \
+-I$(top_builddir)/src/lib/efl \
 -I$(top_srcdir)/src/lib/evas/include \
 -I$(top_srcdir)/src/lib/evas/cserve2 \
 @EVAS_CFLAGS@
@@ -782,6 +795,7 @@ $(install_engineglgenericpkgLTLIBRARIES): install-libLTLIBRARIES
 
 modules_evas_engines_gl_generic_module_la_SOURCES = $(GL_GENERIC_SOURCES)
 modules_evas_engines_gl_generic_module_la_CFLAGS = \
+-DEVAS_GL_RENDER_THREAD_IS_GENERIC \
 -I$(top_builddir)/src/lib/efl \
 -I$(top_srcdir)/src/lib/evas/include \
 -I$(top_srcdir)/src/lib/evas/cserve2 \
@@ -903,6 +917,7 @@ endif
 if BUILD_ENGINE_GL_X11
 dist_installed_evasmainheaders_DATA += modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h
 GL_X11_SOURCES = \
+$(GL_COMMON_THREAD_SOURCES) \
 modules/evas/engines/gl_x11/evas_engine.c \
 modules/evas/engines/gl_x11/evas_x_main.c \
 modules/evas/engines/gl_x11/evas_engine.h
@@ -1122,6 +1137,7 @@ endif
 if BUILD_ENGINE_WAYLAND_EGL
 dist_installed_evasmainheaders_DATA += modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
 WAYLAND_EGL_SOURCES = \
+$(GL_COMMON_THREAD_SOURCES) \
 modules/evas/engines/wayland_egl/evas_engine.c \
 modules/evas/engines/wayland_egl/evas_wl_main.c \
 modules/evas/engines/wayland_egl/evas_engine.h
index 51899e7..81003cb 100644 (file)
@@ -492,9 +492,12 @@ typedef enum _Evas_GL_Options_Bits
 {
    EVAS_GL_OPTIONS_NONE    = 0,     /**< No extra options */
    EVAS_GL_OPTIONS_DIRECT  = (1<<0),/**< Optional hint to allow rendering directly to the Evas window if possible */
-   EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION = (1<<1) /**< Force direct rendering even if the canvas is rotated.
+   EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION = (1<<1),/**< Force direct rendering even if the canvas is rotated.
                                                   *   In that case, it is the application's role to rotate the contents of
                                                   *   the Evas_GL view. @see evas_gl_rotation_get */
+   EVAS_GL_OPTIONS_THREAD  = (1<<2) /**< If enabled, Evas GL pixel callback will be called by another thread instead of main thread.
+                                     * This option can enhance performance because Evas GL is worked with aynchronized call,
+                                     * but user must guarantee synchronization with pixel callback and main loop when using this flag. */
 } Evas_GL_Options_Bits;
 
 /**
index 13d876b..4dfd33f 100644 (file)
@@ -67,7 +67,7 @@ evas_init(void)
    evas_filter_init();
    evas_cache_svg_init();
 
-   if(!evas_thread_init())
+   if(!evas_threads_init())
      goto shutdown_thread;
 
    eina_log_timing(_evas_log_dom_global,
@@ -146,7 +146,7 @@ evas_shutdown(void)
    evas_object_filter_cow = NULL;
    evas_object_mask_cow = NULL;
 
-   evas_thread_shutdown();
+   evas_threads_shutdown();
    _evas_preload_thread_shutdown();
    evas_async_events_shutdown();
    evas_common_shutdown();
index dba5199..251014e 100644 (file)
@@ -3093,6 +3093,10 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
                {
                   if (ENFN->gl_get_pixels_pre)
                     ENFN->gl_get_pixels_pre(output);
+                  // IS INDIRECT RENDERING #1
+                  if (ENFN->gl_get_pixels)
+                    ENFN->gl_get_pixels(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj, o->engine_data);
+                  else
                   o->pixels->func.get_pixels(o->pixels->func.get_pixels_data, eo_obj);
                   if (ENFN->gl_get_pixels_post)
                     ENFN->gl_get_pixels_post(output);
@@ -3137,7 +3141,11 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
                   // Auto-fallback to FBO rendering (for perf & power consumption)
                   if (ENFN->gl_get_pixels_pre)
                     ENFN->gl_get_pixels_pre(output);
-                  o->pixels->func.get_pixels(o->pixels->func.get_pixels_data, obj->object);
+                  // IS INDIRECT RENDERING #2
+                  if (ENFN->gl_get_pixels)
+                    ENFN->gl_get_pixels(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj, o->engine_data);
+                  else
+                    o->pixels->func.get_pixels(o->pixels->func.get_pixels_data, eo_obj);
                   if (ENFN->gl_get_pixels_post)
                     ENFN->gl_get_pixels_post(output);
                   o->direct_render = EINA_FALSE;
index dd76660..f2815f5 100644 (file)
@@ -2,17 +2,30 @@
 
 #include <assert.h>
 
-static Eina_Thread evas_thread_worker;
-static Eina_Condition evas_thread_queue_condition;
-static Eina_Lock evas_thread_queue_lock;
-static Eina_Bool evas_thread_queue_ready = EINA_FALSE;
-static Eina_Inarray evas_thread_queue;
-static Evas_Thread_Command *evas_thread_queue_cache = NULL;
-static unsigned int evas_thread_queue_cache_max = 0;
-
-static volatile int evas_thread_exited = 0;
-static Eina_Bool exit_thread = EINA_FALSE;
-static int init_count = 0;
+typedef struct
+{
+   char *thread_name;
+   Eina_Thread worker;
+   Eina_Condition queue_condition;
+   Eina_Lock queue_lock;
+   Eina_Bool queue_ready;
+   Eina_Inarray queue;
+   Evas_Thread_Command *queue_cache;
+   unsigned int queue_cache_max;
+
+   Eina_Condition finish_condition;
+   Eina_Lock finish_lock;
+   Evas_Thread_Command *waiting_cmd;
+
+   volatile int exited;
+   Eina_Bool exit_thread;
+} Evas_Thread;
+
+static int evas_threads_init_count = 0;
+
+static Evas_Thread evas_thread_software;
+static Evas_Thread evas_thread_gl;
+static Evas_Thread evas_thread_evgl;
 
 #define SHUTDOWN_TIMEOUT_RESET (0)
 #define SHUTDOWN_TIMEOUT_CHECK (1)
@@ -31,13 +44,13 @@ _shutdown_timeout(double *time, int mode, int timeout_ms)
 }
 
 static void
-evas_thread_queue_append(Evas_Thread_Command_Cb cb, void *data, Eina_Bool do_flush)
+evas_thread_queue_append(Evas_Thread *ev_thread, Evas_Thread_Command_Cb cb, void *data, Eina_Bool do_flush, Eina_Bool do_finish)
 {
    Evas_Thread_Command *cmd;
 
-   eina_lock_take(&evas_thread_queue_lock);
+   eina_lock_take(&ev_thread->queue_lock);
 
-   cmd = eina_inarray_grow(&evas_thread_queue, 1);
+   cmd = eina_inarray_grow(&ev_thread->queue, 1);
    if (cmd)
      {
         cmd->cb = cb;
@@ -49,183 +62,274 @@ evas_thread_queue_append(Evas_Thread_Command_Cb cb, void *data, Eina_Bool do_flu
         goto out;
      }
 
+   if (do_finish)
+     {
+        eina_lock_take(&ev_thread->finish_lock);
+        ev_thread->waiting_cmd = cmd;
+        eina_lock_release(&ev_thread->finish_lock);
+     }
+
    if (do_flush)
      {
-        evas_thread_queue_ready = EINA_TRUE;
-        eina_condition_signal(&evas_thread_queue_condition);
+        ev_thread->queue_ready = EINA_TRUE;
+        eina_condition_signal(&ev_thread->queue_condition);
      }
 
 out:
-   eina_lock_release(&evas_thread_queue_lock);
+   eina_lock_release(&ev_thread->queue_lock);
 }
 
 EAPI void
 evas_thread_cmd_enqueue(Evas_Thread_Command_Cb cb, void *data)
 {
-    evas_thread_queue_append(cb, data, EINA_FALSE);
+   evas_thread_queue_append(&evas_thread_software, cb, data, EINA_FALSE, EINA_FALSE);
 }
 
 EAPI void
 evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data)
 {
-    evas_thread_queue_append(cb, data, EINA_TRUE);
+   evas_thread_queue_append(&evas_thread_software, cb, data, EINA_TRUE, EINA_FALSE);
 }
 
+EAPI void
+evas_gl_thread_cmd_enqueue(int thread_type, Evas_Thread_Command_Cb cb, void *data, int thread_mode)
+{
+   Evas_Thread *ev_thread = NULL;
+
+   if (thread_type == EVAS_GL_THREAD_TYPE_GL)
+      ev_thread = &evas_thread_gl;
+   else if (thread_type == EVAS_GL_THREAD_TYPE_EVGL)
+      ev_thread = &evas_thread_evgl;
+   else
+      ERR("GL thread type is invalid");
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_ENQUEUE)
+      evas_thread_queue_append(ev_thread, cb, data, EINA_FALSE, EINA_FALSE);
+   else if (thread_mode == EVAS_GL_THREAD_MODE_FLUSH)
+      evas_thread_queue_append(ev_thread, cb, data, EINA_TRUE, EINA_FALSE);
+   else if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     {
+        evas_thread_queue_append(ev_thread, cb, data, EINA_TRUE, EINA_TRUE);
+        while (ev_thread->waiting_cmd)
+          {
+             sched_yield();
+          }
+     }
+   else
+      ERR("GL thread mode is invalid");
+}
+
+EAPI Eina_Thread
+evas_gl_thread_get(int thread_type)
+{
+   Evas_Thread *ev_thread = NULL;
+
+   if (thread_type == EVAS_GL_THREAD_TYPE_GL)
+      ev_thread = &evas_thread_gl;
+   else if (thread_type == EVAS_GL_THREAD_TYPE_EVGL)
+      ev_thread = &evas_thread_evgl;
+   else
+     {
+        ERR("GL thread type is invalid");
+        return (Eina_Thread)NULL;
+     }
+
+   return ev_thread->worker;
+}
+
+
 static void*
-evas_thread_worker_func(void *data EINA_UNUSED, Eina_Thread thread EINA_UNUSED)
+evas_thread_worker_func(void *data, Eina_Thread thread EINA_UNUSED)
 {
-   eina_thread_name_set(eina_thread_self(), "Eevas-thread-wk");
+   Evas_Thread *ev_thread = data;
+   eina_thread_name_set(eina_thread_self(), ev_thread->thread_name);
    while (1)
-      {
-         Evas_Thread_Command *cmd;
-         unsigned int len, max;
-
-         eina_lock_take(&evas_thread_queue_lock);
-
-         while (!evas_thread_queue_ready)
-           {
-              if (exit_thread)
-                {
-                   eina_lock_release(&evas_thread_queue_lock);
-                   goto out;
-                }
-              eina_condition_wait(&evas_thread_queue_condition);
-           }
-
-         if (!eina_inarray_count(&evas_thread_queue))
-           {
-              ERR("Signaled to find an empty queue. BUG!");
-              evas_thread_queue_ready = EINA_FALSE;
-              eina_lock_release(&evas_thread_queue_lock);
-              continue;
-           }
-
-         cmd = evas_thread_queue.members;
-         evas_thread_queue.members = evas_thread_queue_cache;
-         evas_thread_queue_cache = cmd;
-
-         max = evas_thread_queue.max;
-         evas_thread_queue.max = evas_thread_queue_cache_max;
-         evas_thread_queue_cache_max = max;
-
-         len = evas_thread_queue.len;
-         evas_thread_queue.len = 0;
-
-         evas_thread_queue_ready = EINA_FALSE;
-
-         eina_lock_release(&evas_thread_queue_lock);
-
-         DBG("Evas render thread command queue length: %u", len);
-
-         eina_evlog("+thread", NULL, 0.0, NULL);
-         while (len)
-           {
-              assert(cmd->cb);
-
-              eina_evlog("+thread_do", cmd->data, 0.0, NULL);
-              cmd->cb(cmd->data);
-              eina_evlog("-thread_do", cmd->data, 0.0, NULL);
-
-              cmd++;
-              len--;
-           }
-         eina_evlog("-thread", NULL, 0.0, NULL);
-      }
+     {
+        Evas_Thread_Command *cmd;
+        unsigned int len, max;
+
+        eina_lock_take(&ev_thread->queue_lock);
+
+        while (!ev_thread->queue_ready)
+          {
+             if (ev_thread->exit_thread)
+               {
+                  eina_lock_release(&ev_thread->queue_lock);
+                  goto out;
+               }
+             eina_condition_wait(&ev_thread->queue_condition);
+          }
+
+        if (!eina_inarray_count(&ev_thread->queue))
+          {
+             ERR("Signaled to find an empty queue. BUG!");
+             ev_thread->queue_ready = EINA_FALSE;
+             eina_lock_release(&ev_thread->queue_lock);
+             continue;
+          }
+
+        cmd = ev_thread->queue.members;
+        ev_thread->queue.members = ev_thread->queue_cache;
+        ev_thread->queue_cache = cmd;
+
+        max = ev_thread->queue.max;
+        ev_thread->queue.max = ev_thread->queue_cache_max;
+        ev_thread->queue_cache_max = max;
+
+        len = ev_thread->queue.len;
+        ev_thread->queue.len = 0;
+
+        ev_thread->queue_ready = EINA_FALSE;
+
+        eina_lock_release(&ev_thread->queue_lock);
+
+        DBG("Evas render thread command queue length: %u", len);
+
+        eina_evlog("+thread", NULL, 0.0, NULL);
+        while (len)
+          {
+             assert(cmd->cb);
+
+             eina_evlog("+thread_do", cmd->data, 0.0, NULL);
+             cmd->cb(cmd->data);
+             eina_evlog("-thread_do", cmd->data, 0.0, NULL);
+             eina_lock_take(&ev_thread->finish_lock);
+             if (cmd == ev_thread->waiting_cmd)
+               ev_thread->waiting_cmd = NULL;
+             eina_lock_release(&ev_thread->finish_lock);
+
+             cmd++;
+             len--;
+          }
+        eina_evlog("-thread", NULL, 0.0, NULL);
+     }
 
 out:
-    /* WRN: add a memory barrier or use a lock if we add more code here */
-    evas_thread_exited = 1;
-    return NULL;
+   /* WRN: add a memory barrier or use a lock if we add more code here */
+   ev_thread->exited = 1;
+   return NULL;
 }
 
-int
-evas_thread_init(void)
+static int
+evas_thread_init(Evas_Thread *ev_thread, char *thread_name)
 {
-    if (init_count++) return init_count;
+   ev_thread->thread_name = thread_name;
+   ev_thread->queue_ready = EINA_FALSE;
+   ev_thread->queue_cache = NULL;
+   ev_thread->queue_cache_max = 0;
 
-    exit_thread = EINA_FALSE;
-    evas_thread_exited = 0;
+   ev_thread->exited = 0;
+   ev_thread->exit_thread = EINA_FALSE;
 
-    if(!eina_threads_init())
-      {
-         CRI("Could not init eina threads");
-         goto fail_on_eina_thread_init;
-      }
+   if(!eina_threads_init())
+     {
+        CRI("Could not init eina threads");
+        goto fail_on_eina_thread_init;
+     }
 
-    eina_inarray_step_set(&evas_thread_queue, sizeof (Eina_Inarray), sizeof (Evas_Thread_Command), 128);
+   eina_inarray_step_set(&ev_thread->queue, sizeof (Eina_Inarray), sizeof (Evas_Thread_Command), 128);
 
-    if (!eina_lock_new(&evas_thread_queue_lock))
+   if (!eina_lock_new(&ev_thread->queue_lock))
+      {
+         CRI("Could not create draw thread queue lock");
+         goto fail_on_lock_creation;
+      }
+   if (!eina_lock_new(&ev_thread->finish_lock))
       {
-         CRI("Could not create draw thread lock");
+         CRI("Could not create draw thread finish lock");
          goto fail_on_lock_creation;
       }
-    if (!eina_condition_new(&evas_thread_queue_condition, &evas_thread_queue_lock))
+   if (!eina_condition_new(&ev_thread->queue_condition, &ev_thread->queue_lock))
       {
-         CRI("Could not create draw thread condition");
+         CRI("Could not create draw thread queue condition");
          goto fail_on_cond_creation;
       }
-
-    if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1,
-          evas_thread_worker_func, NULL))
+   if (!eina_condition_new(&ev_thread->finish_condition, &ev_thread->finish_lock))
+      {
+         CRI("Could not create draw thread finish condition");
+         goto fail_on_cond_finish_creation;
+      }
+   if (!eina_thread_create(&ev_thread->worker, EINA_THREAD_NORMAL, 0,
+                           evas_thread_worker_func, ev_thread))
       {
          CRI("Could not create draw thread");
          goto fail_on_thread_creation;
       }
-
-    return init_count;
-
+   return 1;
 fail_on_thread_creation:
-    evas_thread_worker = 0;
-    eina_condition_free(&evas_thread_queue_condition);
+   ev_thread->worker = 0;
+   eina_condition_free(&ev_thread->finish_condition);
+   eina_condition_free(&ev_thread->queue_condition);
+fail_on_cond_finish_creation:
+   eina_lock_free(&ev_thread->finish_lock);
 fail_on_cond_creation:
-    eina_lock_free(&evas_thread_queue_lock);
+   eina_lock_free(&ev_thread->queue_lock);
 fail_on_lock_creation:
-    eina_threads_shutdown();
+   eina_threads_shutdown();
 fail_on_eina_thread_init:
-    exit_thread = EINA_TRUE;
-    evas_thread_exited = 1;
-    return --init_count;
+   ev_thread->exited = 1;
+   ev_thread->exit_thread = EINA_TRUE;
+
+   return 0;
 }
 
-int
-evas_thread_shutdown(void)
+static void
+evas_thread_shutdown(Evas_Thread *ev_thread)
 {
-    double to = 0 ;
+   double to = 0;
+   eina_lock_take(&ev_thread->queue_lock);
 
-    if (init_count <= 0)
-      return 0;
+   ev_thread->exit_thread = EINA_TRUE;
+   eina_condition_signal(&ev_thread->queue_condition);
 
-    if (--init_count)
-      return init_count;
+   eina_lock_release(&ev_thread->queue_lock);
 
-    eina_lock_take(&evas_thread_queue_lock);
+   _shutdown_timeout(&to, SHUTDOWN_TIMEOUT_RESET, SHUTDOWN_TIMEOUT);
+   while (!ev_thread->exited &&
+          evas_async_events_process() != -1)
+     {
+        if(_shutdown_timeout(&to, SHUTDOWN_TIMEOUT_CHECK, SHUTDOWN_TIMEOUT))
+          {
+             CRI("Timeout shutdown thread. Skipping thread_join. Some resources could be leaked");
+             goto timeout_shutdown;
+          }
+     }
 
-    exit_thread = EINA_TRUE;
-    eina_condition_signal(&evas_thread_queue_condition);
+   eina_thread_join(ev_thread->worker);
+timeout_shutdown:
+   eina_lock_free(&ev_thread->queue_lock);
+   eina_condition_free(&ev_thread->queue_condition);
 
-    eina_lock_release(&evas_thread_queue_lock);
-    _shutdown_timeout(&to, SHUTDOWN_TIMEOUT_RESET, SHUTDOWN_TIMEOUT);
-    while (!evas_thread_exited &&
-           evas_async_events_process() != -1)
-      {
-         if(_shutdown_timeout(&to, SHUTDOWN_TIMEOUT_CHECK, SHUTDOWN_TIMEOUT))
-           {
-              CRI("Timeout shutdown thread. Skipping thread_join. Some resources could be leaked");
-              goto timeout_shutdown;
-           }
-      }
+   ev_thread->worker = 0;
 
-    eina_thread_join(evas_thread_worker);
-timeout_shutdown:
-    eina_lock_free(&evas_thread_queue_lock);
-    eina_condition_free(&evas_thread_queue_condition);
+   eina_inarray_flush(&ev_thread->queue);
+   free(ev_thread->queue_cache);
+
+   eina_threads_shutdown();
+}
 
-    evas_thread_worker = 0;
+int
+evas_threads_init(void)
+{
+   if (evas_threads_init_count++) return evas_threads_init_count;
+
+   if (!evas_thread_init(&evas_thread_software, "Eevas-thread-wk-sw")) return --evas_threads_init_count;
+   if (!evas_thread_init(&evas_thread_gl, "Eevas-thread-wk-gl"))       return --evas_threads_init_count;
+   if (!evas_thread_init(&evas_thread_evgl, "Eevas-thread-wk-evgl"))   return --evas_threads_init_count;
+
+   return evas_threads_init_count;
+}
+
+void
+evas_threads_shutdown(void)
+{
+   assert(evas_threads_init_count);
 
-    eina_inarray_flush(&evas_thread_queue);
-    free(evas_thread_queue_cache);
+   if (--evas_threads_init_count)
+     return;
 
-    eina_threads_shutdown();
+   evas_thread_shutdown(&evas_thread_evgl);
+   evas_thread_shutdown(&evas_thread_gl);
+   evas_thread_shutdown(&evas_thread_software);
 
-    return 0;
 }
index 5274dd9..3873f8e 100644 (file)
@@ -1302,10 +1302,20 @@ EAPI int          evas_async_events_process_blocking(void);
 void             evas_render_rendering_wait(Evas_Public_Data *evas);
 void              evas_all_sync(void);
 
-int              evas_thread_init(void);
-int              evas_thread_shutdown(void);
+
+#define EVAS_GL_THREAD_TYPE_GL       1
+#define EVAS_GL_THREAD_TYPE_EVGL     2
+
+#define EVAS_GL_THREAD_MODE_FINISH   0
+#define EVAS_GL_THREAD_MODE_FLUSH    1
+#define EVAS_GL_THREAD_MODE_ENQUEUE  2
+
+int               evas_threads_init(void);
+void              evas_threads_shutdown(void);
 EAPI void         evas_thread_cmd_enqueue(Evas_Thread_Command_Cb cb, void *data);
 EAPI void         evas_thread_queue_flush(Evas_Thread_Command_Cb cb, void *data);
+EAPI void         evas_gl_thread_cmd_enqueue(int thread_type, Evas_Thread_Command_Cb cb, void *data, int thread_mode);
+EAPI Eina_Thread  evas_gl_thread_get(int thread_type);
 
 typedef enum _Evas_Render_Mode
 {
index 39a3aa6..dae6c70 100755 (executable)
@@ -1480,6 +1480,8 @@ struct _Evas_Func
    void *(*ector_surface_create)         (void *data, void *surface, int w, int h, Eina_Bool force, int *error);
    void  (*ector_surface_cache_set)      (void *data, void *key, void *surface);
    void *(*ector_surface_cache_get)      (void *data, void *key);
+
+   void (*gl_get_pixels)                 (void *data, Evas_Object_Image_Pixels_Get_Cb cb, void *get_pixels_data, Evas_Object *o, void *image);
 };
 
 struct _Evas_Image_Save_Func
index 68fc15f..959987e 100644 (file)
@@ -23,15 +23,15 @@ e3d_texture_param_update(E3D_Texture *texture)
 {
    if (texture->wrap_dirty)
      {
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->wrap_s);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->wrap_t);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->wrap_s);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->wrap_t);
         texture->wrap_dirty = EINA_FALSE;
      }
 
    if (texture->filter_dirty)
      {
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texture->filter_min);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texture->filter_mag);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texture->filter_min);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texture->filter_mag);
         texture->filter_dirty = EINA_FALSE;
      }
 }
@@ -278,71 +278,71 @@ e3d_drawable_new(int w, int h, int alpha, GLenum depth_format, GLenum stencil_fo
    GLuint         stencil_buf = 0;
    Eina_Bool      depth_stencil = EINA_FALSE;
 
-   glGenTextures(1, &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_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glGenTextures_thread_cmd(1, &tex);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
    if (alpha)
-     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+     glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
    else
-     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
-
-   glGenTextures(1, &texDepth);
-   glBindTexture(GL_TEXTURE_2D, texDepth);
-   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_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
-
-   glGenFramebuffers(1, &color_pick_fb_id);
-   glGenTextures(1, &texcolorpick);
-   glBindTexture(GL_TEXTURE_2D, texcolorpick);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+     glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
+
+   glGenTextures_thread_cmd(1, &texDepth);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, texDepth);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+
+   glGenFramebuffers_thread_cmd(1, &color_pick_fb_id);
+   glGenTextures_thread_cmd(1, &texcolorpick);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, texcolorpick);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 #ifndef GL_GLES
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_R16, w, h, 0, GL_RED, GL_UNSIGNED_SHORT, 0);
+   glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_R16, w, h, 0, GL_RED, GL_UNSIGNED_SHORT, 0);
 #else
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+   glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 #endif
 
-   glGenFramebuffers(1, &fbo);
-   glBindFramebuffer(GL_FRAMEBUFFER, fbo);
-   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
+   glGenFramebuffers_thread_cmd(1, &fbo);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, fbo);
+   glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
 
 #ifdef GL_GLES
    if (depth_format == GL_DEPTH_STENCIL_OES)
      {
-        glGenTextures(1, &depth_stencil_buf);
-        glBindTexture(GL_TEXTURE_2D, depth_stencil_buf);
-        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_MIN_FILTER, GL_NEAREST);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+        glGenTextures_thread_cmd(1, &depth_stencil_buf);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, depth_stencil_buf);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
-        glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, w, h, 0,
-                     GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
+        glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, w, h, 0,
+                                GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
 
-        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
-                               GL_TEXTURE_2D, depth_stencil_buf, 0);
-        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
-                               GL_TEXTURE_2D, depth_stencil_buf, 0);
+        glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+                                          GL_TEXTURE_2D, depth_stencil_buf, 0);
+        glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+                                          GL_TEXTURE_2D, depth_stencil_buf, 0);
 
         depth_stencil = EINA_TRUE;
      }
 #else
    if (depth_format == GL_DEPTH24_STENCIL8)
      {
-        glGenRenderbuffers(1, &depth_stencil_buf);
-        glBindRenderbuffer(GL_RENDERBUFFER, depth_stencil_buf);
-        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, w, h);
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
-                                  GL_RENDERBUFFER, depth_stencil_buf);
+        glGenRenderbuffers_thread_cmd(1, &depth_stencil_buf);
+        glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, depth_stencil_buf);
+        glRenderbufferStorage_thread_cmd(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, w, h);
+        glFramebufferRenderbuffer_thread_cmd(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+                                             GL_RENDERBUFFER, depth_stencil_buf);
 
         depth_stencil = EINA_TRUE;
      }
@@ -350,23 +350,23 @@ e3d_drawable_new(int w, int h, int alpha, GLenum depth_format, GLenum stencil_fo
 
    if ((!depth_stencil) && (depth_format))
      {
-        glGenRenderbuffers(1, &depth_buf);
-        glBindRenderbuffer(GL_RENDERBUFFER, depth_buf);
-        glRenderbufferStorage(GL_RENDERBUFFER, depth_format, w, h);
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
-                                  GL_RENDERBUFFER, depth_buf);
+        glGenRenderbuffers_thread_cmd(1, &depth_buf);
+        glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, depth_buf);
+        glRenderbufferStorage_thread_cmd(GL_RENDERBUFFER, depth_format, w, h);
+        glFramebufferRenderbuffer_thread_cmd(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+                                             GL_RENDERBUFFER, depth_buf);
      }
 
    if ((!depth_stencil) && (stencil_format))
      {
-        glGenRenderbuffers(1, &stencil_buf);
-        glBindRenderbuffer(GL_RENDERBUFFER, stencil_buf);
-        glRenderbufferStorage(GL_RENDERBUFFER, stencil_format, w, h);
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
-                                  GL_RENDERBUFFER, stencil_buf);
+        glGenRenderbuffers_thread_cmd(1, &stencil_buf);
+        glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, stencil_buf);
+        glRenderbufferStorage_thread_cmd(GL_RENDERBUFFER, stencil_format, w, h);
+        glFramebufferRenderbuffer_thread_cmd(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+                                             GL_RENDERBUFFER, stencil_buf);
      }
 
-   if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+   if (glCheckFramebufferStatus_thread_cmd(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
      goto error;
 
    drawable = (E3D_Drawable *)calloc(1, sizeof(E3D_Drawable));
@@ -399,31 +399,31 @@ error:
    ERR("Drawable creation failed.");
 
    if (tex)
-     glDeleteTextures(1, &tex);
+     glDeleteTextures_thread_cmd(1, &tex);
    if (texcolorpick)
-     glDeleteTextures(1, &texcolorpick);
+     glDeleteTextures_thread_cmd(1, &texcolorpick);
    if (texDepth)
-     glDeleteTextures(1, &texDepth);
+     glDeleteTextures_thread_cmd(1, &texDepth);
 
    if (fbo)
-     glDeleteFramebuffers(1, &fbo);
+     glDeleteFramebuffers_thread_cmd(1, &fbo);
    if (color_pick_fb_id)
-     glDeleteFramebuffers(1, &color_pick_fb_id);
+     glDeleteFramebuffers_thread_cmd(1, &color_pick_fb_id);
 
    if (depth_stencil_buf)
      {
 #ifdef GL_GLES
-        glDeleteTextures(1, &depth_stencil_buf);
+        glDeleteTextures_thread_cmd(1, &depth_stencil_buf);
 #else
-        glDeleteRenderbuffers(1, &depth_stencil_buf);
+        glDeleteRenderbuffers_thread_cmd(1, &depth_stencil_buf);
 #endif
      }
 
    if (depth_buf)
-     glDeleteRenderbuffers(1, &depth_buf);
+     glDeleteRenderbuffers_thread_cmd(1, &depth_buf);
 
    if (stencil_buf)
-     glDeleteRenderbuffers(1, &stencil_buf);
+     glDeleteRenderbuffers_thread_cmd(1, &stencil_buf);
 
 
    return NULL;
@@ -436,25 +436,25 @@ e3d_drawable_free(E3D_Drawable *drawable)
      return;
 
    if (drawable->tex)
-     glDeleteTextures(1, &drawable->tex);
+     glDeleteTextures_thread_cmd(1, &drawable->tex);
 
    if (drawable->fbo)
-     glDeleteFramebuffers(1, &drawable->fbo);
+     glDeleteFramebuffers_thread_cmd(1, &drawable->fbo);
 
    if (drawable->depth_stencil_buf)
      {
 #ifdef GL_GLES
-        glDeleteTextures(1, &drawable->depth_stencil_buf);
+        glDeleteTextures_thread_cmd(1, &drawable->depth_stencil_buf);
 #else
-        glDeleteRenderbuffers(1, &drawable->depth_stencil_buf);
+        glDeleteRenderbuffers_thread_cmd(1, &drawable->depth_stencil_buf);
 #endif
      }
 
    if (drawable->depth_buf)
-     glDeleteRenderbuffers(1, &drawable->depth_buf);
+     glDeleteRenderbuffers_thread_cmd(1, &drawable->depth_buf);
 
    if (drawable->stencil_buf)
-     glDeleteRenderbuffers(1, &drawable->stencil_buf);
+     glDeleteRenderbuffers_thread_cmd(1, &drawable->stencil_buf);
 
    free(drawable);
 }
@@ -1128,7 +1128,7 @@ _mesh_draw_data_build(E3D_Draw_Data *data,
      }
 
    int num;
-   glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &num);
+   glGetIntegerv_thread_cmd(GL_MAX_TEXTURE_IMAGE_UNITS, &num);
    data->smap_sampler = num - 1;
 
    if (data->texture_count >= num)
@@ -1164,11 +1164,11 @@ void _shadowmap_render(E3D_Drawable *drawable, E3D_Renderer *renderer,
    Evas_Color      c = {1.0, 1.0, 1.0, 1.0};
    Evas_Mat4 matrix_vp;
 
-   glEnable(GL_POLYGON_OFFSET_FILL);
-   glPolygonOffset(data->depth_offset, data->depth_constant);
+   glEnable_thread_cmd(GL_POLYGON_OFFSET_FILL);
+   glPolygonOffset_thread_cmd(data->depth_offset, data->depth_constant);
 
-   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
-                          drawable->texDepth, 0);
+   glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
+                                     drawable->texDepth, 0);
 
    e3d_renderer_target_set(renderer, drawable);
    e3d_renderer_clear(renderer, &c);
@@ -1202,9 +1202,10 @@ void _shadowmap_render(E3D_Drawable *drawable, E3D_Renderer *renderer,
           }
      }
 
-     glDisable(GL_POLYGON_OFFSET_FILL);
+     glDisable_thread_cmd(GL_POLYGON_OFFSET_FILL);
 
-     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, drawable->tex, 0);
+     glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
+                                       drawable->tex, 0);
 }
 
 void
@@ -1298,17 +1299,17 @@ e3d_drawable_scene_render_to_texture(E3D_Drawable *drawable, E3D_Renderer *rende
    Eina_List *repeat_node = NULL;
    Evas_Color c = {0.0, 0.0, 0.0, 0.0}, *unic_color = NULL;
 
-   glBindFramebuffer(GL_FRAMEBUFFER, drawable->color_pick_fb_id);
-   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
-                          GL_TEXTURE_2D, drawable->texcolorpick, 0);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, drawable->color_pick_fb_id);
+   glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+                                     GL_TEXTURE_2D, drawable->texcolorpick, 0);
 #ifdef GL_GLES
-   glBindRenderbuffer(GL_RENDERBUFFER, drawable->depth_stencil_buf);
-   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
-                               GL_TEXTURE_2D, drawable->depth_stencil_buf, 0);
+   glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, drawable->depth_stencil_buf);
+   glFramebufferTexture2D_thread_cmd(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+                                     GL_TEXTURE_2D, drawable->depth_stencil_buf, 0);
 #else
-   glBindRenderbuffer(GL_RENDERBUFFER, drawable->depth_stencil_buf);
-   glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
-                             GL_RENDERBUFFER, drawable->depth_stencil_buf);
+   glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, drawable->depth_stencil_buf);
+   glFramebufferRenderbuffer_thread_cmd(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+                                        GL_RENDERBUFFER, drawable->depth_stencil_buf);
 #endif
 
    e3d_renderer_clear(renderer, &c);
@@ -1366,7 +1367,7 @@ e3d_drawable_scene_render_to_texture(E3D_Drawable *drawable, E3D_Renderer *rende
 
    eina_iterator_free(itmn);
    eina_list_free(repeat_node);
-   glBindFramebuffer(GL_FRAMEBUFFER, drawable->fbo);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, drawable->fbo);
    return EINA_TRUE;
 }
 
@@ -1376,20 +1377,20 @@ e3d_drawable_texture_pixel_color_get(GLuint tex EINA_UNUSED, int x, int y,
 {
    E3D_Drawable *d = (E3D_Drawable *)drawable;
 
-   glBindFramebuffer(GL_FRAMEBUFFER, d->color_pick_fb_id);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, d->color_pick_fb_id);
 #ifndef GL_GLES
    GLuint pixel = 0;
-   glReadPixels(x, y, 1, 1, GL_RED, GL_UNSIGNED_SHORT, &pixel);
+   glReadPixels_thread_cmd(x, y, 1, 1, GL_RED, GL_UNSIGNED_SHORT, &pixel);
    color->r = (double)pixel / USHRT_MAX;
 #else
    GLubyte pixel[4] = {0, 0, 0, 0};
-   glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
+   glReadPixels_thread_cmd(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
    color->r = (double)pixel[0] / 255;
    color->g = (double)pixel[1] / 255;
    color->b = (double)pixel[2] / 255;
 #endif
 
-   glBindFramebuffer(GL_FRAMEBUFFER, d->fbo);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, d->fbo);
 }
 
 #undef RENDER_MESH_NODE_ITERATE_BEGIN
index 2b0e7ae..a6a27b2 100644 (file)
@@ -116,7 +116,7 @@ _renderer_vertex_attrib_array_enable(E3D_Renderer *renderer, int index)
    if (renderer->vertex_attrib_enable[index])
      return;
 
-   glEnableVertexAttribArray(index);
+   glEnableVertexAttribArray_thread_cmd(index);
    renderer->vertex_attrib_enable[index] = EINA_TRUE;
 }
 
@@ -126,7 +126,7 @@ _renderer_vertex_attrib_array_disable(E3D_Renderer *renderer, int index)
    if (!renderer->vertex_attrib_enable[index])
      return;
 
-   glDisableVertexAttribArray(index);
+   glDisableVertexAttribArray_thread_cmd(index);
    renderer->vertex_attrib_enable[index] = EINA_FALSE;
 }
 
@@ -134,8 +134,8 @@ static inline void
 _renderer_vertex_attrib_pointer_set(E3D_Renderer *renderer EINA_UNUSED, int index,
                                     const Evas_Canvas3D_Vertex_Buffer *buffer)
 {
-   glVertexAttribPointer(index, buffer->element_count, GL_FLOAT,
-                         GL_FALSE, buffer->stride, buffer->data);
+   glVertexAttribPointer_thread_cmd(index, buffer->element_count, GL_FLOAT,
+                                    GL_FALSE, buffer->stride, buffer->data);
 }
 
 static inline void
@@ -145,9 +145,9 @@ _renderer_elements_draw(E3D_Renderer *renderer EINA_UNUSED, Evas_Canvas3D_Vertex
    GLenum mode = _gl_assembly_get(assembly);
 
    if (format == EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_BYTE)
-     glDrawElements(mode, count, GL_UNSIGNED_BYTE, indices);
+     glDrawElements_thread_cmd(mode, count, GL_UNSIGNED_BYTE, indices);
    else if (format == EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT)
-     glDrawElements(mode, count, GL_UNSIGNED_SHORT, indices);
+     glDrawElements_thread_cmd(mode, count, GL_UNSIGNED_SHORT, indices);
 }
 
 static inline void
@@ -156,7 +156,7 @@ _renderer_array_draw(E3D_Renderer *renderer EINA_UNUSED,
 {
    GLenum mode = _gl_assembly_get(assembly);
 
-   glDrawArrays(mode, 0, count);
+   glDrawArrays_thread_cmd(mode, 0, count);
 }
 
 static inline void
@@ -166,7 +166,7 @@ _renderer_program_use(E3D_Renderer *renderer ,E3D_Program *program)
 
    if (renderer->program != prog)
      {
-        glUseProgram(prog);
+        glUseProgram_thread_cmd(prog);
         renderer->program = prog;
      }
 }
@@ -182,8 +182,8 @@ _renderer_texture_bind(E3D_Renderer *renderer, E3D_Draw_Data *data)
           {
              if (renderer->textures[data->materials[i].sampler0] != data->materials[i].tex0)
                {
-                  glActiveTexture(GL_TEXTURE0 + data->materials[i].sampler0);
-                  glBindTexture(GL_TEXTURE_2D, data->materials[i].tex0->tex);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0 + data->materials[i].sampler0);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, data->materials[i].tex0->tex);
                   e3d_texture_param_update(data->materials[i].tex0);
 
                   renderer->textures[data->materials[i].sampler0] = data->materials[i].tex0;
@@ -194,8 +194,8 @@ _renderer_texture_bind(E3D_Renderer *renderer, E3D_Draw_Data *data)
           {
              if (renderer->textures[data->materials[i].sampler1] != data->materials[i].tex1)
                {
-                  glActiveTexture(GL_TEXTURE0 + data->materials[i].sampler1);
-                  glBindTexture(GL_TEXTURE_2D, data->materials[i].tex1->tex);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0 + data->materials[i].sampler1);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, data->materials[i].tex1->tex);
                   e3d_texture_param_update(data->materials[i].tex1);
 
                   renderer->textures[data->materials[i].sampler1] = data->materials[i].tex1;
@@ -204,8 +204,8 @@ _renderer_texture_bind(E3D_Renderer *renderer, E3D_Draw_Data *data)
      }
    if ((data->flags & E3D_SHADER_FLAG_SHADOWED) && (renderer->smap_sampler != data->smap_sampler))
      {
-        glActiveTexture(GL_TEXTURE0 + data->smap_sampler);
-        glBindTexture(GL_TEXTURE_2D, renderer->texDepth);
+        glActiveTexture_thread_cmd(GL_TEXTURE0 + data->smap_sampler);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, renderer->texDepth);
         renderer->smap_sampler = data->smap_sampler;
      }
 }
@@ -217,12 +217,12 @@ _renderer_depth_test_enable(E3D_Renderer *renderer, Eina_Bool enable)
      {
         if (enable)
           {
-             glEnable(GL_DEPTH_TEST);
+             glEnable_thread_cmd(GL_DEPTH_TEST);
              /* Use default depth func. */
           }
         else
           {
-             glDisable(GL_DEPTH_TEST);
+             glDisable_thread_cmd(GL_DEPTH_TEST);
           }
 
         renderer->depth_test_enable = enable;
@@ -265,8 +265,8 @@ e3d_renderer_target_set(E3D_Renderer *renderer, E3D_Drawable *target)
    if (renderer->fbo == target->fbo)
      return;
 
-   glBindFramebuffer(GL_FRAMEBUFFER, target->fbo);
-   glViewport(0, 0, target->w, target->h);
+   glBindFramebuffer_thread_cmd(GL_FRAMEBUFFER, target->fbo);
+   glViewport_thread_cmd(0, 0, target->w, target->h);
    renderer->fbo = target->fbo;
    renderer->texDepth = target->texDepth;
 }
@@ -274,8 +274,8 @@ e3d_renderer_target_set(E3D_Renderer *renderer, E3D_Drawable *target)
 void
 e3d_renderer_clear(E3D_Renderer *renderer EINA_UNUSED, const Evas_Color *color)
 {
-   glClearColor(color->r, color->g, color->b, color->a);
-   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+   glClearColor_thread_cmd(color->r, color->g, color->b, color->a);
+   glClear_thread_cmd(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 }
 
 void
@@ -345,19 +345,20 @@ e3d_renderer_draw(E3D_Renderer *renderer, E3D_Draw_Data *data)
 
    if (data->blending)
      {
-        glEnable(GL_BLEND);
-        glBlendFunc(_gl_blend_func_get(data->blend_sfactor), _gl_blend_func_get(data->blend_dfactor));
+        glEnable_thread_cmd(GL_BLEND);
+        glBlendFunc_thread_cmd(_gl_blend_func_get(data->blend_sfactor),
+                               _gl_blend_func_get(data->blend_dfactor));
      }
-   else glDisable(GL_BLEND);
+   else glDisable_thread_cmd(GL_BLEND);
 
 #ifndef GL_GLES
    if (data->alpha_test_enabled)
      {
-        glEnable(GL_ALPHA_TEST);
-        glAlphaFunc(_gl_comparison_func_get(data->alpha_comparison),
-                    (GLclampf)data->alpha_ref_value);
+        glEnable_thread_cmd(GL_ALPHA_TEST);
+        glAlphaFunc_thread_cmd(_gl_comparison_func_get(data->alpha_comparison),
+                               (GLclampf)data->alpha_ref_value);
      }
-   else glDisable(GL_ALPHA_TEST);
+   else glDisable_thread_cmd(GL_ALPHA_TEST);
 #endif
 
    if (data->indices)
@@ -374,5 +375,5 @@ e3d_renderer_draw(E3D_Renderer *renderer, E3D_Draw_Data *data)
 void
 e3d_renderer_flush(E3D_Renderer *renderer EINA_UNUSED)
 {
-   glFlush();
+   glFlush_thread_cmd();
 }
index 046daad..f85a761 100644 (file)
@@ -192,9 +192,9 @@ _shader_compile(GLuint shader, const char *src)
 {
    GLint ok;
 
-   glShaderSource(shader, 1, &src, NULL);
-   glCompileShader(shader);
-   glGetShaderiv(shader, GL_COMPILE_STATUS, &ok);
+   glShaderSource_thread_cmd(shader, 1, &src, NULL);
+   glCompileShader_thread_cmd(shader);
+   glGetShaderiv_thread_cmd(shader, GL_COMPILE_STATUS, &ok);
 
    if (!ok)
      {
@@ -202,9 +202,9 @@ _shader_compile(GLuint shader, const char *src)
         GLint     len;
         GLsizei   info_len;
 
-        glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
+        glGetShaderiv_thread_cmd(shader, GL_INFO_LOG_LENGTH, &len);
         log_str = (GLchar *)malloc(len);
-        glGetShaderInfoLog(shader, len, &info_len, log_str);
+        glGetShaderInfoLog_thread_cmd(shader, len, &info_len, log_str);
         ERR("Shader compilation failed.\n%s", log_str);
         free(log_str);
 
@@ -220,34 +220,34 @@ _program_vertex_attrib_bind(E3D_Program *program)
    GLint index = 0;
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_POSITION)
-     glBindAttribLocation(program->prog, index++, "aPosition0");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aPosition0");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_POSITION_BLEND)
-     glBindAttribLocation(program->prog, index++, "aPosition1");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aPosition1");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_NORMAL)
-     glBindAttribLocation(program->prog, index++, "aNormal0");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aNormal0");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_NORMAL_BLEND)
-     glBindAttribLocation(program->prog, index++, "aNormal1");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aNormal1");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_TANGENT)
-     glBindAttribLocation(program->prog, index++, "aTangent0");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aTangent0");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_TANGENT_BLEND)
-     glBindAttribLocation(program->prog, index++, "aTangent1");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aTangent1");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_COLOR)
-     glBindAttribLocation(program->prog, index++, "aColor0");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aColor0");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_COLOR_BLEND)
-     glBindAttribLocation(program->prog, index++, "aColor1");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aColor1");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_TEXCOORD)
-     glBindAttribLocation(program->prog, index++, "aTexCoord0");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aTexCoord0");
 
    if (program->flags & E3D_SHADER_FLAG_VERTEX_TEXCOORD_BLEND)
-     glBindAttribLocation(program->prog, index++, "aTexCoord1");
+     glBindAttribLocation_thread_cmd(program->prog, index++, "aTexCoord1");
 }
 
 static inline Eina_Bool
@@ -256,8 +256,8 @@ _program_build(E3D_Program *program, const char *vert_src, const char *frag_src)
    GLint ok;
 
    /* Create OpenGL vertex & fragment shader object. */
-   program->vert = glCreateShader(GL_VERTEX_SHADER);
-   program->frag = glCreateShader(GL_FRAGMENT_SHADER);
+   program->vert = glCreateShader_thread_cmd(GL_VERTEX_SHADER);
+   program->frag = glCreateShader_thread_cmd(GL_FRAGMENT_SHADER);
 
    /* Commpile vertex shader. */
    if (!_shader_compile(program->vert, vert_src))
@@ -274,18 +274,18 @@ _program_build(E3D_Program *program, const char *vert_src, const char *frag_src)
      }
 
    /* Create OpenGL program object. */
-   program->prog = glCreateProgram();
+   program->prog = glCreateProgram_thread_cmd();
 
    /* Attach shaders. */
-   glAttachShader(program->prog, program->vert);
-   glAttachShader(program->prog, program->frag);
+   glAttachShader_thread_cmd(program->prog, program->vert);
+   glAttachShader_thread_cmd(program->prog, program->frag);
 
    _program_vertex_attrib_bind(program);
    /* Link program. */
-   glLinkProgram(program->prog);
+   glLinkProgram_thread_cmd(program->prog);
 
    /* Check link status. */
-   glGetProgramiv(program->prog, GL_LINK_STATUS, &ok);
+   glGetProgramiv_thread_cmd(program->prog, GL_LINK_STATUS, &ok);
 
    if (!ok)
      {
@@ -293,9 +293,9 @@ _program_build(E3D_Program *program, const char *vert_src, const char *frag_src)
         GLint     len;
         GLsizei   info_len;
 
-        glGetProgramiv(program->prog, GL_INFO_LOG_LENGTH, &len);
+        glGetProgramiv_thread_cmd(program->prog, GL_INFO_LOG_LENGTH, &len);
         log_str = (GLchar *)malloc(len);
-        glGetProgramInfoLog(program->prog, len, &info_len, log_str);
+        glGetProgramInfoLog_thread_cmd(program->prog, len, &info_len, log_str);
         ERR("Shader link failed.\n%s", log_str);
         free(log_str);
         return EINA_FALSE;
@@ -370,7 +370,8 @@ _program_uniform_init(E3D_Program *program)
    int i;
    for (i = 0; i < E3D_UNIFORM_COUNT; i++)
      {
-        program->uniform_locations[i] = glGetUniformLocation(program->prog, uniform_names[i]);
+        program->uniform_locations[i] = glGetUniformLocation_thread_cmd(program->prog,
+                                                                                       uniform_names[i]);
      }
 }
 
@@ -383,7 +384,7 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
         float   m[9];                                                          \
         for(int i = 0 ; i < 9 ; i++)                                           \
           m[i] = data->materials[attrib].tex##tn->trans.m[i];                  \
-        glUniformMatrix3fv(loc, 1, EINA_FALSE, &m[0]);                         \
+        glUniformMatrix3fv_thread_cmd(loc, 1, EINA_FALSE, &m[0]);              \
      }
 
    switch (u)
@@ -392,89 +393,89 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
          float   m[16];
          for(int i = 0 ; i <16 ; i++)
             m[i] = data->matrix_mvp.m[i];
-         glUniformMatrix4fv(loc, 1, EINA_FALSE, &m[0]);
+         glUniformMatrix4fv_thread_cmd(loc, 1, EINA_FALSE, &m[0]);
          break;
       }
       case E3D_UNIFORM_MATRIX_MV: {
          float   m[16];
          for(int i = 0 ; i <16 ; i++)
             m[i] = data->matrix_mv.m[i];
-         glUniformMatrix4fv(loc, 1, EINA_FALSE, &m[0]);
+         glUniformMatrix4fv_thread_cmd(loc, 1, EINA_FALSE, &m[0]);
          break;
       }
       case E3D_UNIFORM_MATRIX_NORMAL: {
          float   m[9];
          for(int i = 0 ; i <9 ; i++)
             m[i] = data->matrix_normal.m[i];
-         glUniformMatrix3fv(loc, 1, EINA_FALSE, &m[0]);
+         glUniformMatrix3fv_thread_cmd(loc, 1, EINA_FALSE, &m[0]);
          break;
       }
       case E3D_UNIFORM_MATRIX_LIGHT: {
          float   m[16];
          for(int i = 0 ; i <16 ; i++)
             m[i] = data->matrix_light.m[i];
-         glUniformMatrix4fv(loc, 1, EINA_FALSE, &m[0]);
+         glUniformMatrix4fv_thread_cmd(loc, 1, EINA_FALSE, &m[0]);
          break;
       }
       case E3D_UNIFORM_POSITION_WEIGHT:
-         glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].weight);
+         glUniform1f_thread_cmd(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].weight);
          break;
       case E3D_UNIFORM_NORMAL_WEIGHT:
-         glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL].weight);
+         glUniform1f_thread_cmd(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL].weight);
          break;
       case E3D_UNIFORM_TANGENT_WEIGHT:
-         glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT].weight);
+         glUniform1f_thread_cmd(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT].weight);
          break;
       case E3D_UNIFORM_COLOR_WEIGHT:
-         glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR].weight);
+         glUniform1f_thread_cmd(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR].weight);
          break;
       case E3D_UNIFORM_TEXCOORD_WEIGHT:
-         glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD].weight);
+         glUniform1f_thread_cmd(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD].weight);
          break;
       case E3D_UNIFORM_TEXTURE_WEIGHT_AMBIENT:
-         glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].texture_weight);
+         glUniform1f_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].texture_weight);
          break;
       case E3D_UNIFORM_TEXTURE_WEIGHT_DIFFUSE:
-         glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].texture_weight);
+         glUniform1f_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].texture_weight);
          break;
       case E3D_UNIFORM_TEXTURE_WEIGHT_SPECULAR:
-         glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].texture_weight);
+         glUniform1f_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].texture_weight);
          break;
       case E3D_UNIFORM_TEXTURE_WEIGHT_EMISSION:
-         glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].texture_weight);
+         glUniform1f_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].texture_weight);
          break;
       case E3D_UNIFORM_TEXTURE_WEIGHT_NORMAL:
-         glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].texture_weight);
+         glUniform1f_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].texture_weight);
          break;
       case E3D_UNIFORM_TEXTURE_AMBIENT0:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler0);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler0);
          break;
       case E3D_UNIFORM_TEXTURE_DIFFUSE0:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler0);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler0);
          break;
       case E3D_UNIFORM_TEXTURE_SPECULAR0:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler0);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler0);
          break;
       case E3D_UNIFORM_TEXTURE_EMISSION0:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler0);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler0);
          break;
       case E3D_UNIFORM_TEXTURE_NORMAL0:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler0);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler0);
          break;
       case E3D_UNIFORM_TEXTURE_AMBIENT1:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler1);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler1);
          break;
       case E3D_UNIFORM_TEXTURE_DIFFUSE1:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler1);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler1);
          break;
       case E3D_UNIFORM_TEXTURE_SPECULAR1:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler1);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler1);
          break;
       case E3D_UNIFORM_TEXTURE_EMISSION1:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler1);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler1);
          break;
       case E3D_UNIFORM_TEXTURE_NORMAL1:
-         glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler1);
+         glUniform1i_thread_cmd(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler1);
          break;
       case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT0: {
          SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0)
@@ -517,101 +518,101 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
          break;
       }
       case E3D_UNIFORM_SHADOWMAP:
-         glUniform1i(loc, data->smap_sampler);
+         glUniform1i_thread_cmd(loc, data->smap_sampler);
          break;
       case E3D_UNIFORM_SHADOWS_PCF_STEP:
-         glUniform1f(loc, data->pcf_step);
+         glUniform1f_thread_cmd(loc, data->pcf_step);
          break;
       case E3D_UNIFORM_SHADOWS_PCF_SIZE:
-         glUniform1f(loc, data->pcf_size);
+         glUniform1f_thread_cmd(loc, data->pcf_size);
          break;
       case E3D_UNIFORM_SHADOWS_CONSTANT_BIAS:
-         glUniform1f(loc, data->constant_bias);
+         glUniform1f_thread_cmd(loc, data->constant_bias);
          break;
       case E3D_UNIFORM_LIGHT_POSITION:
-         glUniform4f(loc, data->light.position.x, data->light.position.y,
-                     data->light.position.z, data->light.position.w);
+         glUniform4f_thread_cmd(loc, data->light.position.x, data->light.position.y,
+                                data->light.position.z, data->light.position.w);
          break;
       case E3D_UNIFORM_LIGHT_SPOT_DIR:
-         glUniform3f(loc, data->light.spot_dir.x, data->light.spot_dir.y, data->light.spot_dir.z);
+         glUniform3f_thread_cmd(loc, data->light.spot_dir.x, data->light.spot_dir.y, data->light.spot_dir.z);
          break;
       case E3D_UNIFORM_LIGHT_SPOT_EXP:
-         glUniform1f(loc, data->light.spot_exp);
+         glUniform1f_thread_cmd(loc, data->light.spot_exp);
          break;
       case E3D_UNIFORM_LIGHT_SPOT_CUTOFF_COS:
-         glUniform1f(loc, data->light.spot_cutoff_cos);
+         glUniform1f_thread_cmd(loc, data->light.spot_cutoff_cos);
          break;
       case E3D_UNIFORM_LIGHT_ATTENUATION:
-         glUniform3f(loc, data->light.atten.x, data->light.atten.y, data->light.atten.z);
+         glUniform3f_thread_cmd(loc, data->light.atten.x, data->light.atten.y, data->light.atten.z);
          break;
       case E3D_UNIFORM_LIGHT_AMBIENT:
-         glUniform4f(loc,
-                     data->light.ambient.r, data->light.ambient.g,
-                     data->light.ambient.b, data->light.ambient.a);
+         glUniform4f_thread_cmd(loc,
+                                data->light.ambient.r, data->light.ambient.g,
+                                data->light.ambient.b, data->light.ambient.a);
          break;
       case E3D_UNIFORM_LIGHT_DIFFUSE:
-         glUniform4f(loc,
-                     data->light.diffuse.r, data->light.diffuse.g,
-                     data->light.diffuse.b, data->light.diffuse.a);
+         glUniform4f_thread_cmd(loc,
+                                data->light.diffuse.r, data->light.diffuse.g,
+                                data->light.diffuse.b, data->light.diffuse.a);
          break;
       case E3D_UNIFORM_LIGHT_SPECULAR:
-         glUniform4f(loc,
-                     data->light.specular.r, data->light.specular.g,
-                     data->light.specular.b, data->light.specular.a);
+         glUniform4f_thread_cmd(loc,
+                                data->light.specular.r, data->light.specular.g,
+                                data->light.specular.b, data->light.specular.a);
          break;
       case E3D_UNIFORM_MATERIAL_AMBIENT:
-         glUniform4f(loc,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.r,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.g,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.b,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.a);
+         glUniform4f_thread_cmd(loc,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.r,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.g,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.b,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.a);
          break;
       case E3D_UNIFORM_MATERIAL_DIFFUSE:
-         glUniform4f(loc,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.r,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.g,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.b,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.a);
+         glUniform4f_thread_cmd(loc,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.r,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.g,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.b,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.a);
          break;
       case E3D_UNIFORM_MATERIAL_SPECULAR:
-         glUniform4f(loc,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.r,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.g,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.b,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.a);
+         glUniform4f_thread_cmd(loc,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.r,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.g,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.b,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.a);
          break;
       case E3D_UNIFORM_MATERIAL_EMISSION:
-         glUniform4f(loc,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.r,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.g,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.b,
-                     data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.a);
+         glUniform4f_thread_cmd(loc,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.r,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.g,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.b,
+                                data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.a);
          break;
       case E3D_UNIFORM_MATERIAL_SHININESS:
-         glUniform1f(loc, data->shininess);
+         glUniform1f_thread_cmd(loc, data->shininess);
          break;
       case E3D_UNIFORM_FOG_FACTOR:
-         glUniform1f(loc, data->fog_color.a);
+         glUniform1f_thread_cmd(loc, data->fog_color.a);
          break;
       case E3D_UNIFORM_FOG_COLOR:
-         glUniform4f(loc, data->fog_color.r, data->fog_color.g, data->fog_color.b, 1);
+         glUniform4f_thread_cmd(loc, data->fog_color.r, data->fog_color.g, data->fog_color.b, 1);
          break;
 #ifndef GL_GLES
       case E3D_UNIFORM_COLOR_PICK:
-         glUniform1f(loc, data->color_pick_key);
+         glUniform1f_thread_cmd(loc, data->color_pick_key);
          break;
 #else
       case E3D_UNIFORM_COLOR_PICK:
-         glUniform4f(loc, data->color_pick_key.r, data->color_pick_key.g,
-                     data->color_pick_key.b, 1.0);
+         glUniform4f_thread_cmd(loc, data->color_pick_key.r, data->color_pick_key.g,
+                                data->color_pick_key.b, 1.0);
          break;
 #endif
       case E3D_UNIFORM_ALPHATEST_COMPARISON:
-         glUniform1i(loc,
+         glUniform1i_thread_cmd(loc,
                     (data->alpha_comparison ? data->alpha_comparison : EVAS_CANVAS3D_COMPARISON_GREATER));
          break;
       case E3D_UNIFORM_ALPHATEST_REFVALUE:
-         glUniform1f(loc, (data->alpha_ref_value ? data->alpha_ref_value : 0.0));
+         glUniform1f_thread_cmd(loc, (data->alpha_ref_value ? data->alpha_ref_value : 0.0));
          break;
       default:
          ERR("Invalid uniform ID.");
@@ -650,9 +651,9 @@ e3d_program_new(Evas_Canvas3D_Shade_Mode mode, E3D_Shader_Flag flags)
         return NULL;
      }
 
-   program->prog = glCreateProgram();
-   program->vert = glCreateShader(GL_VERTEX_SHADER);
-   program->frag = glCreateShader(GL_FRAGMENT_SHADER);
+   program->prog = glCreateProgram_thread_cmd();
+   program->vert = glCreateShader_thread_cmd(GL_VERTEX_SHADER);
+   program->frag = glCreateShader_thread_cmd(GL_FRAGMENT_SHADER);
    program->mode = mode;
    program->flags = flags;
 
@@ -674,13 +675,13 @@ e3d_program_new(Evas_Canvas3D_Shade_Mode mode, E3D_Shader_Flag flags)
 
 error:
    if (program->prog)
-     glDeleteProgram(program->prog);
+     glDeleteProgram_thread_cmd(program->prog);
 
    if (program->vert)
-     glDeleteShader(program->vert);
+     glDeleteShader_thread_cmd(program->vert);
 
    if (program->frag)
-     glDeleteShader(program->frag);
+     glDeleteShader_thread_cmd(program->frag);
 
    _shader_string_fini(&vert);
    _shader_string_fini(&frag);
@@ -693,9 +694,9 @@ error:
 void
 e3d_program_free(E3D_Program *program)
 {
-   glDeleteProgram(program->prog);
-   glDeleteShader(program->vert);
-   glDeleteShader(program->frag);
+   glDeleteProgram_thread_cmd(program->prog);
+   glDeleteShader_thread_cmd(program->vert);
+   glDeleteShader_thread_cmd(program->frag);
    free(program);
 }
 
index ff52591..84562e2 100644 (file)
@@ -2229,13 +2229,20 @@ finish:
 #endif
 
 //-------------------------------------------------------------//
+#define EVAS_API_OVERRIDE_THREAD_CMD(func, api, prefix) \
+   (api)->func = func##_evgl_api_thread_cmd; \
+   orig_evgl_api_##func = prefix##func
+
+#define EVAS_API_OVERRIDE_DIRECT_THREAD_CMD(func, api, prefix) \
+   (api)->func = func##_evgl_thread_cmd;
+
 
 static void
 _normal_gles2_api_get(Evas_GL_API *funcs)
 {
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(f) EVAS_API_OVERRIDE(f, funcs, evgl_)
+#define ORD(f) EVAS_API_OVERRIDE_THREAD_CMD(f, funcs, evgl_)
    // GLES 2.0
    ORD(glActiveTexture);
    ORD(glAttachShader);
@@ -2387,7 +2394,7 @@ static void
 _direct_scissor_off_api_get(Evas_GL_API *funcs)
 {
 
-#define ORD(f) EVAS_API_OVERRIDE(f, funcs,)
+#define ORD(f) EVAS_API_OVERRIDE_DIRECT_THREAD_CMD(f, funcs,)
    // For Direct Rendering
    ORD(glClear);
    ORD(glClearColor);
@@ -2406,7 +2413,7 @@ _debug_gles2_api_get(Evas_GL_API *funcs)
 {
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(f) EVAS_API_OVERRIDE(f, funcs, _evgld_)
+#define ORD(f) EVAS_API_OVERRIDE_THREAD_CMD(f, funcs, _evgld_)
    // GLES 2.0
    ORD(glActiveTexture);
    ORD(glAttachShader);
@@ -2572,7 +2579,7 @@ _normal_gles3_api_get(Evas_GL_API *funcs, int minor_version)
    if (!funcs) return;
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(f) EVAS_API_OVERRIDE(f, funcs, evgl_)
+#define ORD(f) EVAS_API_OVERRIDE_THREAD_CMD(f, funcs, evgl_)
    // GLES 3.0 APIs that are same as GLES 2.0
    ORD(glActiveTexture);
    ORD(glAttachShader);
@@ -2720,7 +2727,7 @@ _normal_gles3_api_get(Evas_GL_API *funcs, int minor_version)
 #undef ORD
 
 // GLES 3.0 NEW APIs
-#define ORD(name) EVAS_API_OVERRIDE(name, funcs, evgl_gles3_)
+#define ORD(name) EVAS_API_OVERRIDE_THREAD_CMD(name, funcs, evgl_gles3_)
    ORD(glBeginQuery);
    ORD(glBeginTransformFeedback);
    ORD(glBindBufferBase);
@@ -2910,7 +2917,7 @@ _debug_gles3_api_get(Evas_GL_API *funcs, int minor_version)
    if (!funcs) return;
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(f) EVAS_API_OVERRIDE(f, funcs, _evgld_)
+#define ORD(f) EVAS_API_OVERRIDE_THREAD_CMD(f, funcs, _evgld_)
    // GLES 3.0 APIs that are same as GLES 2.0
    ORD(glActiveTexture);
    ORD(glAttachShader);
@@ -3490,7 +3497,7 @@ _evgl_gles3_api_init(int minor_version)
 void
 _evgl_api_gles3_get(Evas_GL_API *funcs, Eina_Bool debug)
 {
-   const char *ret = (const char *) glGetString(GL_VERSION);
+   const char *ret = (const char *) glGetString_evgl_thread_cmd(GL_VERSION);
    int minor_version =  ret[12] - '0';
 
    if (minor_version > 9 || minor_version < 0)
index f9f4259..36ee210 100644 (file)
@@ -51,11 +51,17 @@ struct wl_resource;
    ret (*gl_ext_sym_##name) param1 = NULL; \
    ret (*gles1_ext_sym_##name) param1 = NULL; \
    ret (*gles3_ext_sym_##name) param1 = NULL;
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+   ret (*egl_ext_sym_##name) param1 = NULL; \
+   ret (*gl_ext_sym_##name) param1 = NULL; \
+   ret (*gles1_ext_sym_##name) param1 = NULL; \
+   ret (*gles3_ext_sym_##name) param1 = NULL;
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
@@ -67,11 +73,13 @@ struct wl_resource;
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -93,11 +101,13 @@ struct wl_resource;
    int _gles3_ext_support_func_##name = 0;
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
@@ -111,11 +121,13 @@ struct wl_resource;
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
 #define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
@@ -487,13 +499,17 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
     static ret evgl_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC(name) param2; }
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+    static ret evgl_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC(name) param2; }
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
@@ -505,13 +521,16 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
 //1.1 ext bodies
 #define _EVASGL_EXT_CHECK_SUPPORT(name)
@@ -523,13 +542,17 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
     static ret evgl_gles1_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC_GLES1(name) param2; }
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+    static ret evgl_gles1_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC_GLES1(name) param2; }
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
@@ -541,13 +564,16 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
 //3.X ext bodies
 #define _EVASGL_EXT_CHECK_SUPPORT(name)
@@ -559,13 +585,17 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
     static ret evgl_gles3_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC_GLES3(name) param2; }
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+    static ret evgl_gles3_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC_GLES3(name) param2; }
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
@@ -577,13 +607,16 @@ _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenu
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
 //  0: not initialized,
 //  1: GLESv2 initialized,
@@ -649,10 +682,16 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
         if (*ext_support == 1) \
           {
 
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+     { \
+        ret (**drvfunc)param1 = &egl_ext_sym_##name; \
+        if (*ext_support == 1) \
+          {
 #define _EVASGL_EXT_FUNCTION_END() \
           } \
         if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
      }
+
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
@@ -668,6 +707,14 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
      } \
    else evgl_safe_extension_add(name, NULL);
 
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name) \
+   if ((*drvfunc) == NULL) \
+     { \
+        *drvfunc = GETPROCADDR(name); \
+        evgl_safe_extension_add(name, (void *) (*drvfunc)); \
+     } \
+   else evgl_safe_extension_add(name, NULL);
+
 #ifdef _EVASGL_EXT_FUNCTION_WHITELIST
 # undef _EVASGL_EXT_FUNCTION_WHITELIST
 #endif
@@ -689,11 +736,13 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
 #undef GETPROCADDR
    /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -725,11 +774,13 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
        _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #define _EVASGL_EXT_ENABLE_GL_GLES 0
 #define _EVASGL_EXT_ENABLE_EGL 1
@@ -747,11 +798,13 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
    /////////////////////////////////////////////////////////////////////////////////////////////////////
 
    if (_egl_ext_string) free(_egl_ext_string);
@@ -785,7 +838,7 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
 #endif
 
    // GLES Extensions
-   glexts = (const char*)glGetString(GL_EXTENSIONS);
+   glexts = (const char*)glGetString_evgl_thread_cmd(GL_EXTENSIONS);
    if (!glexts)
      {
         ERR("glGetString returned NULL! Something is very wrong...");
@@ -824,6 +877,15 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
      { \
         ret (**drvfunc)param1 = &gl_ext_sym_##name; \
+        ret (**origfunc)param1 = &orig_evgl_api_##name; \
+        ret (*threadfunc)param1 = &name##_evgl_api_thread_cmd; \
+        origfunc = origfunc; threadfunc = threadfunc; \
+        if (*ext_support == 1) \
+          {
+
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+     { \
+        ret (**drvfunc)param1 = &gl_ext_sym_##name; \
         if (*ext_support == 1) \
           {
 
@@ -842,6 +904,19 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
    if ((*drvfunc) == NULL) \
      { \
         *drvfunc = GETPROCADDR(name); \
+       if (*drvfunc) \
+       { \
+          *origfunc = *drvfunc; \
+          *drvfunc = *threadfunc; \
+       } \
+        evgl_safe_extension_add(name, (void *) (*drvfunc)); \
+     } \
+   else evgl_safe_extension_add(name, NULL);
+
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name) \
+   if ((*drvfunc) == NULL) \
+     { \
+        *drvfunc = GETPROCADDR(name); \
         evgl_safe_extension_add(name, (void *) (*drvfunc)); \
      } \
    else evgl_safe_extension_add(name, NULL);
@@ -867,11 +942,13 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
 #undef GETPROCADDR
    /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -904,11 +981,13 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
        _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 #define _EVASGL_EXT_ENABLE_GL_GLES 1
 #define _EVASGL_EXT_ENABLE_EGL 1
 
@@ -925,11 +1004,13 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
    /////////////////////////////////////////////////////////////////////////////////////////////////////
 
    if (_gl_ext_string) free(_gl_ext_string);
@@ -955,6 +1036,7 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
              return;
           }
      }
+
 #define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, evgl_)
 
    /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -972,13 +1054,17 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
    ORD(name);
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+   ORD(name);
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #undef _EVASGL_EXT_WHITELIST_ONLY
 #define _EVASGL_EXT_WHITELIST_ONLY 0
@@ -999,13 +1085,16 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
    /////////////////////////////////////////////////////////////////////////////////////////////////////
 #undef ORD
 
@@ -1017,7 +1106,9 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
    const char *glexts;
    fp_getproc gp = (fp_getproc)getproc;
    int _curext_supported = 0;
+   /*
    Evas_GL_API *gles1_funcs;
+   */
    Eina_Strbuf *sb = eina_strbuf_new();
    Eina_Strbuf *sboff = eina_strbuf_new();
 
@@ -1055,6 +1146,7 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
      }
 #endif
 
+   /*
    gles1_funcs = _evgl_api_gles1_internal_get();
    if (!gles1_funcs || !gles1_funcs->glGetString)
      {
@@ -1063,6 +1155,8 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
      }
 
    glexts = (const char *) gles1_funcs->glGetString(GL_EXTENSIONS);
+   */
+   glexts = (const char *) glGetString_evgl_thread_cmd(GL_EXTENSIONS);
    if (!glexts)
      {
         ERR("GLESv1:glGetString(GL_EXTENSIONS) returned NULL!");
@@ -1102,6 +1196,15 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
      { \
         ret (**drvfunc)param1 = &gles1_ext_sym_##name; \
+        ret (**origfunc)param1 = &orig_evgl_api_##name; \
+        ret (*threadfunc)param1 = &name##_evgl_api_thread_cmd; \
+        origfunc = origfunc; threadfunc = threadfunc; \
+        if (*ext_support == 1) \
+          {
+
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+     { \
+        ret (**drvfunc)param1 = &gles1_ext_sym_##name; \
         if (*ext_support == 1) \
           {
 
@@ -1109,6 +1212,7 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
           } \
         if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
      }
+
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN() \
    if (EINA_FALSE) \
      {
@@ -1121,6 +1225,19 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
    if ((*drvfunc) == NULL) \
      { \
         *drvfunc = GETPROCADDR(name); \
+       if (*drvfunc) \
+       { \
+          *origfunc = *drvfunc; \
+          *drvfunc = *threadfunc; \
+       } \
+        evgl_safe_extension_add(name, (void *) (*drvfunc)); \
+     } \
+   else evgl_safe_extension_add(name, NULL);
+
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name) \
+   if ((*drvfunc) == NULL) \
+     { \
+        *drvfunc = GETPROCADDR(name); \
         evgl_safe_extension_add(name, (void *) (*drvfunc)); \
      } \
    else evgl_safe_extension_add(name, NULL);
@@ -1149,11 +1266,13 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 #undef GETPROCADDR
 
 #define _EVASGL_EXT_BEGIN(name) \
@@ -1186,11 +1305,13 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
       _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 #define _EVASGL_EXT_ENABLE_GL_GLES 1
 #define _EVASGL_EXT_ENABLE_EGL 1
 
@@ -1207,11 +1328,13 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
    if (_gles1_ext_string) free(_gles1_ext_string);
    if (_gles1_ext_string_official) free(_gles1_ext_string_official);
@@ -1258,13 +1381,17 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
    ORD(name);
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+   ORD(name);
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #undef _EVASGL_EXT_WHITELIST_ONLY
 #define _EVASGL_EXT_WHITELIST_ONLY 0
@@ -1283,13 +1410,16 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
    /////////////////////////////////////////////////////////////////////////////////////////////////////
 #undef ORD
 
@@ -1301,7 +1431,9 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
    const char *glexts;
    fp_getproc gp = (fp_getproc)getproc;
    int _curext_supported = 0;
+   /*
    Evas_GL_API *gles3_funcs;
+   */
    Eina_Strbuf *sb = eina_strbuf_new();
    Eina_Strbuf *sboff = eina_strbuf_new();
 
@@ -1340,6 +1472,7 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
 #endif
 
    _gles3_ext_plist = eina_array_new(1);
+   /*
    gles3_funcs = _evgl_api_gles3_internal_get();
    if (!gles3_funcs || !gles3_funcs->glGetString)
      {
@@ -1348,6 +1481,8 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
      }
 
    glexts = (const char *) gles3_funcs->glGetString(GL_EXTENSIONS);
+   */
+   glexts = (const char *) glGetString_evgl_thread_cmd(GL_EXTENSIONS);
    if (!glexts)
      {
         ERR("GLESv3:glGetString(GL_EXTENSIONS) returned NULL!");
@@ -1387,6 +1522,15 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
      { \
         ret (**drvfunc)param1 = &gles3_ext_sym_##name; \
+        ret (**origfunc)param1 = &orig_evgl_api_##name; \
+        ret (*threadfunc)param1 = &name##_evgl_api_thread_cmd; \
+        origfunc = origfunc; threadfunc = threadfunc; \
+        if (*ext_support == 1) \
+          {
+
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+     { \
+        ret (**drvfunc)param1 = &gles3_ext_sym_##name; \
         if (*ext_support == 1) \
           {
 
@@ -1394,6 +1538,7 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
           } \
         if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
      }
+
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
@@ -1403,6 +1548,19 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
    if ((*drvfunc) == NULL) \
      { \
         *drvfunc = GETPROCADDR(name); \
+       if (*drvfunc) \
+       { \
+          *origfunc = *drvfunc; \
+          *drvfunc = *threadfunc; \
+       } \
+        evgl_safe_extension_add(name, (void *) (*drvfunc)); \
+     } \
+   else evgl_safe_extension_add(name, NULL);
+
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name) \
+   if ((*drvfunc) == NULL) \
+     { \
+        *drvfunc = GETPROCADDR(name); \
         evgl_safe_extension_add(name, (void *) (*drvfunc)); \
      } \
    else evgl_safe_extension_add(name, NULL);
@@ -1429,11 +1587,13 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 #undef GETPROCADDR
 
 #define _EVASGL_EXT_BEGIN(name) \
@@ -1469,11 +1629,13 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
       _EVASGL_EXT_DRVNAME_PRINT(#name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #define _EVASGL_EXT_ENABLE_GL_GLES 1
 #define _EVASGL_EXT_ENABLE_EGL 1
@@ -1491,11 +1653,13 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 
    if (_gles3_ext_string) free(_gles3_ext_string);
    if (_gles3_ext_string_official) free(_gles3_ext_string_official);
@@ -1542,13 +1706,17 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
    ORD(name);
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+   ORD(name);
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #undef _EVASGL_EXT_WHITELIST_ONLY
 #define _EVASGL_EXT_WHITELIST_ONLY 0
@@ -1568,13 +1736,16 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
    /////////////////////////////////////////////////////////////////////////////////////////////////////
 #undef ORD
 
index 118e409..700560b 100644 (file)
    extern ret (*gl_ext_sym_##name) param1; \
    extern ret (*gles1_ext_sym_##name) param1; \
    extern ret (*gles3_ext_sym_##name) param1;
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) \
+   extern ret (*egl_ext_sym_##name) param1; \
+   extern ret (*gl_ext_sym_##name) param1; \
+   extern ret (*gles1_ext_sym_##name) param1; \
+   extern ret (*gles3_ext_sym_##name) param1;
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 #define EXT_FUNC_EGL(fname) egl_ext_sym_##fname
 #define EXT_FUNC(fname) gl_ext_sym_##fname
 #define _EVASGL_EXT_DRVNAME_PRIVATE(name)
 #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
 #define _EVASGL_EXT_FUNCTION_END()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
 #define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
 #define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #include "evas_gl_api_ext_def.h"
 
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_DESKTOP
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
 #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
+#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 #define EXTENSION_SUPPORT_EGL(name) (_egl_ext_support_##name == 1)
 #define EXTENSION_SUPPORT(name) (_gl_ext_support_##name == 1)
index 8c8b1c0..3b4cd3f 100644 (file)
 // The functions of this block must correspond with the functions list in Evas_GL.h.
 // Begin of the extension function block (ret : return value, name : function name, param1 : parameters with bracket, param2 : parameters without type)
 #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) ret (*name) param1;
+#define _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2) ret (*name) param1;
 // End of the extension function block
 #define _EVASGL_EXT_FUNCTION_END()
+// End of the extension function block
 
 // These functions will not be exported. Only be used in engines privately.
 // Begin of the extension function block (ret : return value, name : function name, param1 : parameters with bracket, param2 : parameters without type)
 #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2)
 // End of the extension function block
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
@@ -41,6 +44,7 @@
 
 // Driver extension functions that need no wrapping
 #define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
+#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH(name)
 
 #endif
 //////////////////////////////////////////////////////////////////////////////////////////////////
 #define _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED
 #endif
 
+#ifndef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(ret, name, param1, param2) _EVASGL_EXT_FUNCTION_BEGIN_NOTH(ret, name, param1, param2)
+#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH_DEFINED
+#endif
+
 #ifndef _EVASGL_EXT_WHITELIST_ONLY
 # define _EVASGL_EXT_WHITELIST_ONLY 1
 #endif
@@ -1536,20 +1545,20 @@ _EVASGL_EXT_BEGIN(EGL_KHR_image_base)
 
        _EVASGL_EXT_DRVNAME(EGL_KHR_image_base)
 
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglCreateImage, (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e), (a, b, c, d, e))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglCreateImageKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(void *, eglCreateImage, (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e), (a, b, c, d, e))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglCreateImageKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, eglDestroyImage, (EGLDisplay a, void *b), (a, b))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglDestroyImageKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(void, eglDestroyImage, (EGLDisplay a, void *b), (a, b))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglDestroyImageKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
-    _EVASGL_EXT_FUNCTION_BEGIN(EvasGLImage, evasglCreateImage, (int target, void* buffer, const int *attrib_list), (target, buffer, attrib_list))
+    _EVASGL_EXT_FUNCTION_BEGIN_NOTH(EvasGLImage, evasglCreateImage, (int target, void* buffer, const int *attrib_list), (target, buffer, attrib_list))
         _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglCreateImage)
        _EVASGL_EXT_FUNCTION_END()
-       _EVASGL_EXT_FUNCTION_BEGIN(void, evasglDestroyImage, (EvasGLImage image), (image))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(void, evasglDestroyImage, (EvasGLImage image), (image))
         _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglDestroyImage)
        _EVASGL_EXT_FUNCTION_END()
-       _EVASGL_EXT_FUNCTION_BEGIN(EvasGLImage, evasglCreateImageForContext, (Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list), (evas_gl, ctx, target, buffer, attrib_list))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(EvasGLImage, evasglCreateImageForContext, (Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list), (evas_gl, ctx, target, buffer, attrib_list))
                _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglCreateImageForContext)
        _EVASGL_EXT_FUNCTION_END()
 
@@ -1647,29 +1656,29 @@ _EVASGL_EXT_BEGIN(EGL_KHR_fence_sync)
         _EVASGL_EXT_DRVNAME_PRIVATE(GL_OES_EGL_sync)
         _EVASGL_EXT_DRVNAME_PRIVATE(VG_KHR_EGL_sync)
 
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglCreateSyncKHR, (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list), (dpy, type, attrib_list))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglCreateSyncKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(void *, eglCreateSyncKHR, (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list), (dpy, type, attrib_list))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglCreateSyncKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglDestroySyncKHR, (EGLDisplay dpy, EGLSyncKHR sync), (dpy, sync))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglDestroySyncKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglDestroySyncKHR, (EGLDisplay dpy, EGLSyncKHR sync), (dpy, sync))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglDestroySyncKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLint, eglClientWaitSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout), (dpy, sync, flags, timeout))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglClientWaitSyncKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLint, eglClientWaitSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout), (dpy, sync, flags, timeout))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglClientWaitSyncKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglGetSyncAttribKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value), (dpy, sync, attribute, value))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglGetSyncAttribKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglGetSyncAttribKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value), (dpy, sync, attribute, value))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglGetSyncAttribKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
-       _EVASGL_EXT_FUNCTION_BEGIN(EvasGLSync, evasglCreateSync, (Evas_GL *evas_gl, unsigned int type, const int *attrib_list), (evas_gl, type, attrib_list))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(EvasGLSync, evasglCreateSync, (Evas_GL *evas_gl, unsigned int type, const int *attrib_list), (evas_gl, type, attrib_list))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglCreateSync)
        _EVASGL_EXT_FUNCTION_END()
-       _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglDestroySync, (Evas_GL *evas_gl, EvasGLSync sync), (evas_gl, sync))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglDestroySync, (Evas_GL *evas_gl, EvasGLSync sync), (evas_gl, sync))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglDestroySync)
        _EVASGL_EXT_FUNCTION_END()
-       _EVASGL_EXT_FUNCTION_BEGIN(int, evasglClientWaitSync, (Evas_GL *evas_gl, EvasGLSync sync, int flags, EvasGLTime timeout), (evas_gl, sync, flags, timeout))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(int, evasglClientWaitSync, (Evas_GL *evas_gl, EvasGLSync sync, int flags, EvasGLTime timeout), (evas_gl, sync, flags, timeout))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglClientWaitSync)
        _EVASGL_EXT_FUNCTION_END()
-       _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglGetSyncAttrib, (Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value), (evas_gl, sync, attribute, value))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglGetSyncAttrib, (Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value), (evas_gl, sync, attribute, value))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglGetSyncAttrib)
        _EVASGL_EXT_FUNCTION_END()
 
@@ -1679,11 +1688,11 @@ _EVASGL_EXT_BEGIN(EGL_KHR_reusable_sync)
 
        _EVASGL_EXT_DRVNAME(EGL_KHR_reusable_sync)
 
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglSignalSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode), (dpy, sync, mode))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglSignalSyncKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglSignalSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode), (dpy, sync, mode))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglSignalSyncKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
-       _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglSignalSync, (Evas_GL *evas_gl, EvasGLSync sync, unsigned mode), (evas_gl, sync, mode))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglSignalSync, (Evas_GL *evas_gl, EvasGLSync sync, unsigned mode), (evas_gl, sync, mode))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglSignalSync)
        _EVASGL_EXT_FUNCTION_END()
 
@@ -1693,11 +1702,11 @@ _EVASGL_EXT_BEGIN(EGL_KHR_wait_sync)
 
        _EVASGL_EXT_DRVNAME(EGL_KHR_wait_sync)
 
-       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLint, eglWaitSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, int flags), (dpy, sync, flags))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglWaitSyncKHR")
+       _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLint, eglWaitSyncKHR, (EGLDisplay dpy, EGLSyncKHR sync, int flags), (dpy, sync, flags))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglWaitSyncKHR")
        _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
-       _EVASGL_EXT_FUNCTION_BEGIN(int, evasglWaitSync, (Evas_GL *evas_gl, EvasGLSync sync, int flags), (evas_gl, sync, flags))
+       _EVASGL_EXT_FUNCTION_BEGIN_NOTH(int, evasglWaitSync, (Evas_GL *evas_gl, EvasGLSync sync, int flags), (evas_gl, sync, flags))
             _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglWaitSync)
        _EVASGL_EXT_FUNCTION_END()
 
@@ -1707,23 +1716,23 @@ _EVASGL_EXT_BEGIN(EGL_WL_bind_wayland_display)
 
         _EVASGL_EXT_DRVNAME(EGL_WL_bind_wayland_display)
 
-        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglBindWaylandDisplayWL, (EGLDisplay dpy, void *display), (dpy, display))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglBindWaylandDisplayWL")
+        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglBindWaylandDisplayWL, (EGLDisplay dpy, void *display), (dpy, display))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglBindWaylandDisplayWL")
         _EVASGL_EXT_FUNCTION_PRIVATE_END()
-        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglUnbindWaylandDisplayWL, (EGLDisplay dpy, void *display), (dpy, display))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglUnbindWaylandDisplayWL")
+        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglUnbindWaylandDisplayWL, (EGLDisplay dpy, void *display), (dpy, display))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglUnbindWaylandDisplayWL")
         _EVASGL_EXT_FUNCTION_PRIVATE_END()
-        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(EGLBoolean, eglQueryWaylandBufferWL, (EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value), (dpy, buffer, attribute, value))
-                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglQueryWaylandBufferWL")
+        _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH(EGLBoolean, eglQueryWaylandBufferWL, (EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value), (dpy, buffer, attribute, value))
+                _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR_NOTH("eglQueryWaylandBufferWL")
         _EVASGL_EXT_FUNCTION_PRIVATE_END()
 
-        _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglBindWaylandDisplay, (Evas_GL *evas_gl, void *wl_display), (evas_gl, wl_display))
+        _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglBindWaylandDisplay, (Evas_GL *evas_gl, void *wl_display), (evas_gl, wl_display))
                 _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglBindWaylandDisplay)
         _EVASGL_EXT_FUNCTION_END()
-        _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglUnbindWaylandDisplay, (Evas_GL *evas_gl, void *wl_display), (evas_gl, wl_display))
+        _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglUnbindWaylandDisplay, (Evas_GL *evas_gl, void *wl_display), (evas_gl, wl_display))
                 _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglUnbindWaylandDisplay)
         _EVASGL_EXT_FUNCTION_END()
-        _EVASGL_EXT_FUNCTION_BEGIN(Eina_Bool, evasglQueryWaylandBuffer, (Evas_GL *evas_gl, void *buffer, int attribute, int *value), (evas_gl, buffer, attribute, value))
+        _EVASGL_EXT_FUNCTION_BEGIN_NOTH(Eina_Bool, evasglQueryWaylandBuffer, (Evas_GL *evas_gl, void *buffer, int attribute, int *value), (evas_gl, buffer, attribute, value))
                 _EVASGL_EXT_FUNCTION_DRVFUNC(_evgl_evasglQueryWaylandBuffer)
         _EVASGL_EXT_FUNCTION_END()
 
@@ -1825,6 +1834,11 @@ _EVASGL_EXT_END()
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED
 #endif
 
+#ifdef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH_DEFINED
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH_DEFINED
+#endif
+
 #ifdef _EVASGL_EXT_DRVNAME_PRIVATE_DEFINED
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_DRVNAME_PRIVATE_DEFINED
@@ -1838,8 +1852,10 @@ _EVASGL_EXT_END()
 #undef _EVASGL_EXT_DRVNAME
 #undef _EVASGL_EXT_DRVNAME_PRIVATE
 #undef _EVASGL_EXT_FUNCTION_BEGIN
+#undef _EVASGL_EXT_FUNCTION_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_END
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
+#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_NOTH
 #undef _EVASGL_EXT_FUNCTION_PRIVATE_END
 #undef _EVASGL_EXT_FUNCTION_DRVFUNC
 #endif
index 0619c03..295e203 100644 (file)
@@ -4016,13 +4016,17 @@ _evgl_gles1_api_init(void)
    return EINA_TRUE;
 }
 
+#define EVAS_API_OVERRIDE_THREAD_CMD(func, api, prefix) \
+   (api)->func = func##_evgl_api_thread_cmd; \
+   orig_evgl_api_##func = prefix##func
+
 static void
 _debug_gles1_api_get(Evas_GL_API *funcs)
 {
    if (!funcs) return;
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(name) EVAS_API_OVERRIDE(name, funcs, _evgld_gles1_)
+#define ORD(name) EVAS_API_OVERRIDE_THREAD_CMD(name, funcs, _evgld_gles1_)
    /* Available only in Common profile */
    ORD(glAlphaFunc);
    ORD(glClearColor);
@@ -4179,7 +4183,7 @@ _normal_gles1_api_get(Evas_GL_API *funcs)
    if (!funcs) return;
    funcs->version = EVAS_GL_API_VERSION;
 
-#define ORD(name) EVAS_API_OVERRIDE(name, funcs, _evgl_gles1_)
+#define ORD(name) EVAS_API_OVERRIDE_THREAD_CMD(name, funcs, _evgl_gles1_)
    /* Available only in Common profile */
    ORD(glAlphaFunc);
    ORD(glClearColor);
index fe484a3..9ed2986 100644 (file)
@@ -208,7 +208,6 @@ struct _Evas_GL_Shared
    int mflip;
    // persp map
    int foc, z0, px, py;
-   int ax, ay;
    GLfloat proj[16];
 
    Eina_Bool needs_shaders_flush : 1;
@@ -251,7 +250,6 @@ struct _Evas_Engine_GL_Context
    int                references;
    int                w, h;
    int                rot;
-   int                foc, z0, px, py;
    RGBA_Draw_Context *dc;
 
    Evas_GL_Shared     *shared;
@@ -280,6 +278,9 @@ struct _Evas_Engine_GL_Context
 
    struct {
       struct {
+        int foc, z0, px, py;
+      } viewport;
+      struct {
          int             x, y, w, h;
          Shader_Type     type;
       } region;
@@ -329,10 +330,6 @@ struct _Evas_Engine_GL_Context
       } array;
    } pipe[MAX_PIPES];
 
-   struct {
-      Eina_Bool size : 1;
-   } change;
-   
    Eina_List *font_glyph_textures;
 
    Eina_Bool havestuff : 1;
@@ -784,6 +781,8 @@ void pt_unref(Evas_GL_Texture_Pool *pt);
 // Enable very basic GL calls logging (requires GL_ERRORS)
 //#define GL_ERRORS_TRACE 1
 
+#include "evas_gl_thread.h"
+
 #ifdef GL_ERRORS
 
 # ifndef _WIN32
@@ -799,7 +798,7 @@ __evas_gl_errdyn(int err, const char *file, const char *func, int line, const ch
 }
 # define GLERRV(op) \
   { \
-      int __gl_err = glGetError(); \
+      int __gl_err = glGetError_thread_cmd(); \
       if (__gl_err != GL_NO_ERROR) \
         __evas_gl_errdyn(__gl_err, __FILE__, __FUNCTION__, __LINE__, op); \
    }
@@ -812,56 +811,56 @@ __evas_gl_errdyn(int err, const char *file, const char *func, int line, const ch
 #   define GL_ERROR_TRACE(f, _args, ...) do { DBG("%s(%s);", #f, _args); f(__VA_ARGS__); GLERRV(#f); } while(0)
 #   define GL_ERROR_TRACE_RET(t, f, _args, ...) ({ t _r; DBG("%s(%s);", #f, _args); _r = f(__VA_ARGS__); GLERRV(#f); _r; })
 #  endif
-#  define glActiveTexture(...) GL_ERROR_TRACE(glActiveTexture, #__VA_ARGS__, __VA_ARGS__)
-#  define glBindAttribLocation(...) GL_ERROR_TRACE(glBindAttribLocation, #__VA_ARGS__, __VA_ARGS__)
-#  define glBindBuffer(...) GL_ERROR_TRACE(glBindBuffer, #__VA_ARGS__, __VA_ARGS__)
-#  define glBindTexture(...) GL_ERROR_TRACE(glBindTexture, #__VA_ARGS__, __VA_ARGS__)
-#  define glBlendFunc(...) GL_ERROR_TRACE(glBlendFunc, #__VA_ARGS__, __VA_ARGS__)
-#  define glBufferData(...) GL_ERROR_TRACE(glBufferData, #__VA_ARGS__, __VA_ARGS__)
-#  define glCompressedTexSubImage2D(...) GL_ERROR_TRACE(glCompressedTexSubImage2D, #__VA_ARGS__, __VA_ARGS__)
-#  define glDeleteBuffers(...) GL_ERROR_TRACE(glDeleteBuffers, #__VA_ARGS__, __VA_ARGS__)
-#  define glDepthMask(...) GL_ERROR_TRACE(glDepthMask, #__VA_ARGS__, __VA_ARGS__)
-#  define glDisable(...) GL_ERROR_TRACE(glDisable, #__VA_ARGS__, __VA_ARGS__)
-#  define glDisableVertexAttribArray(...) GL_ERROR_TRACE(glDisableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
-#  define glDrawArrays(...) GL_ERROR_TRACE(glDrawArrays, #__VA_ARGS__, __VA_ARGS__)
-#  define glEnable(...) GL_ERROR_TRACE(glEnable, #__VA_ARGS__, __VA_ARGS__)
-#  define glEnableVertexAttribArray(...) GL_ERROR_TRACE(glEnableVertexAttribArray, #__VA_ARGS__, __VA_ARGS__)
-#  define glGenBuffers(...) GL_ERROR_TRACE(glGenBuffers, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetFloatv(...) GL_ERROR_TRACE(glGetFloatv, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetIntegerv(...) GL_ERROR_TRACE(glGetIntegerv, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetUniformLocation(...) GL_ERROR_TRACE_RET(GLuint, glGetUniformLocation, #__VA_ARGS__, __VA_ARGS__)
-#  define glHint(...) GL_ERROR_TRACE(glHint, #__VA_ARGS__, __VA_ARGS__)
-#  define glReadPixels(...) GL_ERROR_TRACE(glReadPixels, #__VA_ARGS__, __VA_ARGS__)
-#  define glScissor(...) GL_ERROR_TRACE(glScissor, #__VA_ARGS__, __VA_ARGS__)
-#  define glGenFramebuffers(...) GL_ERROR_TRACE(glGenFramebuffers, #__VA_ARGS__, __VA_ARGS__)
-#  define glBindFramebuffer(...) GL_ERROR_TRACE(glBindFramebuffer, #__VA_ARGS__, __VA_ARGS__)
-#  define glEndTiling(...) GL_ERROR_TRACE(glEndTiling, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetProgramBinary(...) GL_ERROR_TRACE(glGetProgramBinary, #__VA_ARGS__, __VA_ARGS__)
-#  define glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glMapBuffer, #__VA_ARGS__, __VA_ARGS__)
-#  define glStartTiling(...) GL_ERROR_TRACE(glStartTiling, #__VA_ARGS__, __VA_ARGS__)
-#  define glUnmapBuffer(...) GL_ERROR_TRACE(glUnmapBuffer, #__VA_ARGS__, __VA_ARGS__)
-#  define glTexParameterf(...) GL_ERROR_TRACE(glTexParameterf, #__VA_ARGS__, __VA_ARGS__)
-#  define glTexParameteri(...) GL_ERROR_TRACE(glTexParameteri, #__VA_ARGS__, __VA_ARGS__)
-#  define glTexSubImage2D(...) GL_ERROR_TRACE(glTexSubImage2D, #__VA_ARGS__, __VA_ARGS__)
-#  define glUniform1f(...) GL_ERROR_TRACE(glUniform1f, #__VA_ARGS__, __VA_ARGS__)
-#  define glUniform1i(...) GL_ERROR_TRACE(glUniform1i, #__VA_ARGS__, __VA_ARGS__)
-#  define glUniform2fv(...) GL_ERROR_TRACE(glUniform2fv, #__VA_ARGS__, __VA_ARGS__)
-#  define glUniform4fv(...) GL_ERROR_TRACE(glUniform4fv, #__VA_ARGS__, __VA_ARGS__)
-#  define glUniformMatrix4fv(...) GL_ERROR_TRACE(glUniformMatrix4fv, #__VA_ARGS__, __VA_ARGS__)
-#  define glUseProgram(...) GL_ERROR_TRACE(glUseProgram, #__VA_ARGS__, __VA_ARGS__)
-#  define glVertexAttribPointer(...) GL_ERROR_TRACE(glVertexAttribPointer, #__VA_ARGS__, __VA_ARGS__)
-#  define glViewport(...) GL_ERROR_TRACE(glViewport, #__VA_ARGS__, __VA_ARGS__)
-#  define glPixelStorei(...) GL_ERROR_TRACE(glPixelStorei, #__VA_ARGS__, __VA_ARGS__)
-#  define glCompressedTexImage2D(...) GL_ERROR_TRACE(glCompressedTexImage2D, #__VA_ARGS__, __VA_ARGS__)
-#  define glCreateShader(...) GL_ERROR_TRACE_RET(GLuint, glCreateShader, #__VA_ARGS__, __VA_ARGS__)
-#  define glCreateProgram(...) GL_ERROR_TRACE_RET(GLuint, glCreateProgram, #__VA_ARGS__, __VA_ARGS__)
-#  define glAttachShader(...) GL_ERROR_TRACE(glAttachShader, #__VA_ARGS__, __VA_ARGS__)
-#  define glLinkProgram(...) GL_ERROR_TRACE(glLinkProgram, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetProgramiv(...) GL_ERROR_TRACE(glGetProgramiv, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetProgramInfoLog(...) GL_ERROR_TRACE(glGetProgramInfoLog, #__VA_ARGS__, __VA_ARGS__)
-#  define glGetShaderiv(...) GL_ERROR_TRACE(glGetShaderiv, #__VA_ARGS__, __VA_ARGS__)
-#  define glShaderSource(...) GL_ERROR_TRACE(glShaderSource, #__VA_ARGS__, __VA_ARGS__)
-#  define glCompileShader(...) GL_ERROR_TRACE(glCompileShader, #__VA_ARGS__, __VA_ARGS__)
+#  define glActiveTexture(...) GL_ERROR_TRACE(glActiveTexture_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBindAttribLocation(...) GL_ERROR_TRACE(glBindAttribLocation_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBindBuffer(...) GL_ERROR_TRACE(glBindBuffer_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBindTexture(...) GL_ERROR_TRACE(glBindTexture_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBlendFunc(...) GL_ERROR_TRACE(glBlendFunc_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBufferData(...) GL_ERROR_TRACE(glBufferData_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glCompressedTexSubImage2D(...) GL_ERROR_TRACE(glCompressedTexSubImage2D_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glDeleteBuffers(...) GL_ERROR_TRACE(glDeleteBuffers_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glDepthMask(...) GL_ERROR_TRACE(glDepthMask_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glDisable(...) GL_ERROR_TRACE(glDisable_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glDisableVertexAttribArray(...) GL_ERROR_TRACE(glDisableVertexAttribArray_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glDrawArrays(...) GL_ERROR_TRACE(glDrawArrays_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glEnable(...) GL_ERROR_TRACE(glEnable_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glEnableVertexAttribArray(...) GL_ERROR_TRACE(glEnableVertexAttribArray_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGenBuffers(...) GL_ERROR_TRACE(glGenBuffers_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetFloatv(...) GL_ERROR_TRACE(glGetFloatv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetIntegerv(...) GL_ERROR_TRACE(glGetIntegerv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetUniformLocation(...) GL_ERROR_TRACE_RET(GLuint, glGetUniformLocation_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glHint(...) GL_ERROR_TRACE(glHint_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glReadPixels(...) GL_ERROR_TRACE(glReadPixels_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glScissor(...) GL_ERROR_TRACE(glScissor_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGenFramebuffers(...) GL_ERROR_TRACE(glGenFramebuffers_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glBindFramebuffer(...) GL_ERROR_TRACE(glBindFramebuffer_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glEndTiling(...) GL_ERROR_TRACE(glEndTiling_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetProgramBinary(...) GL_ERROR_TRACE(glGetProgramBinary_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glMapBuffer(...) GL_ERROR_TRACE_RET(void *, glMapBuffer_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glStartTiling(...) GL_ERROR_TRACE(glStartTiling_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUnmapBuffer(...) GL_ERROR_TRACE(glUnmapBuffer_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glTexParameterf(...) GL_ERROR_TRACE(glTexParameterf_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glTexParameteri(...) GL_ERROR_TRACE(glTexParameteri_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glTexSubImage2D(...) GL_ERROR_TRACE(glTexSubImage2D_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUniform1f(...) GL_ERROR_TRACE(glUniform1f_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUniform1i(...) GL_ERROR_TRACE(glUniform1i_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUniform2fv(...) GL_ERROR_TRACE(glUniform2fv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUniform4fv(...) GL_ERROR_TRACE(glUniform4fv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUniformMatrix4fv(...) GL_ERROR_TRACE(glUniformMatrix4fv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glUseProgram(...) GL_ERROR_TRACE(glUseProgram_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glVertexAttribPointer(...) GL_ERROR_TRACE(glVertexAttribPointer_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glViewport(...) GL_ERROR_TRACE(glViewport_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glPixelStorei(...) GL_ERROR_TRACE(glPixelStorei_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glCompressedTexImage2D(...) GL_ERROR_TRACE(glCompressedTexImage2D_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glCreateShader(...) GL_ERROR_TRACE_RET(GLuint, glCreateShader_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glCreateProgram(...) GL_ERROR_TRACE_RET(GLuint, glCreateProgram_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glAttachShader(...) GL_ERROR_TRACE(glAttachShader_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glLinkProgram(...) GL_ERROR_TRACE(glLinkProgram_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetProgramiv(...) GL_ERROR_TRACE(glGetProgramiv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetProgramInfoLog(...) GL_ERROR_TRACE(glGetProgramInfoLog_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glGetShaderiv(...) GL_ERROR_TRACE(glGetShaderiv_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glShaderSource(...) GL_ERROR_TRACE(glShaderSource_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
+#  define glCompileShader(...) GL_ERROR_TRACE(glCompileShader_thread_cmd, #__VA_ARGS__, __VA_ARGS__)
 #  define glsym_glGenFramebuffers(...) GL_ERROR_TRACE(glsym_glGenFramebuffers, #__VA_ARGS__, __VA_ARGS__)
 #  define glsym_glBindFramebuffer(...) GL_ERROR_TRACE(glsym_glBindFramebuffer, #__VA_ARGS__, __VA_ARGS__)
 #  define glsym_glFramebufferTexture2D(...) GL_ERROR_TRACE(glsym_glFramebufferTexture2D, #__VA_ARGS__, __VA_ARGS__)
@@ -886,22 +885,6 @@ __evas_gl_errdyn(int err, const char *file, const char *func, int line, const ch
 Eina_Bool evas_gl_common_module_open(void);
 void      evas_gl_common_module_close(void);
 
-static inline void
-_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix)
-{
-   if ((w > gc->shared->info.max_texture_size) ||
-       (h > gc->shared->info.max_texture_size)) return;
-   glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
-}
-
-static inline void
-_comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int imgsize, const void *pix)
-{
-   if ((w > gc->shared->info.max_texture_size) ||
-       (h > gc->shared->info.max_texture_size)) return;
-   glCompressedTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix);
-}
-
 #include "evas_gl_3d_common.h"
 
 #undef EAPI
index 4e444a1..0e15590 100644 (file)
@@ -70,6 +70,13 @@ typedef void (*_eng_fn) (void);
 typedef _eng_fn (*glsym_func_eng_fn) ();
 #endif
 
+#define REPLACE_THREAD(prefix, dst, typ) \
+   if (prefix##dst && prefix##dst != (typ) dst##_thread_cmd) \
+     { \
+        dst##_orig_evas_set(prefix##dst); \
+        prefix##dst = (typ) dst##_thread_cmd; \
+     }
+
 static int dbgflushnum = -1;
 
 static void
@@ -101,6 +108,7 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
 #ifdef GL_GLES
    FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
    FINDSYM2(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
+   REPLACE_THREAD(glsym_, glGenFramebuffers, glsym_func_void);
    FALLBAK(glsym_glGenFramebuffers, glsym_func_void);
 #else
    FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersEXT", glsym_func_void);
@@ -108,12 +116,14 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
    // nvidia tegra3 drivers seem to not expose via getprocaddress, but dlsym finds it
    FINDSYM2(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
+   REPLACE_THREAD(glsym_, glGenFramebuffers, glsym_func_void);
    FALLBAK(glsym_glGenFramebuffers, glsym_func_void);
 #endif
 
 #ifdef GL_GLES
    FINDSYM(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
    FINDSYM2(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
+   REPLACE_THREAD(glsym_, glBindFramebuffer, glsym_func_void);
    FALLBAK(glsym_glBindFramebuffer, glsym_func_void);
 #else
    FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferEXT", glsym_func_void);
@@ -121,6 +131,7 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
    // nvidia tegra3 drivers seem to not expose via getprocaddress, but dlsym finds it
    FINDSYM2(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
+   REPLACE_THREAD(glsym_, glBindFramebuffer, glsym_func_void);
    FALLBAK(glsym_glBindFramebuffer, glsym_func_void);
 #endif
 
@@ -129,6 +140,7 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2D", glsym_func_void);
    // nvidia tegra3 drivers seem to not expose via getprocaddress, but dlsym finds it
    FINDSYM2(glsym_glFramebufferTexture2D, "glFramebufferTexture2D", glsym_func_void);
+   REPLACE_THREAD(glsym_, glFramebufferTexture2D, glsym_func_void);
    FALLBAK(glsym_glFramebufferTexture2D, glsym_func_void);
 
    FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersEXT", glsym_func_void);
@@ -136,6 +148,7 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffers", glsym_func_void);
    // nvidia tegra3 drivers seem to not expose via getprocaddress, but dlsym finds it
    FINDSYM2(glsym_glDeleteFramebuffers, "glDeleteFramebuffers", glsym_func_void);
+   REPLACE_THREAD(glsym_, glDeleteFramebuffers, glsym_func_void);
    FALLBAK(glsym_glDeleteFramebuffers, glsym_func_void);
 
    FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryOES", glsym_func_void);
@@ -143,27 +156,35 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryEXT", glsym_func_void);
    FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryARB", glsym_func_void);
    FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinary", glsym_func_void);
+   REPLACE_THREAD(glsym_, glGetProgramBinary, glsym_func_void);
 
    FINDSYM(glsym_glProgramBinary, "glProgramBinaryOES", glsym_func_void);
    FINDSYM(glsym_glProgramBinary, "glProgramBinaryKHR", glsym_func_void);
    FINDSYM(glsym_glProgramBinary, "glProgramBinaryEXT", glsym_func_void);
    FINDSYM(glsym_glProgramBinary, "glProgramBinaryARB", glsym_func_void);
    FINDSYM(glsym_glProgramBinary, "glProgramBinary", glsym_func_void);
+   REPLACE_THREAD(glsym_, glProgramBinary, glsym_func_void);
 
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
+   REPLACE_THREAD(glsym_, glProgramParameteri, glsym_func_void);
 
    FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompilerEXT", glsym_func_void);
    FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompilerARB", glsym_func_void);
    FINDSYM(glsym_glReleaseShaderCompiler, "glReleaseShaderCompiler", glsym_func_void);
+   FINDSYM2(glsym_glReleaseShaderCompiler, "glReleaseShaderCompiler", glsym_func_void);
+   REPLACE_THREAD(glsym_, glReleaseShaderCompiler, glsym_func_void);
+   FALLBAK(glsym_glReleaseShaderCompiler, glsym_func_void);
 
    FINDSYM(glsym_glStartTiling, "glStartTilingQCOM", glsym_func_void);
    FINDSYM(glsym_glStartTiling, "glStartTiling", glsym_func_void);
    FINDSYM(glsym_glStartTiling, "glActivateTileQCOM", glsym_func_void);
+   REPLACE_THREAD(glsym_, glStartTiling, glsym_func_void);
 
    FINDSYM(glsym_glEndTiling, "glEndTilingQCOM", glsym_func_void);
    FINDSYM(glsym_glEndTiling, "glEndTiling", glsym_func_void);
+   REPLACE_THREAD(glsym_, glEndTiling, glsym_func_void);
 
    if (!getenv("EVAS_GL_MAPBUFFER_DISABLE"))
      {
@@ -172,12 +193,14 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
         FINDSYM(glsym_glMapBuffer, "glMapBufferARB", glsym_func_void_ptr);
         FINDSYM(glsym_glMapBuffer, "glMapBufferKHR", glsym_func_void_ptr);
         FINDSYM(glsym_glMapBuffer, "glMapBuffer", glsym_func_void_ptr);
+        REPLACE_THREAD(glsym_, glMapBuffer, glsym_func_void_ptr);
 
         FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferOES", glsym_func_boolean);
         FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferEXT", glsym_func_boolean);
         FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferARB", glsym_func_boolean);
         FINDSYM(glsym_glUnmapBuffer, "glUnmapBufferKHR", glsym_func_boolean);
         FINDSYM(glsym_glUnmapBuffer, "glUnmapBuffer", glsym_func_boolean);
+        REPLACE_THREAD(glsym_, glUnmapBuffer, glsym_func_boolean);
      }
 
 #ifdef GL_GLES
@@ -204,8 +227,10 @@ evas_gl_symbols(void *(*GetProcAddress)(const char *name))
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
    FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
+   REPLACE_THREAD(glsym_, glProgramParameteri, glsym_func_void);
 
    FINDSYM(secsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void);
+   REPLACE_THREAD(secsym_, glEGLImageTargetTexture2DOES, glsym_func_void);
 
    FINDSYM(secsym_eglMapImageSEC, "eglMapImageSEC", secsym_func_void_ptr);
 
@@ -279,7 +304,7 @@ __evas_gl_err(int err, const char *file, const char *func, int line, const char
 #ifdef GL_INVALID_FRAMEBUFFER_OPERATION
      case GL_INVALID_FRAMEBUFFER_OPERATION:
         {
-           GLenum e = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+           GLenum e = glCheckFramebufferStatus_thread_cmd(GL_FRAMEBUFFER);
            switch (e)
              {
 #ifdef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
@@ -390,7 +415,7 @@ _evas_gl_common_version_check(int *gles_ver)
    * GL_VERSION is used to get the version of the connection
    */
 
-   version = (char *)glGetString(GL_VERSION);
+   version = (char *)glGetString_thread_cmd(GL_VERSION);
    if (!version)
      {
         /* Something is wrong! */
@@ -489,17 +514,71 @@ _evas_gl_common_version_check(int *gles_ver)
    return 0;
 }
 
+static inline void
+_calculate_foc(int rot, int m, int w, int h, int px, int py,
+               int *vx_out, int *vy_out, int *vw_out, int *vh_out, int *ax_out, int *ay_out)
+{
+   int ppx = 0, ppy = 0;
+   int vx = 0, vy = 0, vw = 0, vh = 0, ax = 0, ay = 0;
+
+
+   if      ((rot == 0  ) || (rot == 90 )) ppx = px;
+   else if ((rot == 180) || (rot == 270)) ppx = w - px;
+   if      ((rot == 0  ) || (rot == 270)) ppy = py;
+   else if ((rot == 90 ) || (rot == 180)) ppy = h - py;
+
+   vx = ((w / 2) - ppx);
+   if (vx >= 0)
+     {
+        vw = w + (2 * vx);
+        if      ((rot == 0  ) || (rot == 90 )) ax = 2 * vx;
+        else if ((rot == 180) || (rot == 270)) ax = 0;
+     }
+   else
+     {
+        vw = w - (2 * vx);
+        if      ((rot == 0  ) || (rot == 90 )) ax = 0;
+        else if ((rot == 180) || (rot == 270)) ax = ppx - px;
+        vx = 0;
+     }
+
+   vy = ((h / 2) - ppy);
+   if (vy < 0)
+     {
+        vh = h - (2 * vy);
+        if      (rot == 0) ay = 0;
+        else if ((rot == 90 ) || (rot == 180) || (rot == 270)) ay = ppy - py;
+        vy = -vy;
+     }
+   else
+     {
+        vh = h + (2 * vy);
+        if      ((rot == 0  ) || (rot == 270)) ay = 2 * vy;
+        else if ((rot == 90 ) || (rot == 180)) ay = 0;
+        vy = 0;
+     }
+
+   if (m == -1) ay = vy * 2;
+
+   if (vx_out) *vx_out = vx;
+   if (vy_out) *vy_out = vy;
+   if (vw_out) *vw_out = vw;
+   if (vh_out) *vh_out = vh;
+   if (ax_out) *ax_out = ax;
+   if (ay_out) *ay_out = ay;
+}
+
 //Tizen Only : when multi window are shown, latest window does not show. so force call glviewport when window resizing occur
 //static void _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
 static void
-_evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
+_evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int pipe, int force_update)
 {
    int w = 1, h = 1, m = 1, rot = 1, foc = 0;
    Evas_GL_Program *prog;
    Eina_Iterator *it;
 
    EINA_SAFETY_ON_NULL_RETURN(gc);
-   foc = gc->foc;
+   foc = gc->pipe[pipe].viewport.foc;
    // surface in pipe 0 will be the same as all pipes
    if ((gc->pipe[0].shader.surface == gc->def_surface) ||
        (!gc->pipe[0].shader.surface))
@@ -520,12 +599,12 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
    if ((gc->shared->eglctxt == gc->eglctxt) && (!force_update ))
 #endif
      {
-        if ((!gc->change.size) ||
-            (
-                (gc->shared->w == w) && (gc->shared->h == h) &&
-                (gc->shared->rot == rot) && (gc->shared->foc == gc->foc) &&
-                (gc->shared->mflip == m)
-            )
+        if ((gc->shared->w == w) && (gc->shared->h == h) &&
+            (gc->shared->rot == rot) && (gc->shared->foc == foc) &&
+            (gc->shared->mflip == m) &&
+            (gc->shared->z0 == gc->pipe[pipe].viewport.z0) &&
+            (gc->shared->px == gc->pipe[pipe].viewport.px) &&
+            (gc->shared->py == gc->pipe[pipe].viewport.py)
            )
           return;
      }
@@ -538,17 +617,16 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
    gc->shared->rot = rot;
    gc->shared->mflip = m;
    gc->shared->foc = foc;
-   gc->shared->z0 = gc->z0;
-   gc->shared->px = gc->px;
-   gc->shared->py = gc->py;
-   gc->change.size = 0;
+   gc->shared->z0 = gc->pipe[pipe].viewport.z0;
+   gc->shared->px = gc->pipe[pipe].viewport.px;
+   gc->shared->py = gc->pipe[pipe].viewport.py;
 
    if (foc == 0)
      {
         if ((rot == 0) || (rot == 180))
-           glViewport(0, 0, w, h);
+           glViewport_thread_cmd(0, 0, w, h);
         else
-           glViewport(0, 0, h, w);
+           glViewport_thread_cmd(0, 0, h, w);
         // std matrix
         if (m == 1)
            matrix_ortho(gc->shared->proj,
@@ -566,53 +644,15 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
      }
    else
      {
-        int px, py, vx, vy, vw = 0, vh = 0, ax = 0, ay = 0, ppx = 0, ppy = 0;
+        int vx, vy, vw, vh, ax, ay;
 
-        px = gc->shared->px;
-        py = gc->shared->py;
-
-        if      ((rot == 0  ) || (rot == 90 )) ppx = px;
-        else if ((rot == 180) || (rot == 270)) ppx = w - px;
-        if      ((rot == 0  ) || (rot == 270)) ppy = py;
-        else if ((rot == 90 ) || (rot == 180)) ppy = h - py;
-
-        vx = ((w / 2) - ppx);
-        if (vx >= 0)
-          {
-             vw = w + (2 * vx);
-             if      ((rot == 0  ) || (rot == 90 )) ax = 2 * vx;
-             else if ((rot == 180) || (rot == 270)) ax = 0;
-          }
-        else
-          {
-             vw = w - (2 * vx);
-             if      ((rot == 0  ) || (rot == 90 )) ax = 0;
-             else if ((rot == 180) || (rot == 270)) ax = ppx - px;
-             vx = 0;
-          }
-
-        vy = ((h / 2) - ppy);
-        if (vy < 0)
-          {
-             vh = h - (2 * vy);
-             if      (rot == 0) ay = 0;
-             else if ((rot == 90 ) || (rot == 180) || (rot == 270)) ay = ppy - py;
-             vy = -vy;
-          }
-        else
-          {
-             vh = h + (2 * vy);
-             if      ((rot == 0  ) || (rot == 270)) ay = 2 * vy;
-             else if ((rot == 90 ) || (rot == 180)) ay = 0;
-             vy = 0;
-          }
-
-        if (m == -1) ay = vy * 2;
+        _calculate_foc(rot, m, w, h, gc->shared->px, gc->shared->py,
+                       &vx, &vy, &vw, &vh, &ax, &ay);
 
         if ((rot == 0) || (rot == 180))
-           glViewport(-2 * vx, -2 * vy, vw, vh);
+           glViewport_thread_cmd(-2 * vx, -2 * vy, vw, vh);
         else
-           glViewport(-2 * vy, -2 * vx, vh, vw);
+           glViewport_thread_cmd(-2 * vy, -2 * vx, vh, vw);
         if (m == 1)
            matrix_ortho(gc->shared->proj, 0, vw, 0, vh,
                         -1000000.0, 1000000.0,
@@ -623,8 +663,6 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
                         -1000000.0, 1000000.0,
                         rot, vw, vh,
                         foc, 0.0);
-        gc->shared->ax = ax;
-        gc->shared->ay = ay;
      }
 
    // FIXME: Is this heavy work?
@@ -636,9 +674,9 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc, int force_update)
    if (gc->state.current.prog != PRG_INVALID)
      {
         prog = gc->state.current.prog;
-        glUseProgram(prog->prog);
-        glUniform1i(prog->uniform.rotation_id, gc->rot / 90);
-        glUniformMatrix4fv(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj);
+        glUseProgram_thread_cmd(prog->prog);
+        glUniform1i_thread_cmd(prog->uniform.rotation_id, gc->rot / 90);
+        glUniformMatrix4fv_thread_cmd(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj);
      }
 }
 
@@ -678,7 +716,7 @@ evas_gl_common_context_new(void)
         gc->pipe[i].shader.render_op = EVAS_RENDER_BLEND;
         if (glsym_glMapBuffer && glsym_glUnmapBuffer)
           {
-             glGenBuffers(1, &gc->pipe[i].array.buffer);
+             glGenBuffers_thread_cmd(1, &gc->pipe[i].array.buffer);
              gc->pipe[i].array.buffer_alloc = 0;
              gc->pipe[i].array.buffer_use = 0;
           }
@@ -689,7 +727,7 @@ evas_gl_common_context_new(void)
         const char *ext;
 
         shared = calloc(1, sizeof(Evas_GL_Shared));
-        ext = (const char *) glGetString(GL_EXTENSIONS);
+        ext = (const char *) glGetString_thread_cmd(GL_EXTENSIONS);
         if (ext)
           {
              if (getenv("EVAS_GL_INFO"))
@@ -717,7 +755,7 @@ evas_gl_common_context_new(void)
 
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
              if ((strstr(ext, "GL_EXT_texture_filter_anisotropic")))
-               glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
+               glGetFloatv_thread_cmd(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
                            &(shared->info.anisotropic));
 #endif
 #ifdef GL_BGRA
@@ -763,9 +801,9 @@ evas_gl_common_context_new(void)
                   glsym_glEndTiling = NULL;
                }
           }
-        glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
+        glGetIntegerv_thread_cmd(GL_MAX_TEXTURE_IMAGE_UNITS,
                       &(shared->info.max_texture_units));
-        glGetIntegerv(GL_MAX_TEXTURE_SIZE,
+        glGetIntegerv_thread_cmd(GL_MAX_TEXTURE_SIZE,
                       &(shared->info.max_texture_size));
         shared->info.max_vertex_elements = 6 * 100000;
 #ifdef GL_MAX_ELEMENTS_VERTICES
@@ -790,7 +828,7 @@ evas_gl_common_context_new(void)
         shared->info.tune.atlas.max_memcpy_size      = DEF_ATLAS_MEMCPY;
 
         // per gpu hacks. based on impirical measurement of some known gpu's
-        s = (const char *)glGetString(GL_RENDERER);
+        s = (const char *)glGetString_thread_cmd(GL_RENDERER);
         if (s)
           {
              if      (strstr(s, "PowerVR SGX 540"))
@@ -836,14 +874,14 @@ evas_gl_common_context_new(void)
         // Detect ECT2 support. We need both RGB and RGBA formats.
           {
              GLint texFormatCnt = 0;
-             glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &texFormatCnt);
+             glGetIntegerv_thread_cmd(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &texFormatCnt);
              if (texFormatCnt > 0)
                {
                   GLenum *texFormats = malloc(texFormatCnt * sizeof(GLenum));
                   if (texFormats)
                     {
                        int k, cnt = 0;
-                       glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, (GLint *) texFormats);
+                       glGetIntegerv_thread_cmd(GL_COMPRESSED_TEXTURE_FORMATS, (GLint *) texFormats);
                        for (k = 0; k < texFormatCnt && cnt < 2; k++)
                          {
                             if (texFormats[k] == GL_COMPRESSED_RGB8_ETC2)
@@ -917,32 +955,32 @@ evas_gl_common_context_new(void)
                    (int)shared->info.tune.atlas.max_memcpy_size
                   );
 
-        glDisable(GL_DEPTH_TEST);
-        glEnable(GL_DITHER);
-        glDisable(GL_BLEND);
-        glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+        glDisable_thread_cmd(GL_DEPTH_TEST);
+        glEnable_thread_cmd(GL_DITHER);
+        glDisable_thread_cmd(GL_BLEND);
+        glBlendFunc_thread_cmd(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
         // no dest alpha
 //        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
 //        glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
-        glDepthMask(GL_FALSE);
+        glDepthMask_thread_cmd(GL_FALSE);
 
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-        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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+        glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
         if (shared->info.anisotropic > 0.0)
-          glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
+          glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
 #endif
 
-        glEnableVertexAttribArray(SHAD_VERTEX);
-        glEnableVertexAttribArray(SHAD_COLOR);
+        glEnableVertexAttribArray_thread_cmd(SHAD_VERTEX);
+        glEnableVertexAttribArray_thread_cmd(SHAD_COLOR);
 
         if (!evas_gl_common_shader_program_init(shared))
           goto error;
 
          if (gc->state.current.prog)
-          glUseProgram(gc->state.current.prog->prog);
+          glUseProgram_thread_cmd(gc->state.current.prog->prog);
 
         // in shader:
         // uniform sampler2D tex[8];
@@ -960,7 +998,7 @@ evas_gl_common_context_new(void)
      }
    gc->shared = shared;
    gc->shared->references++;
-   _evas_gl_common_viewport_set(gc,1);
+   _evas_gl_common_viewport_set(gc, 0, 1);
 
    gc->def_surface = evas_gl_common_image_surface_new(gc, 1, 1, 1, EINA_FALSE);
 
@@ -991,7 +1029,7 @@ evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
    if (glsym_glMapBuffer && glsym_glUnmapBuffer)
      {
         for (i = 0; i < MAX_PIPES; i++)
-          glDeleteBuffers(1, &gc->pipe[i].array.buffer);
+          glDeleteBuffers_thread_cmd(1, &gc->pipe[i].array.buffer);
      }
 
    if (gc->shared)
@@ -1057,7 +1095,7 @@ evas_gl_common_context_use(Evas_Engine_GL_Context *gc)
 {
    if (_evas_gl_common_context == gc) return;
    _evas_gl_common_context = gc;
-   if (gc) _evas_gl_common_viewport_set(gc,0);
+   if (gc) _evas_gl_common_viewport_set(gc, 0, 0);
 }
 
 EAPI void
@@ -1097,6 +1135,10 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
 
    for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
      {
+        gc->pipe[i].viewport.foc = 0;
+        gc->pipe[i].viewport.z0 = 0;
+        gc->pipe[i].viewport.px = 0;
+        gc->pipe[i].viewport.py = 0;
         gc->pipe[i].region.x = 0;
         gc->pipe[i].region.y = 0;
         gc->pipe[i].region.w = 0;
@@ -1124,38 +1166,37 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
         gc->pipe[i].shader.cw = 0;
         gc->pipe[i].shader.ch = 0;
      }
-   gc->change.size = 1;
 
-   glDisable(GL_SCISSOR_TEST);
-   glScissor(0, 0, 0, 0);
+   glDisable_thread_cmd(GL_SCISSOR_TEST);
+   glScissor_thread_cmd(0, 0, 0, 0);
 
-   glDisable(GL_DEPTH_TEST);
-   glEnable(GL_DITHER);
-   glDisable(GL_BLEND);
-   glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+   glDisable_thread_cmd(GL_DEPTH_TEST);
+   glEnable_thread_cmd(GL_DITHER);
+   glDisable_thread_cmd(GL_BLEND);
+   glBlendFunc_thread_cmd(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    // no dest alpha
 //   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
 //   glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
-   glDepthMask(GL_FALSE);
+   glDepthMask_thread_cmd(GL_FALSE);
 
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
    if (shared->info.anisotropic > 0.0)
-     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
+     glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
 #endif
 
-   glEnableVertexAttribArray(SHAD_VERTEX);
-   glEnableVertexAttribArray(SHAD_COLOR);
+   glEnableVertexAttribArray_thread_cmd(SHAD_VERTEX);
+   glEnableVertexAttribArray_thread_cmd(SHAD_COLOR);
    if (gc->state.current.prog != PRG_INVALID)
-     glUseProgram(gc->state.current.prog->prog);
+     glUseProgram_thread_cmd(gc->state.current.prog->prog);
 
-   glActiveTexture(GL_TEXTURE0);
+   glActiveTexture_thread_cmd(GL_TEXTURE0);
    evas_gl_common_texture_shared_back(gc, NULL);
 
-   _evas_gl_common_viewport_set(gc,1);
+   _evas_gl_common_viewport_set(gc, 0, 1);
 }
 
 //Tizen Only : when multi window are shown, latest window does not show. so force call glviewport when window resizing occur
@@ -1166,11 +1207,10 @@ evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot,
    if (!gc) return;
    if ((!force_update) && (gc->w == w) && (gc->h == h) && (gc->rot == rot)) return;
    evas_gl_common_context_flush(gc);
-   gc->change.size = 1;
    gc->rot = rot;
    gc->w = w;
    gc->h = h;
-   if (_evas_gl_common_context == gc) _evas_gl_common_viewport_set(gc,1);
+   if (_evas_gl_common_context == gc) _evas_gl_common_viewport_set(gc, 0, 1);
 }
 
 void
@@ -1252,7 +1292,6 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
    gc->state.current.ch = -1;
 
    gc->pipe[0].shader.surface = surface;
-   gc->change.size = 1;
 #ifdef GL_GLES
 # ifndef GL_FRAMEBUFFER
 #  define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
@@ -1266,7 +1305,7 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
      glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
    else
         glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
-   _evas_gl_common_viewport_set(gc,0);
+   _evas_gl_common_viewport_set(gc, 0, 0);
 }
 
 #define VERTEX_CNT 3
@@ -1536,6 +1575,7 @@ _evas_gl_common_context_push(Shader_Type rtype,
                              Evas_GL_Texture *tex,
                              Evas_GL_Texture *texm,
                              Evas_GL_Program *prog,
+                             int foc, int z0, int px, int py,
                              int x, int y, int w, int h,
                              Eina_Bool blend,
                              Eina_Bool smooth,
@@ -1566,6 +1606,10 @@ _evas_gl_common_context_push(Shader_Type rtype,
                  && (!tex || gc->pipe[i].shader.cur_tex == current_tex)
                  && (!texm || ((gc->pipe[i].shader.cur_texm == texm->pt->texture)
                                && (gc->pipe[i].shader.mask_smooth == mask_smooth)))
+                 && (gc->pipe[i].viewport.foc == foc)
+                 && (gc->pipe[i].viewport.z0 == z0)
+                 && (gc->pipe[i].viewport.px == px)
+                 && (gc->pipe[i].viewport.py == py)
                  && (gc->pipe[i].shader.prog == prog)
                  && (gc->pipe[i].shader.smooth == smooth)
                  && (gc->pipe[i].shader.blend == blend)
@@ -1631,6 +1675,11 @@ _evas_gl_common_context_push(Shader_Type rtype,
      }
 #endif
 
+   gc->pipe[pn].viewport.foc = foc;
+   gc->pipe[pn].viewport.z0 = z0;
+   gc->pipe[pn].viewport.px = px;
+   gc->pipe[pn].viewport.py = py;
+
    return pn;
 }
 
@@ -1654,6 +1703,56 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
                                          0, 0, 0, 0, EINA_FALSE, NULL, EINA_FALSE,
                                          mtex, mask_smooth, mw, mh, NULL, NULL, &masksam);
 
+
+#ifdef GLPIPES
+again:
+   vertex_array_size_check(gc, gc->state.top_pipe, 2);
+   pn = gc->state.top_pipe;
+
+   if ((pn != 0) || (gc->pipe[pn].array.num != 0))
+   {
+       pn = gc->state.top_pipe + 1;
+       if (pn >= gc->shared->info.tune.pipes.max)
+         {
+            shader_array_flush(gc);
+            goto again;
+         }
+   }
+   gc->state.top_pipe = pn;
+
+   gc->pipe[pn].region.type = SHD_LINE;
+   gc->pipe[pn].shader.prog = prog;
+   gc->pipe[pn].shader.cur_tex = 0;
+   gc->pipe[pn].shader.cur_texm = mtexid;
+   gc->pipe[pn].shader.blend = blend;
+   gc->pipe[pn].shader.render_op = gc->dc->render_op;
+   gc->pipe[pn].shader.clip = clip;
+   gc->pipe[pn].shader.cx = cx;
+   gc->pipe[pn].shader.cy = cy;
+   gc->pipe[pn].shader.cw = cw;
+   gc->pipe[pn].shader.ch = ch;
+   gc->pipe[pn].shader.mask_smooth = mask_smooth;
+
+   gc->pipe[pn].array.line = 1;
+   gc->pipe[pn].array.anti_alias = gc->dc->anti_alias;
+   gc->pipe[pn].array.use_vertex = 1;
+   gc->pipe[pn].array.use_color = 1;
+   gc->pipe[pn].array.use_texuv = 0;
+   gc->pipe[pn].array.use_texuv2 = 0;
+   gc->pipe[pn].array.use_texuv3 = 0;
+   gc->pipe[pn].array.use_texa = 0;
+   gc->pipe[pn].array.use_texsam = 0;
+   gc->pipe[pn].array.use_masksam = (masksam != SHD_SAM11);
+   gc->pipe[pn].array.use_mask = !!mtex;
+
+   PIPE_GROW(gc, pn, 2);
+   PUSH_VERTEX(pn, x1, y1, 0);
+   PUSH_VERTEX(pn, x2, y2, 0);
+   PUSH_MASK(pn, mtex, mx, my, mw, mh, masksam);
+
+   for (i = 0; i < 2; i++)
+     PUSH_COLOR(pn, r, g, b, a);
+#else
    shader_array_flush(gc);
    vertex_array_size_check(gc, gc->state.top_pipe, 2);
    pn = gc->state.top_pipe;
@@ -1703,6 +1802,8 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
    gc->pipe[pn].array.use_texsam = 0;
    gc->pipe[pn].array.use_masksam = 0;
    gc->pipe[pn].array.use_mask = 0;
+#endif
+
 }
 
 void
@@ -2030,6 +2131,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_IMAGE,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
@@ -2362,6 +2464,7 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_FONT,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      1,
                                      0,
@@ -2441,6 +2544,7 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_YUV,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
@@ -2520,6 +2624,7 @@ evas_gl_common_context_yuv_709_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_YUV_709,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
@@ -2599,6 +2704,7 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_YUY2,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
@@ -2676,6 +2782,7 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_NV12,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
@@ -2763,6 +2870,7 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
    pn = _evas_gl_common_context_push(SHD_RGB_A_PAIR,
                                      gc, tex, mtex,
                                      prog,
+                                     0, 0, 0, 0,
                                      x, y, w, h,
                                      EINA_TRUE,
                                      smooth,
@@ -2942,24 +3050,26 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
      }
 
    if (!flat)
-     {
-        shader_array_flush(gc);
-        gc->foc = p[0].foc >> FP;
-        gc->z0 = p[0].z0 >> FP;
-        gc->px = p[0].px >> FP;
-        gc->py = p[0].py >> FP;
-        gc->change.size = 1;
-        _evas_gl_common_viewport_set(gc,0);
-     }
-
    pn = _evas_gl_common_context_push(SHD_MAP,
                                      gc, tex, mtex,
                                      prog,
+                                       p[0].foc >> FP, p[0].z0 >> FP, p[0].px >> FP, p[0].py >> FP,
+                                       x, y, w, h,
+                                       blend,
+                                       smooth,
+                                       clip, cx, cy, cw, ch,
+                                       mask_smooth);
+   else
+     pn = _evas_gl_common_context_push(SHD_MAP,
+                                       gc, tex, mtex,
+                                       prog,
+                                       0, 0, 0, 0,
                                      x, y, w, h,
                                      blend,
                                      smooth,
                                      clip, cx, cy, cw, ch,
                                      mask_smooth);
+
    gc->pipe[pn].region.type = SHD_MAP;
    gc->pipe[pn].shader.prog = prog;
    gc->pipe[pn].shader.cur_tex = tex->pt->texture;
@@ -3030,11 +3140,33 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
           }
         else
           {
+             int w, h, rot, m = 1;
+             int vx, vy, vw, vh, ax, ay;
+
+             if ((gc->pipe[0].shader.surface == gc->def_surface) ||
+                 (!gc->pipe[0].shader.surface))
+               {
+                  w = gc->w;
+                  h = gc->h;
+                  rot = gc->rot;
+               }
+             else
+               {
+                  w = gc->pipe[0].shader.surface->w;
+                  h = gc->pipe[0].shader.surface->h;
+                  rot = 0;
+                  m = -1;
+               }
+
+             _calculate_foc(rot, m, w, h, gc->pipe[pn].viewport.px, gc->pipe[pn].viewport.py,
+                            &vx, &vy, &vw, &vh, &ax, &ay);
+
              PUSH_VERTEX(pn,
-                         (p[points[i]].fx) + gc->shared->ax,
-                         (p[points[i]].fy) + gc->shared->ay,
+                         (p[points[i]].fx) + ax,
+                         (p[points[i]].fy) + ay,
                          (p[points[i]].fz)
-                         + (gc->shared->foc - gc->shared->z0));
+                         + (gc->pipe[pn].viewport.foc - gc->pipe[pn].viewport.z0));
+
           }
         PUSH_TEXUV(pn,
                    tx[points[i]],
@@ -3066,17 +3198,6 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
      }
 
    PUSH_MASK(pn, mtex, mx, my, mw, mh, masksam);
-
-   if (!flat || tex->pt->dyn.img)
-     {
-        shader_array_flush(gc);
-        gc->foc = 0;
-        gc->z0 = 0;
-        gc->px = 0;
-        gc->py = 0;
-        gc->change.size = 1;
-        _evas_gl_common_viewport_set(gc,0);
-     }
 }
 
 EAPI void
@@ -3092,19 +3213,19 @@ scissor_rot(Evas_Engine_GL_Context *gc EINA_UNUSED,
    switch (rot)
      {
       case 0: // UP this way: ^
-        glScissor(cx, cy, cw, ch);
+        glScissor_thread_cmd(cx, cy, cw, ch);
         break;
       case 90: // UP this way: <
-        glScissor(gh - (cy + ch), cx, ch, cw);
+        glScissor_thread_cmd(gh - (cy + ch), cx, ch, cw);
         break;
       case 180: // UP this way: v
-        glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
+        glScissor_thread_cmd(gw - (cx + cw), gh - (cy + ch), cw, ch);
         break;
       case 270: // UP this way: >
-        glScissor(cy, gw - (cx + cw), ch, cw);
+        glScissor_thread_cmd(cy, gw - (cx + cw), ch, cw);
         break;
       default: // assume up is up
-        glScissor(cx, cy, cw, ch);
+        glScissor_thread_cmd(cx, cy, cw, ch);
         break;
      }
 }
@@ -3137,7 +3258,7 @@ start_tiling(Evas_Engine_GL_Context *gc EINA_UNUSED,
 }
 
 static void
-shader_array_flush(Evas_Engine_GL_Context *gc)
+_orig_shader_array_flush(Evas_Engine_GL_Context *gc)
 {
    int i, gw, gh;
    unsigned int pipe_done = 0;  //count pipe iteration for debugging
@@ -3159,6 +3280,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
         Evas_GL_Program *prog;
         if (gc->pipe[i].array.num <= 0) break;
 
+        _evas_gl_common_viewport_set(gc, i, 0);
+
         prog = gc->pipe[i].shader.prog;
         setclip = EINA_FALSE;
         pipe_done++;
@@ -3167,11 +3290,11 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
         GLERRV("<flush err>");
         if (prog && (prog != gc->state.current.prog))
           {
-             glUseProgram(prog->prog);
+             glUseProgram_thread_cmd(prog->prog);
              if (prog->reset)
                {
-                  glUniform1i(prog->uniform.rotation_id, gc->rot / 90);
-                  glUniformMatrix4fv(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj);
+                  glUniform1i_thread_cmd(prog->uniform.rotation_id, gc->rot / 90);
+                  glUniformMatrix4fv_thread_cmd(prog->uniform.mvp, 1, GL_FALSE, gc->shared->proj);
                   prog->reset = EINA_FALSE;
                }
           }
@@ -3188,7 +3311,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                   glDisable(GL_TEXTURE_2D);
                }
 #endif
-             glActiveTexture(GL_TEXTURE0);
+             glActiveTexture_thread_cmd(GL_TEXTURE0);
              evas_gl_common_texture_shared_specific(gc, NULL, i);
           }
         if (gc->pipe[i].array.im)
@@ -3216,10 +3339,10 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
              switch (gc->pipe[i].shader.render_op)
                {
                 case EVAS_RENDER_BLEND: /**< default op: d = d*(1-sa) + s */
-                  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+                  glBlendFunc_thread_cmd(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
                   break;
                 case EVAS_RENDER_BLEND_REL: /**< d = d*(1 - sa) + s*da */
-                  glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+                  glBlendFunc_thread_cmd(GL_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
                   break;
                 case EVAS_RENDER_COPY: /**< d = s */
                   gc->pipe[i].shader.blend = 0;
@@ -3227,38 +3350,38 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                   //glBlendFunc(GL_ONE, GL_ZERO);
                   break;
                 case EVAS_RENDER_COPY_REL: /**< d = s*da */
-                  glBlendFunc(GL_DST_ALPHA, GL_ZERO);
+                  glBlendFunc_thread_cmd(GL_DST_ALPHA, GL_ZERO);
                   break;
                 case EVAS_RENDER_ADD: /**< d = d + s */
-                  glBlendFunc(GL_ONE, GL_ONE);
+                  glBlendFunc_thread_cmd(GL_ONE, GL_ONE);
                   break;
                 case EVAS_RENDER_ADD_REL: /**< d = d + s*da */
-                  glBlendFunc(GL_DST_ALPHA, GL_ONE);
+                  glBlendFunc_thread_cmd(GL_DST_ALPHA, GL_ONE);
                   break;
                 case EVAS_RENDER_SUB: /**< d = d - s */
-                  glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
+                  glBlendFunc_thread_cmd(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
                   break;
                 case EVAS_RENDER_SUB_REL: /**< d = d - s*da */
-                  glBlendFunc(GL_ZERO, GL_ONE_MINUS_DST_ALPHA);
+                  glBlendFunc_thread_cmd(GL_ZERO, GL_ONE_MINUS_DST_ALPHA);
                   break;
                 case EVAS_RENDER_MASK: /**< d = d*sa */
-                  glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
+                  glBlendFunc_thread_cmd(GL_ZERO, GL_SRC_ALPHA);
                   break;
                   // FIXME: fix blend funcs below!
                 case EVAS_RENDER_TINT: /**< d = d*s + d*(1 - sa) + s*(1 - da) */
                 case EVAS_RENDER_TINT_REL: /**< d = d*(1 - sa + s) */
                 case EVAS_RENDER_MUL: /**< d = d*s */
                 default:
-                  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+                  glBlendFunc_thread_cmd(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
                   break;
                }
           }
         if (gc->pipe[i].shader.blend != gc->state.current.blend)
           {
              if (gc->pipe[i].shader.blend)
-               glEnable(GL_BLEND);
+               glEnable_thread_cmd(GL_BLEND);
              else
-               glDisable(GL_BLEND);
+               glDisable_thread_cmd(GL_BLEND);
           }
         if ((gc->pipe[i].shader.smooth != gc->state.current.smooth) ||
             (gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex))
@@ -3267,23 +3390,23 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                {
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
                   if (shared->info.anisotropic > 0.0)
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
+                    glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
 #endif
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-                  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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
                }
              else
                {
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
                   if (shared->info.anisotropic > 0.0)
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
+                    glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
 #endif
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-                  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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
                }
           }
         if (gc->pipe[i].shader.clip != gc->state.current.clip)
@@ -3337,11 +3460,11 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
              if ((gc->pipe[i].shader.clip) ||
                  ((gc->master_clip.enabled) && (!fbo)))
                {
-                  glEnable(GL_SCISSOR_TEST);
+                  glEnable_thread_cmd(GL_SCISSOR_TEST);
                   if (!fbo)
                     scissor_rot(gc, gc->rot, gw, gh, cx, gh - cy - ch, cw, ch);
                   else
-                     glScissor(cx, cy, cw, ch);
+                     glScissor_thread_cmd(cx, cy, cw, ch);
                   setclip = EINA_TRUE;
                   gc->state.current.cx = cx;
                   gc->state.current.cy = cy;
@@ -3350,8 +3473,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                }
              else
                {
-                  glDisable(GL_SCISSOR_TEST);
-                  glScissor(0, 0, 0, 0);
+                  glDisable_thread_cmd(GL_SCISSOR_TEST);
+                  glScissor_thread_cmd(0, 0, 0, 0);
                   gc->state.current.cx = 0;
                   gc->state.current.cy = 0;
                   gc->state.current.cw = 0;
@@ -3391,7 +3514,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                   if (!fbo)
                     scissor_rot(gc, gc->rot, gw, gh, cx, gh - cy - ch, cw, ch);
                   else
-                    glScissor(cx, cy, cw, ch);
+                    glScissor_thread_cmd(cx, cy, cw, ch);
                   gc->state.current.cx = cx;
                   gc->state.current.cy = cy;
                   gc->state.current.cw = cw;
@@ -3430,11 +3553,11 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
              masksam_ptr = mask_ptr + MASK_SIZE;
 # define END_POINTER (masksam_ptr + SAM_SIZE)
 
-             glBindBuffer(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer);
+             glBindBuffer_thread_cmd(GL_ARRAY_BUFFER, gc->pipe[i].array.buffer);
              if ((gc->pipe[i].array.buffer_alloc < (long)END_POINTER) ||
                  (gc->pipe[i].array.buffer_use >= (ARRAY_BUFFER_USE + ARRAY_BUFFER_USE_SHIFT * i)))
                {
-                  glBufferData(GL_ARRAY_BUFFER, (long)END_POINTER, NULL, GL_STATIC_DRAW);
+                  glBufferData_thread_cmd(GL_ARRAY_BUFFER, (long)END_POINTER, NULL, GL_STATIC_DRAW);
                   gc->pipe[i].array.buffer_alloc = (long)END_POINTER;
                   gc->pipe[i].array.buffer_use = 0;
                }
@@ -3495,171 +3618,171 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
           }
 
         // use_vertex is always true
-        glVertexAttribPointer(SHAD_VERTEX, VERTEX_CNT, GL_SHORT, GL_FALSE, 0, vertex_ptr);
+        glVertexAttribPointer_thread_cmd(SHAD_VERTEX, VERTEX_CNT, GL_SHORT, GL_FALSE, 0, vertex_ptr);
 
         if (gc->pipe[i].array.use_color)
           {
-             glEnableVertexAttribArray(SHAD_COLOR);
-             glVertexAttribPointer(SHAD_COLOR, COLOR_CNT, GL_UNSIGNED_BYTE, GL_TRUE, 0, color_ptr);
+             glEnableVertexAttribArray_thread_cmd(SHAD_COLOR);
+             glVertexAttribPointer_thread_cmd(SHAD_COLOR, COLOR_CNT, GL_UNSIGNED_BYTE, GL_TRUE, 0, color_ptr);
           }
         else
-          glDisableVertexAttribArray(SHAD_COLOR);
+          glDisableVertexAttribArray_thread_cmd(SHAD_COLOR);
 
         if (gc->pipe[i].array.line)
           {
              if (gc->pipe[i].array.anti_alias)
                {
-                  glEnable(GL_BLEND);
-                  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-                  glHint(GL_LINE_SMOOTH, GL_NICEST);
-                  glEnable(GL_LINE_SMOOTH);
+                  glEnable_thread_cmd(GL_BLEND);
+                  glBlendFunc_thread_cmd(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+                  glHint_thread_cmd(GL_LINE_SMOOTH, GL_NICEST);
+                  glEnable_thread_cmd(GL_LINE_SMOOTH);
                }
              else
                {
-                  glDisable(GL_LINE_SMOOTH);
+                  glDisable_thread_cmd(GL_LINE_SMOOTH);
                }
 
-             glDisableVertexAttribArray(SHAD_TEXUV);
-             glDisableVertexAttribArray(SHAD_TEXUV2);
-             glDisableVertexAttribArray(SHAD_TEXUV3);
-             glDisableVertexAttribArray(SHAD_TEXA);
-             glDisableVertexAttribArray(SHAD_TEXSAM);
+             glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV);
+             glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV2);
+             glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV3);
+             glDisableVertexAttribArray_thread_cmd(SHAD_TEXA);
+             glDisableVertexAttribArray_thread_cmd(SHAD_TEXSAM);
 
              /* kopi pasta from below */
              if (gc->pipe[i].array.use_mask)
                {
-                  glEnableVertexAttribArray(SHAD_MASK);
-                  glVertexAttribPointer(SHAD_MASK, MASK_CNT, GL_FLOAT, GL_FALSE, 0, mask_ptr);
-                  glActiveTexture(MASK_TEXTURE);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_MASK);
+                  glVertexAttribPointer_thread_cmd(SHAD_MASK, MASK_CNT, GL_FLOAT, GL_FALSE, 0, mask_ptr);
+                  glActiveTexture_thread_cmd(MASK_TEXTURE);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
                   if (shared->info.anisotropic > 0.0)
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
+                    glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
 #endif
                   if (gc->pipe[i].shader.mask_smooth)
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                     }
                   else
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                     }
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-                  glActiveTexture(GL_TEXTURE0);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0);
 
                   if (gc->pipe[i].array.use_masksam)
                     {
-                       glEnableVertexAttribArray(SHAD_MASKSAM);
-                       glVertexAttribPointer(SHAD_MASKSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, masksam_ptr);
+                       glEnableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
+                       glVertexAttribPointer_thread_cmd(SHAD_MASKSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, masksam_ptr);
                     }
-                  else glDisableVertexAttribArray(SHAD_MASKSAM);
+                  else glDisableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_MASK);
-                  glDisableVertexAttribArray(SHAD_MASKSAM);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_MASK);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
                }
 
-             glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
+             glDrawArrays_thread_cmd(GL_LINES, 0, gc->pipe[i].array.num);
           }
         else
           {
              if (gc->pipe[i].array.use_texuv)
                {
-                  glEnableVertexAttribArray(SHAD_TEXUV);
-                  glVertexAttribPointer(SHAD_TEXUV, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv_ptr);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXUV);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXUV, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv_ptr);
 
                   MASK_TEXTURE += 1;
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_TEXUV);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV);
                }
 
              /* Alpha plane */
              if (gc->pipe[i].array.use_texa)
                {
-                  glEnableVertexAttribArray(SHAD_TEXA);
-                  glVertexAttribPointer(SHAD_TEXA, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texa_ptr);
-                  glActiveTexture(GL_TEXTURE1);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texa);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXA);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXA, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texa_ptr);
+                  glActiveTexture_thread_cmd(GL_TEXTURE1);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texa);
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
                   if (shared->info.anisotropic > 0.0)
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
+                    glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
 #endif
                   if (gc->pipe[i].shader.smooth)
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                     }
                   else
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                     }
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-                  glActiveTexture(GL_TEXTURE0);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0);
 
                   MASK_TEXTURE += 1;
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_TEXA);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXA);
                }
 
              if (gc->pipe[i].array.use_texsam)
                {
-                  glEnableVertexAttribArray(SHAD_TEXSAM);
-                  glVertexAttribPointer(SHAD_TEXSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, texsam_ptr);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXSAM);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, texsam_ptr);
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_TEXSAM);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXSAM);
                }
 
              if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
                {
-                  glEnableVertexAttribArray(SHAD_TEXUV2);
-                  glEnableVertexAttribArray(SHAD_TEXUV3);
-                  glVertexAttribPointer(SHAD_TEXUV2, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv2_ptr);
-                  glVertexAttribPointer(SHAD_TEXUV3, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv3_ptr);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXUV2);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXUV3);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXUV2, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv2_ptr);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXUV3, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv3_ptr);
 
-                  glActiveTexture(GL_TEXTURE1);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
+                  glActiveTexture_thread_cmd(GL_TEXTURE1);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
 #ifdef GL_GLES
                   if (gc->pipe[i].shader.cur_texu_dyn)
                     secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
 #endif
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-                  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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
-                  glActiveTexture(GL_TEXTURE2);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
+                  glActiveTexture_thread_cmd(GL_TEXTURE2);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
 #ifdef GL_GLES
                   if (gc->pipe[i].shader.cur_texv_dyn)
                     secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
 #endif
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-                  glActiveTexture(GL_TEXTURE0);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0);
 
                   MASK_TEXTURE += 2;
                }
              else if (gc->pipe[i].array.use_texuv2)
                {
-                  glEnableVertexAttribArray(SHAD_TEXUV2);
-                  glVertexAttribPointer(SHAD_TEXUV2, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv2_ptr);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_TEXUV2);
+                  glVertexAttribPointer_thread_cmd(SHAD_TEXUV2, TEX_CNT, GL_FLOAT, GL_FALSE, 0, texuv2_ptr);
 
-                  glActiveTexture(GL_TEXTURE1);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
+                  glActiveTexture_thread_cmd(GL_TEXTURE1);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
 #ifdef GL_GLES
                   if (gc->pipe[i].shader.cur_texu_dyn)
                     secsym_glEGLImageTargetTexture2DOES
@@ -3667,65 +3790,65 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
 #endif
                   if (gc->pipe[i].shader.smooth)
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-                       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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
                     }
                   else
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-                       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_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
                     }
-                  glActiveTexture(GL_TEXTURE0);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0);
 
-                  glDisableVertexAttribArray(SHAD_TEXUV3);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV3);
                   MASK_TEXTURE += 1;
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_TEXUV2);
-                  glDisableVertexAttribArray(SHAD_TEXUV3);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV2);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_TEXUV3);
                }
 
              /* Mask surface */
              if (gc->pipe[i].array.use_mask)
                {
-                  glEnableVertexAttribArray(SHAD_MASK);
-                  glVertexAttribPointer(SHAD_MASK, MASK_CNT, GL_FLOAT, GL_FALSE, 0, mask_ptr);
-                  glActiveTexture(MASK_TEXTURE);
-                  glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
+                  glEnableVertexAttribArray_thread_cmd(SHAD_MASK);
+                  glVertexAttribPointer_thread_cmd(SHAD_MASK, MASK_CNT, GL_FLOAT, GL_FALSE, 0, mask_ptr);
+                  glActiveTexture_thread_cmd(MASK_TEXTURE);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
                   if (shared->info.anisotropic > 0.0)
-                    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
+                    glTexParameterf_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
 #endif
                   if (gc->pipe[i].shader.mask_smooth)
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                     }
                   else
                     {
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+                       glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                     }
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-                  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-                  glActiveTexture(GL_TEXTURE0);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+                  glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+                  glActiveTexture_thread_cmd(GL_TEXTURE0);
 
                   if (gc->pipe[i].array.use_masksam)
                     {
-                       glEnableVertexAttribArray(SHAD_MASKSAM);
-                       glVertexAttribPointer(SHAD_MASKSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, masksam_ptr);
+                       glEnableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
+                       glVertexAttribPointer_thread_cmd(SHAD_MASKSAM, SAM_CNT, GL_FLOAT, GL_FALSE, 0, masksam_ptr);
                     }
-                  else glDisableVertexAttribArray(SHAD_MASKSAM);
+                  else glDisableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
                }
              else
                {
-                  glDisableVertexAttribArray(SHAD_MASK);
-                  glDisableVertexAttribArray(SHAD_MASKSAM);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_MASK);
+                  glDisableVertexAttribArray_thread_cmd(SHAD_MASKSAM);
                }
 
              if (dbgflushnum == 1)
@@ -3743,7 +3866,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
                          types[gc->pipe[i].region.type]
                          );
                }
-             glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
+             glDrawArrays_thread_cmd(GL_TRIANGLES, 0, gc->pipe[i].array.num);
           }
         if (gc->pipe[i].array.im)
           {
@@ -3773,6 +3896,14 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
         gc->state.current.clip      = gc->pipe[i].shader.clip;
         gc->state.current.anti_alias = gc->pipe[i].array.anti_alias;
 
+        if (glsym_glMapBuffer && glsym_glUnmapBuffer)
+          {
+             glBindBuffer_thread_cmd(GL_ARRAY_BUFFER, 0);
+          }
+     }
+
+   for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
+     {
         if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
         if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
         if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
@@ -3807,17 +3938,16 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
 
         gc->pipe[i].array.num = 0;
         gc->pipe[i].array.alloc = 0;
-
-        if (glsym_glMapBuffer && glsym_glUnmapBuffer)
-          {
-             glBindBuffer(GL_ARRAY_BUFFER, 0);
-          }
-
         gc->pipe[i].region.x = 0;
         gc->pipe[i].region.y = 0;
         gc->pipe[i].region.w = 0;
         gc->pipe[i].region.h = 0;
         gc->pipe[i].region.type = 0;
+
+        gc->pipe[i].viewport.foc = 0;
+        gc->pipe[i].viewport.z0 = 0;
+        gc->pipe[i].viewport.px = 0;
+        gc->pipe[i].viewport.py = 0;
      }
    gc->state.top_pipe = 0;
    if (dbgflushnum == 1)
@@ -3827,6 +3957,41 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
    gc->havestuff = EINA_FALSE;
 }
 
+typedef struct
+{
+   Evas_Engine_GL_Context *gc;
+} Evas_Thread_Command_shader_array_flush;
+
+static void
+_gl_thread_shader_array_flush(void *data)
+{
+   Evas_Thread_Command_shader_array_flush *thread_param =
+      (Evas_Thread_Command_shader_array_flush *)data;
+    evas_gl_thread_begin();
+    _orig_shader_array_flush(thread_param->gc);
+    evas_gl_thread_end();
+}
+
+static void
+shader_array_flush(Evas_Engine_GL_Context *gc)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        _orig_shader_array_flush(gc);
+        return;
+     }
+
+   Evas_Thread_Command_shader_array_flush thread_param_local;
+   Evas_Thread_Command_shader_array_flush *thread_param = &thread_param_local;
+   thread_param->gc = gc;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_shader_array_flush,
+                              thread_param,
+                              EVAS_GL_THREAD_MODE_FINISH);
+
+}
+
 EAPI int
 evas_gl_common_buffer_dump(Evas_Engine_GL_Context *gc, const char* dname, const char* buf_name, int frame, const char *suffix)
 {
@@ -3846,7 +4011,7 @@ evas_gl_common_buffer_dump(Evas_Engine_GL_Context *gc, const char* dname, const
 
    if ((!data1) || (!data2)) goto finish;
 
-   glReadPixels(0, 0, gc->w, gc->h, GL_RGBA,
+   glReadPixels_thread_cmd(0, 0, gc->w, gc->h, GL_RGBA,
                 GL_UNSIGNED_BYTE, (unsigned char*)data1);
 
    // Flip the Y and change from RGBA TO BGRA
@@ -3905,12 +4070,16 @@ evas_gl_common_module_open(void)
         EINA_LOG_ERR("Can not create a module log domain.");
         return EINA_FALSE;
      }
+   evas_gl_thread_init();
+
    return EINA_TRUE;
 }
 
 void
 evas_gl_common_module_close(void)
 {
+   evas_gl_thread_terminate();
+
    if (_evas_engine_GL_common_log_dom < 0) return;
    eina_log_domain_unregister(_evas_engine_GL_common_log_dom);
    _evas_engine_GL_common_log_dom = -1;
index e6bbc3e..8391d31 100644 (file)
@@ -170,13 +170,31 @@ _internal_resource_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context
    if (!surface)
      {
         // Set the surface to evas surface if it's there
-        if (rsc->id == evgl_engine->main_tid)
+        // But this reusing mechanism is only available at the single thread model like direct rendering.
+        // So avoid it when evasgl thread rendering is used.
+        if (rsc->id == evgl_engine->main_tid && !evas_gl_thread_enabled())
            rsc->direct.surface = evgl_engine->funcs->evas_surface_get(eng_data);
 
         if (rsc->direct.surface)
            surface = (void*)rsc->direct.surface;
         else
           {
+             if (!rsc->surface)
+               {
+                  // Only need a 'dummy' surface to make current with the evasgl context.
+                  if (evgl_engine->funcs->pbuffer_surface_create)
+                    {
+                       // Now recommended a smallest (1x1) pbuffer surface instead of a window surface.
+                       // But in the future, EGL_KHR_SURFACELESS_CONTEXT can be used.
+                       EVGL_Surface sfc_attrib;
+                       memset(&sfc_attrib, 0x00, sizeof(EVGL_Surface));
+                       sfc_attrib.w = 1;
+                       sfc_attrib.h = 1;
+                       rsc->surface = evgl_engine->funcs->pbuffer_surface_create(eng_data, &sfc_attrib, NULL);
+                    }
+                  else
+                    {
+                       // If the engine doesn't support pbuffer, create a dummy window surface.
              if (!rsc->window)
                {
                   // Create resource surface
@@ -187,12 +205,11 @@ _internal_resource_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context
                        return 0;
                     }
                }
+                       rsc->surface = evgl_engine->funcs->surface_create(eng_data, rsc->window);
+                    }
 
              if (!rsc->surface)
                {
-                  rsc->surface = evgl_engine->funcs->surface_create(eng_data, rsc->window);
-                  if (!rsc->surface)
-                    {
                        ERR("Error creating native surface");
                        return 0;
                     }
@@ -225,7 +242,7 @@ _internal_resource_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context
 static void
 _texture_create(GLuint *tex)
 {
-   glGenTextures(1, tex);
+   glGenTextures_evgl_thread_cmd(1, tex);
 }
 
 // Create and allocate 2D texture
@@ -234,13 +251,13 @@ _texture_allocate_2d(GLuint tex, GLint ifmt, GLenum fmt, GLenum type, int w, int
 {
    //if (!(*tex))
    //   glGenTextures(1, 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_evgl_thread_cmd(GL_TEXTURE_2D, tex);
+   glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_evgl_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexImage2D_evgl_thread_cmd(GL_TEXTURE_2D, 0, ifmt, w, h, 0, fmt, type, NULL);
+   glBindTexture_evgl_thread_cmd(GL_TEXTURE_2D, 0);
 }
 
 // Destroy Texture
@@ -249,7 +266,7 @@ _texture_destroy(GLuint *tex)
 {
    if (*tex)
      {
-        glDeleteTextures(1, tex);
+        glDeleteTextures_evgl_thread_cmd(1, tex);
         *tex = 0;
      }
 }
@@ -288,10 +305,10 @@ _texture_attach_2d(GLuint tex, GLenum attach, GLenum attach2, int samples, Evas_
      }
    else
      {
-        glFramebufferTexture2D(GL_FRAMEBUFFER, attach, GL_TEXTURE_2D, tex, 0);
+        glFramebufferTexture2D_evgl_thread_cmd(GL_FRAMEBUFFER, attach, GL_TEXTURE_2D, tex, 0);
 
         if (attach2)
-           glFramebufferTexture2D(GL_FRAMEBUFFER, attach2, GL_TEXTURE_2D, tex, 0);
+           glFramebufferTexture2D_evgl_thread_cmd(GL_FRAMEBUFFER, attach2, GL_TEXTURE_2D, tex, 0);
 
      }
 }
@@ -364,7 +381,7 @@ _framebuffer_create(GLuint *buf, Evas_GL_Context_Version version)
      }
    else
      {
-        glGenFramebuffers(1, buf);
+        glGenFramebuffers_evgl_thread_cmd(1, buf);
      }
 }
 
@@ -378,7 +395,7 @@ _framebuffer_bind(GLuint buf, Evas_GL_Context_Version version)
      }
    else
      {
-        glBindFramebuffer(GL_FRAMEBUFFER, buf);
+        glBindFramebuffer_evgl_thread_cmd(GL_FRAMEBUFFER, buf);
      }
 }
 
@@ -386,7 +403,7 @@ static void
 _framebuffer_draw_bind(GLuint buf, Evas_GL_Context_Version version)
 {
    if (version == EVAS_GL_GLES_3_X)
-     glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buf);
+     glBindFramebuffer_evgl_thread_cmd(GL_DRAW_FRAMEBUFFER, buf);
 }
 
 //This function is not needed in EvasGL backend engine with GLES 2.0.
@@ -395,7 +412,7 @@ static void
 _framebuffer_read_bind(GLuint buf, Evas_GL_Context_Version version)
 {
    if (version == EVAS_GL_GLES_3_X)
-     glBindFramebuffer(GL_READ_FRAMEBUFFER, buf);
+     glBindFramebuffer_evgl_thread_cmd(GL_READ_FRAMEBUFFER, buf);
 }
 
 static GLenum
@@ -409,7 +426,7 @@ _framebuffer_check(Evas_GL_Context_Version version)
      }
    else
      {
-        ret = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+        ret = glCheckFramebufferStatus_evgl_thread_cmd(GL_FRAMEBUFFER);
      }
    return ret;
 }
@@ -418,7 +435,7 @@ _framebuffer_check(Evas_GL_Context_Version version)
 static void
 _renderbuffer_create(GLuint *buf)
 {
-   glGenRenderbuffers(1, buf);
+   glGenRenderbuffers_evgl_thread_cmd(1, buf);
 }
 
 
@@ -426,7 +443,7 @@ _renderbuffer_create(GLuint *buf)
 static void
 _renderbuffer_allocate(GLuint buf, GLenum fmt, int w, int h, int samples)
 {
-   glBindRenderbuffer(GL_RENDERBUFFER, buf);
+   glBindRenderbuffer_evgl_thread_cmd(GL_RENDERBUFFER, buf);
    if (samples)
 #ifdef GL_GLES
       EXT_FUNC(glRenderbufferStorageMultisample)(GL_RENDERBUFFER, samples, fmt, w, h);
@@ -434,8 +451,8 @@ _renderbuffer_allocate(GLuint buf, GLenum fmt, int w, int h, int samples)
       ERR("MSAA not supported.  Should not have come in here...!");
 #endif
    else
-      glRenderbufferStorage(GL_RENDERBUFFER, fmt, w, h);
-   glBindRenderbuffer(GL_RENDERBUFFER, 0);
+      glRenderbufferStorage_evgl_thread_cmd(GL_RENDERBUFFER, fmt, w, h);
+   glBindRenderbuffer_evgl_thread_cmd(GL_RENDERBUFFER, 0);
 
    return;
    samples = 0;
@@ -446,7 +463,7 @@ _renderbuffer_destroy(GLuint *buf)
 {
    if (*buf)
      {
-        glDeleteRenderbuffers(1, buf);
+        glDeleteRenderbuffers_evgl_thread_cmd(1, buf);
         *buf = 0;
      }
 }
@@ -462,7 +479,7 @@ _renderbuffer_attach(GLuint buf, GLenum attach, Evas_GL_Context_Version version)
      }
    else
      {
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, attach, GL_RENDERBUFFER, buf);
+        glFramebufferRenderbuffer_evgl_thread_cmd(GL_FRAMEBUFFER, attach, GL_RENDERBUFFER, buf);
      }
 }
 
@@ -482,8 +499,8 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
    int w = 2, h = 2;   // Test it with a simple (2,2) surface.  Should I test it with NPOT?
 
    // Gen FBO
-   glGenFramebuffers(1, &fbo);
-   glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+   glGenFramebuffers_evgl_thread_cmd(1, &fbo);
+   glBindFramebuffer_evgl_thread_cmd(GL_FRAMEBUFFER, fbo);
 
    // Color Buffer Texture
    if ((color_ifmt) && (color_fmt))
@@ -531,7 +548,7 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
      }
 
    // Check FBO for completeness
-   fb_status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+   fb_status = glCheckFramebufferStatus_evgl_thread_cmd(GL_FRAMEBUFFER);
 
    // Delete Created Resources
    _texture_destroy(&color_buf);
@@ -544,16 +561,16 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
 #endif
 
    // Delete FBO
-   glBindFramebuffer(GL_FRAMEBUFFER, 0);
-   if (fbo) glDeleteFramebuffers(1, &fbo);
+   glBindFramebuffer_evgl_thread_cmd(GL_FRAMEBUFFER, 0);
+   if (fbo) glDeleteFramebuffers_evgl_thread_cmd(1, &fbo);
 
    // Return the result
    if (fb_status != GL_FRAMEBUFFER_COMPLETE)
      {
-        int err = glGetError();
+        int err = glGetError_evgl_thread_cmd();
 
         if (err != GL_NO_ERROR)
-           DBG("glGetError() returns %x ", err);
+           DBG("glGetError_evgl_thread_cmd() returns %x ", err);
 
         return 0;
      }
@@ -879,7 +896,7 @@ _surface_cap_init(void *eng_data)
      }
 
    // Query the max width and height of the surface
-   glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &max_size);
+   glGetIntegerv_evgl_thread_cmd(GL_MAX_RENDERBUFFER_SIZE, &max_size);
 
    evgl_engine->caps.max_w = max_size;
    evgl_engine->caps.max_h = max_size;
@@ -891,11 +908,11 @@ _surface_cap_init(void *eng_data)
 
    if (EXTENSION_SUPPORT(IMG_multisampled_render_to_texture))
      {
-        glGetIntegerv(GL_MAX_SAMPLES_IMG, &max_samples);
+        glGetIntegerv_evgl_thread_cmd(GL_MAX_SAMPLES_IMG, &max_samples);
      }
    else if (EXTENSION_SUPPORT(EXT_multisampled_render_to_texture))
      {
-        glGetIntegerv(GL_MAX_SAMPLES_EXT, &max_samples);
+        glGetIntegerv_evgl_thread_cmd(GL_MAX_SAMPLES_EXT, &max_samples);
      }
 
    if (max_samples >= 2)
@@ -1412,7 +1429,7 @@ try_again:
                   support_win_cfg = EINA_FALSE;
                }
 
-             if ((sfc->direct_override) || support_win_cfg)
+             if ((sfc->direct_override) || (support_win_cfg && !evas_gl_thread_enabled()))
                sfc->direct_fb_opt = !!(cfg->options_bits & EVAS_GL_OPTIONS_DIRECT);
              else if (cfg->options_bits & EVAS_GL_OPTIONS_DIRECT)
                {
@@ -1447,6 +1464,8 @@ try_again:
              sfc->client_side_rotation = !!(cfg->options_bits & EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION);
              sfc->alpha = (cfg->color_format == EVAS_GL_RGBA_8888);
 
+             sfc->thread_rendering = !!(cfg->options_bits & EVAS_GL_OPTIONS_THREAD);
+
              cfg_index = i;
              break;
           }
@@ -1495,6 +1514,7 @@ _evgl_direct_renderable(EVGL_Resource *rsc, EVGL_Surface *sfc)
    if (rsc->id != evgl_engine->main_tid) return 0;
    if (!sfc->direct_fb_opt) return 0;
    if (!rsc->direct.enabled) return 0;
+   if (evas_gl_thread_enabled()) return 0;
 
    return 1;
 }
@@ -1502,6 +1522,7 @@ _evgl_direct_renderable(EVGL_Resource *rsc, EVGL_Surface *sfc)
 //---------------------------------------------------------------//
 // Functions used by Evas GL module
 //---------------------------------------------------------------//
+
 EVGL_Resource *
 _evgl_tls_resource_get(void)
 {
@@ -1517,6 +1538,9 @@ _evgl_tls_resource_get(void)
    if (evgl_engine->resource_key)
      rsc = eina_tls_get(evgl_engine->resource_key);
 
+   if (rsc == NULL && eina_thread_self() == evas_gl_thread_get(EVAS_GL_THREAD_TYPE_EVGL))
+      rsc = evgl_engine->resource_main;
+
    return rsc;
 }
 
@@ -1559,6 +1583,9 @@ _evgl_tls_resource_create(void *eng_data)
         return NULL;
      }
 
+   if (eina_thread_self() == evgl_engine->main_tid)
+      evgl_engine->resource_main = rsc;
+
    // Set the resource in TLS
    if (eina_tls_set(evgl_engine->resource_key, (void*)rsc) == EINA_TRUE)
      {
@@ -1611,6 +1638,9 @@ _evgl_tls_resource_destroy(void *eng_data)
    EINA_LIST_FOREACH(evgl_engine->resource_list, l, rsc)
      {
         _internal_resources_destroy(eng_data, rsc);
+
+        if (rsc == evgl_engine->resource_main)
+           evgl_engine->resource_main = NULL;
      }
    eina_list_free(evgl_engine->resource_list);
    evgl_engine->resource_list = NULL;
@@ -1963,6 +1993,34 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
    else if (evgl_engine->direct_override == 1)
      sfc->direct_override = EINA_TRUE;
 
+   if (sfc->direct_override == EINA_TRUE)
+     {
+        if (evas_gl_thread_enabled())
+          {
+             // Now surface direct override is ON.
+             // It means that EvasGL DIRECT rendering is enabled strictly
+             // and Evas GL THREAD rendering needs disabled from now,
+             // and executes runtime FALLBACKS (eglMakeCurrent NULL).
+             // But it may not work correctly if some rendering is not yet completely finished.
+             // So it is recommended that programmer should disable EVAS_GL_THREAD_RENDER flag.
+             int ret;
+             EGLDisplay display = eglGetCurrentDisplay_thread_cmd();
+
+             DBG("Overriding Thread Rendering ON to OFF (FALLBACK is occurred)");
+
+             ret = eglMakeCurrent_thread_cmd(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+             if (ret != EGL_TRUE)
+               ERR("Evas GL thread fallback is failed");
+
+             ret = eglMakeCurrent_evgl_thread_cmd(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+             if (ret != EGL_TRUE)
+               ERR("Evas GL thread fallback is failed");
+
+             evas_gl_thread_begin();
+             evas_evgl_thread_begin();
+          }
+     }
+
    // Set the internal config value
    if (!_internal_config_set(eng_data, sfc, cfg))
      {
@@ -2329,7 +2387,7 @@ evgl_context_destroy(void *eng_data, EVGL_Context *ctx)
              ERR("Error doing an internal resource make current");
              return 0;
           }
-        glDeleteFramebuffers(1, &ctx->surface_fbo);
+        glDeleteFramebuffers_evgl_thread_cmd(1, &ctx->surface_fbo);
      }
 
    // Retrieve the resource object
@@ -2424,24 +2482,24 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
 
              if (rsc->current_ctx->version == EVAS_GL_GLES_3_X)
                {
-                  glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &curr_draw_fbo);
+                  glGetIntegerv_evgl_thread_cmd(GL_DRAW_FRAMEBUFFER_BINDING, &curr_draw_fbo);
                   if ((rsc->current_ctx->surface_fbo == (GLuint) curr_draw_fbo) ||
                       (rsc->current_ctx->current_sfc &&
                        rsc->current_ctx->current_sfc->color_buf == (GLuint) curr_draw_fbo))
                     {
-                       glBindFramebuffer(GL_FRAMEBUFFER, 0);
+                       glBindFramebuffer_evgl_thread_cmd(GL_FRAMEBUFFER, 0);
                        rsc->current_ctx->current_draw_fbo = 0;
                        rsc->current_ctx->current_read_fbo = 0;
                     }
                }
              else
                {
-                  glGetIntegerv(GL_FRAMEBUFFER_BINDING, &curr_fbo);
+                  glGetIntegerv_evgl_thread_cmd(GL_FRAMEBUFFER_BINDING, &curr_fbo);
                   if ((rsc->current_ctx->surface_fbo == (GLuint) curr_fbo) ||
                       (rsc->current_ctx->current_sfc &&
                        rsc->current_ctx->current_sfc->color_buf == (GLuint) curr_fbo))
                     {
-                       glBindFramebuffer(GL_FRAMEBUFFER, 0);
+                       glBindFramebuffer_evgl_thread_cmd(GL_FRAMEBUFFER, 0);
                        rsc->current_ctx->current_fbo = 0;
                     }
                }
@@ -2511,8 +2569,8 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
    else
      {
         DBG("Performing surfaceless make current");
-        glViewport(0, 0, 0, 0);
-        glScissor(0, 0, 0, 0);
+        glViewport_evgl_thread_cmd(0, 0, 0, 0);
+        glScissor_evgl_thread_cmd(0, 0, 0, 0);
         rsc->direct.rendered = 0;
         goto finish;
      }
@@ -2593,9 +2651,9 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
              if (!rsc->direct.rendered)
                {
                   // Restore viewport and scissor test to direct rendering mode
-                  glViewport(ctx->viewport_direct[0], ctx->viewport_direct[1], ctx->viewport_direct[2], ctx->viewport_direct[3]);
+                  glViewport_evgl_thread_cmd(ctx->viewport_direct[0], ctx->viewport_direct[1], ctx->viewport_direct[2], ctx->viewport_direct[3]);
                   if ((ctx->direct_scissor) && (!ctx->scissor_enabled))
-                    glEnable(GL_SCISSOR_TEST);
+                    glEnable_evgl_thread_cmd(GL_SCISSOR_TEST);
                }
              if (dbg) DBG("sfc %p is direct renderable.", sfc);
              rsc->direct.rendered = 1;
@@ -2605,9 +2663,9 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
              // Transition from direct rendering to indirect rendering
              if (rsc->direct.rendered)
                {
-                  glViewport(ctx->viewport_coord[0], ctx->viewport_coord[1], ctx->viewport_coord[2], ctx->viewport_coord[3]);
+                  glViewport_evgl_thread_cmd(ctx->viewport_coord[0], ctx->viewport_coord[1], ctx->viewport_coord[2], ctx->viewport_coord[3]);
                   if ((ctx->direct_scissor) && (!ctx->scissor_enabled))
-                    glDisable(GL_SCISSOR_TEST);
+                    glDisable_evgl_thread_cmd(GL_SCISSOR_TEST);
              }
 
              if (ctx->version == EVAS_GL_GLES_3_X)
@@ -2643,7 +2701,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
              if (ctx->version == EVAS_GL_GLES_3_X)
                {
                   // This is to transition from FBO rendering to direct rendering
-                  glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &curr_draw_fbo);
+                  glGetIntegerv_evgl_thread_cmd(GL_DRAW_FRAMEBUFFER_BINDING, &curr_draw_fbo);
                   if (ctx->surface_fbo == (GLuint)curr_draw_fbo)
                     {
                        _framebuffer_draw_bind(0, ctx->version);
@@ -2656,7 +2714,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
                        ctx->current_draw_fbo = 0;
                     }
 
-                  glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &curr_read_fbo);
+                  glGetIntegerv_evgl_thread_cmd(GL_READ_FRAMEBUFFER_BINDING, &curr_read_fbo);
                   if (ctx->surface_fbo == (GLuint)curr_read_fbo)
                     {
                        _framebuffer_read_bind(0, ctx->version);
@@ -2684,7 +2742,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
              else
                {
                   // This is to transition from FBO rendering to direct rendering
-                  glGetIntegerv(GL_FRAMEBUFFER_BINDING, &curr_fbo);
+                  glGetIntegerv_evgl_thread_cmd(GL_FRAMEBUFFER_BINDING, &curr_fbo);
                   if (ctx->surface_fbo == (GLuint)curr_fbo)
                     {
                        _framebuffer_bind(0, ctx->version);
index a5fbb40..7f80585 100644 (file)
@@ -126,6 +126,8 @@ struct _EVGL_Surface
    unsigned buffers_skip_allocate : 1;
    unsigned buffers_allocated : 1;
 
+   unsigned thread_rendering : 1;
+
    void   *cfg;
    int     cfg_index;
 
@@ -328,6 +330,7 @@ struct _EVGL_Engine
    Eina_TLS           resource_key;
    Eina_List         *resource_list;
    Eina_Thread        main_tid;
+   EVGL_Resource     *resource_main;
 
    // Add more debug logs (DBG levels 4 and 6)
    int                api_debug_mode;
index f31ce11..91ebf9c 100644 (file)
@@ -95,9 +95,9 @@ evas_gl_common_file_cache_file_check(const char *cache_dir, const char *cache_na
    char *driver = NULL;
    char *version = NULL;
 
-   vendor = (char *)glGetString(GL_VENDOR);
-   driver = (char *)glGetString(GL_RENDERER);
-   version = (char *)glGetString(GL_VERSION);
+   vendor = (char *)glGetString_thread_cmd(GL_VENDOR);
+   driver = (char *)glGetString_thread_cmd(GL_RENDERER);
+   version = (char *)glGetString_thread_cmd(GL_VERSION);
 
    if (!vendor)  vendor  = "-UNKNOWN-";
    if (!driver)  driver  = "-UNKNOWN-";
index 1b7def1..969fc62 100644 (file)
@@ -59,7 +59,7 @@ evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int
         if (!getenv("EVAS_GL_LINE_OFFSET_HACK_DISABLE"))
           {
              const char *vendor_name;
-             vendor_name = (char *) glGetString(GL_VENDOR);
+             vendor_name = (char *) glGetString_thread_cmd(GL_VENDOR);
              if (vendor_name && !strcmp(vendor_name, "ARM"))
                offset_hack = OFFSET_HACK_ARM;
              else
index 4498a53..ba89975 100644 (file)
@@ -75,18 +75,18 @@ gl_compile_link_error(GLuint target, const char *action, Eina_Bool is_shader)
 
    if (is_shader)
      /* Shader info log */
-     glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
+     glGetShaderiv_thread_cmd(target, GL_INFO_LOG_LENGTH, &loglen);
    else
      /* Program info log */
-     glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
+     glGetProgramiv_thread_cmd(target, GL_INFO_LOG_LENGTH, &loglen);
 
    if (loglen > 0)
      {
         logtxt = calloc(loglen, sizeof(char));
         if (logtxt)
           {
-             if (is_shader) glGetShaderInfoLog(target, loglen, &chars, logtxt);
-             else glGetProgramInfoLog(target, loglen, &chars, logtxt);
+             if (is_shader) glGetShaderInfoLog_thread_cmd(target, loglen, &chars, logtxt);
+             else glGetProgramInfoLog_thread_cmd(target, loglen, &chars, logtxt);
              ERR("Failed to %s: %s", action, logtxt);
              free(logtxt);
           }
@@ -115,43 +115,43 @@ _evas_gl_common_shader_program_binary_load(Eet_File *ef, unsigned int flags)
      }
    if ((!data) || (length <= 0)) goto finish;
 
-   glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
+   glGetIntegerv_thread_cmd(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
    if (num <= 0) goto finish;
 
    formats = calloc(num, sizeof(int));
    if (!formats) goto finish;
 
-   glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
+   glGetIntegerv_thread_cmd(GL_PROGRAM_BINARY_FORMATS, formats);
    if (!formats[0]) goto finish;
 
-   prg = glCreateProgram();
+   prg = glCreateProgram_thread_cmd();
 #if 1
    // TODO: invalid rendering error occurs when attempting to use a
    // glProgramBinary. in order to render correctly we should create a dummy
    // vertex shader.
-   vtx = glCreateShader(GL_VERTEX_SHADER);
-   glAttachShader(prg, vtx);
-   frg = glCreateShader(GL_FRAGMENT_SHADER);
-   glAttachShader(prg, frg);
+   vtx = glCreateShader_thread_cmd(GL_VERTEX_SHADER);
+   glAttachShader_thread_cmd(prg, vtx);
+   frg = glCreateShader_thread_cmd(GL_FRAGMENT_SHADER);
+   glAttachShader_thread_cmd(prg, frg);
 #endif
    glsym_glProgramBinary(prg, formats[0], data, length);
 
-   glBindAttribLocation(prg, SHAD_VERTEX,  "vertex");
-   glBindAttribLocation(prg, SHAD_COLOR,   "color");
-   glBindAttribLocation(prg, SHAD_TEXUV,   "tex_coord");
-   glBindAttribLocation(prg, SHAD_TEXUV2,  "tex_coord2");
-   glBindAttribLocation(prg, SHAD_TEXUV3,  "tex_coord3");
-   glBindAttribLocation(prg, SHAD_TEXA,    "tex_coorda");
-   glBindAttribLocation(prg, SHAD_TEXSAM,  "tex_sample");
-   glBindAttribLocation(prg, SHAD_MASK,    "mask_coord");
-   glBindAttribLocation(prg, SHAD_MASKSAM, "tex_masksample");
-
-   glGetProgramiv(prg, GL_LINK_STATUS, &ok);
+   glBindAttribLocation_thread_cmd(prg, SHAD_VERTEX,  "vertex");
+   glBindAttribLocation_thread_cmd(prg, SHAD_COLOR,   "color");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV,   "tex_coord");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV2,  "tex_coord2");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV3,  "tex_coord3");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXA,    "tex_coorda");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXSAM,  "tex_sample");
+   glBindAttribLocation_thread_cmd(prg, SHAD_MASK,    "mask_coord");
+   glBindAttribLocation_thread_cmd(prg, SHAD_MASKSAM, "tex_masksample");
+
+   glGetProgramiv_thread_cmd(prg, GL_LINK_STATUS, &ok);
    if (!ok)
      {
         gl_compile_link_error(prg, "load a program object", EINA_FALSE);
         ERR("Abort load of program (%s)", pname);
-        glDeleteProgram(prg);
+        glDeleteProgram_thread_cmd(prg);
         goto finish;
      }
 
@@ -160,13 +160,14 @@ _evas_gl_common_shader_program_binary_load(Eet_File *ef, unsigned int flags)
    p->prog = prg;
    p->reset = EINA_TRUE;
    p->bin_saved = EINA_TRUE;
-   p->uniform.mvp = glGetUniformLocation(prg, "mvp");
-   p->uniform.rotation_id = glGetUniformLocation(prg, "rotation_id");
+   glUseProgram_thread_cmd(prg);
+   p->uniform.mvp = glGetUniformLocation_thread_cmd(prg, "mvp");
+   p->uniform.rotation_id = glGetUniformLocation_thread_cmd(prg, "rotation_id");
    evas_gl_common_shader_textures_bind(p);
 
 finish:
-   if (vtx) glDeleteShader(vtx);
-   if (frg) glDeleteShader(frg);
+   if (vtx) glDeleteShader_thread_cmd(vtx);
+   if (frg) glDeleteShader_thread_cmd(frg);
    free(formats);
    if (!direct) free(data);
    return p;
@@ -182,7 +183,7 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program *p, Eet_File *ef)
 
    if (!glsym_glGetProgramBinary) return 0;
 
-   glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
+   glGetProgramiv_thread_cmd(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
    if (length <= 0) return 0;
 
    data = malloc(length);
@@ -384,7 +385,7 @@ save:
 static inline void
 _program_del(Evas_GL_Program *p)
 {
-   if (p->prog) glDeleteProgram(p->prog);
+   if (p->prog) glDeleteProgram_thread_cmd(p->prog);
    free(p);
 }
 
@@ -422,61 +423,61 @@ evas_gl_common_shader_compile(unsigned int flags, const char *vertex,
    GLint ok = 0;
 
    compiler_released = EINA_FALSE;
-   vtx = glCreateShader(GL_VERTEX_SHADER);
-   frg = glCreateShader(GL_FRAGMENT_SHADER);
+   vtx = glCreateShader_thread_cmd(GL_VERTEX_SHADER);
+   frg = glCreateShader_thread_cmd(GL_FRAGMENT_SHADER);
 
-   glShaderSource(vtx, 1, &vertex, NULL);
-   glCompileShader(vtx);
-   glGetShaderiv(vtx, GL_COMPILE_STATUS, &ok);
+   glShaderSource_thread_cmd(vtx, 1, &vertex, NULL);
+   glCompileShader_thread_cmd(vtx);
+   glGetShaderiv_thread_cmd(vtx, GL_COMPILE_STATUS, &ok);
    if (!ok)
      {
         gl_compile_link_error(vtx, "compile vertex shader", EINA_TRUE);
         ERR("Abort compile of vertex shader:\n%s", vertex);
-        glDeleteShader(vtx);
+        glDeleteShader_thread_cmd(vtx);
         return NULL;
      }
    ok = 0;
 
-   glShaderSource(frg, 1, &fragment, NULL);
-   glCompileShader(frg);
-   glGetShaderiv(frg, GL_COMPILE_STATUS, &ok);
+   glShaderSource_thread_cmd(frg, 1, &fragment, NULL);
+   glCompileShader_thread_cmd(frg);
+   glGetShaderiv_thread_cmd(frg, GL_COMPILE_STATUS, &ok);
    if (!ok)
      {
         gl_compile_link_error(frg, "compile fragment shader", EINA_TRUE);
         ERR("Abort compile of fragment shader:\n%s", fragment);
-        glDeleteShader(vtx);
-        glDeleteShader(frg);
+        glDeleteShader_thread_cmd(vtx);
+        glDeleteShader_thread_cmd(frg);
         return NULL;
      }
    ok = 0;
 
-   prg = glCreateProgram();
+   prg = glCreateProgram_thread_cmd();
 #ifndef GL_GLES
    if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
      glsym_glProgramParameteri(prg, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
 #endif
-   glAttachShader(prg, vtx);
-   glAttachShader(prg, frg);
-
-   glBindAttribLocation(prg, SHAD_VERTEX,  "vertex");
-   glBindAttribLocation(prg, SHAD_COLOR,   "color");
-   glBindAttribLocation(prg, SHAD_TEXUV,   "tex_coord");
-   glBindAttribLocation(prg, SHAD_TEXUV2,  "tex_coord2");
-   glBindAttribLocation(prg, SHAD_TEXUV3,  "tex_coord3");
-   glBindAttribLocation(prg, SHAD_TEXA,    "tex_coorda");
-   glBindAttribLocation(prg, SHAD_TEXSAM,  "tex_sample");
-   glBindAttribLocation(prg, SHAD_MASK,    "mask_coord");
-   glBindAttribLocation(prg, SHAD_MASKSAM, "tex_masksample");
-
-   glLinkProgram(prg);
-   glGetProgramiv(prg, GL_LINK_STATUS, &ok);
+   glAttachShader_thread_cmd(prg, vtx);
+   glAttachShader_thread_cmd(prg, frg);
+
+   glBindAttribLocation_thread_cmd(prg, SHAD_VERTEX,  "vertex");
+   glBindAttribLocation_thread_cmd(prg, SHAD_COLOR,   "color");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV,   "tex_coord");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV2,  "tex_coord2");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXUV3,  "tex_coord3");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXA,    "tex_coorda");
+   glBindAttribLocation_thread_cmd(prg, SHAD_TEXSAM,  "tex_sample");
+   glBindAttribLocation_thread_cmd(prg, SHAD_MASK,    "mask_coord");
+   glBindAttribLocation_thread_cmd(prg, SHAD_MASKSAM, "tex_masksample");
+
+   glLinkProgram_thread_cmd(prg);
+   glGetProgramiv_thread_cmd(prg, GL_LINK_STATUS, &ok);
    if (!ok)
      {
         gl_compile_link_error(prg, "link fragment and vertex shaders", EINA_FALSE);
         ERR("Abort compile of shader (flags: %08x)", flags);
-        glDeleteShader(vtx);
-        glDeleteShader(frg);
-        glDeleteProgram(prg);
+        glDeleteShader_thread_cmd(vtx);
+        glDeleteShader_thread_cmd(frg);
+        glDeleteProgram_thread_cmd(prg);
         return 0;
      }
 
@@ -485,8 +486,8 @@ evas_gl_common_shader_compile(unsigned int flags, const char *vertex,
    p->prog = prg;
    p->reset = EINA_TRUE;
 
-   glDeleteShader(vtx);
-   glDeleteShader(frg);
+   glDeleteShader_thread_cmd(vtx);
+   glDeleteShader_thread_cmd(frg);
 
    return p;
 }
@@ -568,8 +569,8 @@ evas_gl_common_shader_generate_and_compile(Evas_GL_Shared *shared, unsigned int
    if (p)
      {
         shared->needs_shaders_flush = 1;
-        p->uniform.mvp = glGetUniformLocation(p->prog, "mvp");
-        p->uniform.rotation_id = glGetUniformLocation(p->prog, "rotation_id");
+        p->uniform.mvp = glGetUniformLocation_thread_cmd(p->prog, "mvp");
+        p->uniform.rotation_id = glGetUniformLocation_thread_cmd(p->prog, "rotation_id");
         evas_gl_common_shader_textures_bind(p);
         eina_hash_add(shared->shaders_hash, &flags, p);
      }
@@ -654,7 +655,7 @@ evas_gl_common_shaders_flush(Evas_GL_Shared *shared)
      {
         compiler_released = EINA_TRUE;
 #ifdef GL_GLES
-        glReleaseShaderCompiler();
+        glReleaseShaderCompiler_thread_cmd();
 #else
         if (glsym_glReleaseShaderCompiler)
           glsym_glReleaseShaderCompiler();
@@ -881,17 +882,17 @@ evas_gl_common_shader_textures_bind(Evas_GL_Program *p)
 
    if (hastex)
      {
-        glUseProgram(p->prog); // is this necessary??
+        glUseProgram_thread_cmd(p->prog); // is this necessary??
         for (i = 0; textures[i].name; i++)
           {
              if (!textures[i].enabled) continue;
-             loc = glGetUniformLocation(p->prog, textures[i].name);
+             loc = glGetUniformLocation_thread_cmd(p->prog, textures[i].name);
              if (loc < 0)
                {
                   ERR("Couldn't find uniform '%s' (shader: %08x)",
                       textures[i].name, p->flags);
                }
-             glUniform1i(loc, p->tex_count++);
+             glUniform1i_thread_cmd(loc, p->tex_count++);
           }
      }
 }
index 7a9fbda..a4431b5 100644 (file)
@@ -97,6 +97,30 @@ static const struct {
   { MATCH_ANY, MATCH_ANY, EVAS_COLORSPACE_RGBA_S3TC_DXT5, &s3tc_rgba_dxt45_fmt, &s3tc_rgba_dxt45_fmt }
 };
 
+static void
+_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix)
+{
+   if ((w > gc->shared->info.max_texture_size) ||
+       (h > gc->shared->info.max_texture_size)) return;
+   glTexSubImage2DEVAS_thread_cmd(0, GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
+}
+
+static void
+_tex_sub_2d_push(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int type, const void *pix)
+{
+   if ((w > gc->shared->info.max_texture_size) ||
+       (h > gc->shared->info.max_texture_size)) return;
+   glTexSubImage2DEVAS_thread_cmd(1, GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
+}
+
+static void
+_comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt, int imgsize, const void *pix)
+{
+   if ((w > gc->shared->info.max_texture_size) ||
+       (h > gc->shared->info.max_texture_size)) return;
+   glCompressedTexSubImage2D_thread_cmd(GL_TEXTURE_2D, 0, x, y, w, h, fmt, imgsize, pix);
+}
+
 #ifdef GL_TEXTURE_INTERNAL_FORMAT
 # ifndef GL_GLES
 static const GLenum matching_rgb[] = { GL_RGB4, GL_RGB8, GL_RGB12, GL_RGB16, 0x0 };
@@ -176,7 +200,7 @@ evas_gl_common_texture_shared_specific(Evas_Engine_GL_Context *gc, Evas_GL_Textu
         else
           gc->pipe[i].shader.tex_target = GL_TEXTURE_2D;
 
-        glBindTexture(gc->pipe[i].shader.tex_target, gc->pipe[i].shader.cur_tex);
+        glBindTexture_thread_cmd(gc->pipe[i].shader.tex_target, gc->pipe[i].shader.cur_tex);
      }
 }
 
@@ -333,9 +357,9 @@ _tex_2d(Evas_Engine_GL_Context *gc, int intfmt, int w, int h, int fmt, int type,
      }
    sz = _evas_gl_texture_size_get(w, h, intfmt, &comp);
    if (!comp)
-     glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, data);
+     glTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, data);
    else
-     glCompressedTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, sz, data);
+     glCompressedTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, intfmt, w, h, 0, sz, data);
 #ifdef GL_TEXTURE_INTERNAL_FORMAT
 # ifdef GL_GLES
 # else
@@ -344,7 +368,7 @@ _tex_2d(Evas_Engine_GL_Context *gc, int intfmt, int w, int h, int fmt, int type,
      {
         int intfmtret = -1;
 
-        glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
+        glGetTexLevelParameteriv_thread_cmd(GL_TEXTURE_2D, 0,
                                  GL_TEXTURE_INTERNAL_FORMAT, &intfmtret);
         if (!_evas_gl_texture_match(intfmt, intfmtret))
           {
@@ -418,17 +442,17 @@ _pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, GLenum intformat, GLenum
    pt->references = 0;
    pt->eina_pool = eina_rectangle_pool_new(w, h);
 
-   glGenTextures(1, &(pt->texture));
-   glBindTexture(GL_TEXTURE_2D, pt->texture);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glGenTextures_thread_cmd(1, &(pt->texture));
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, pt->texture);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat, NULL);
-   glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
+   glBindTexture_thread_cmd(gc->state.current.tex_target, gc->state.current.cur_tex);
    if (!ok)
      {
-        glDeleteTextures(1, &(pt->texture));
+        glDeleteTextures_thread_cmd(1, &(pt->texture));
         if (pt->eina_pool)
           eina_rectangle_pool_free(pt->eina_pool);
         free(pt);
@@ -643,13 +667,13 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
 #  define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
 # endif
 #endif
-   glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fnum);
-   glGenTextures(1, &(pt->texture));
-   glBindTexture(GL_TEXTURE_2D, pt->texture);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glGetIntegerv_thread_cmd(GL_FRAMEBUFFER_BINDING, &fnum);
+   glGenTextures_thread_cmd(1, &(pt->texture));
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, pt->texture);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    ok = _tex_2d(gc, pt->intformat, w, h, pt->format, pt->dataformat, NULL);
 
    if (ok)
@@ -662,19 +686,19 @@ _pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
 
    if (stencil)
      {
-        glGenRenderbuffers(1, &(pt->stencil));
-        glBindRenderbuffer(GL_RENDERBUFFER, pt->stencil);
-        glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, pt->w, pt->h);
-        glBindRenderbuffer(GL_RENDERBUFFER, 0);
-        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, pt->stencil);
+        glGenRenderbuffers_thread_cmd(1, &(pt->stencil));
+        glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, pt->stencil);
+        glRenderbufferStorage_thread_cmd(GL_RENDERBUFFER, GL_STENCIL_INDEX8, pt->w, pt->h);
+        glBindRenderbuffer_thread_cmd(GL_RENDERBUFFER, 0);
+        glFramebufferRenderbuffer_thread_cmd(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, pt->stencil);
      }
 
    glsym_glBindFramebuffer(GL_FRAMEBUFFER, fnum);
-   glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
+   glBindTexture_thread_cmd(gc->state.current.tex_target, gc->state.current.cur_tex);
 
    if (!ok)
      {
-        glDeleteTextures(1, &(pt->texture));
+        glDeleteTextures_thread_cmd(1, &(pt->texture));
         if (pt->eina_pool)
           eina_rectangle_pool_free(pt->eina_pool);
         free(pt);
@@ -721,8 +745,8 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
    pt->references = 0;
    pt->native = 1;
    pt->eina_pool = eina_rectangle_pool_new(w, h);
-   glGenTextures(1, &(pt->texture));
-   glBindTexture(im->native.target, pt->texture);
+   glGenTextures_thread_cmd(1, &(pt->texture));
+   glBindTexture_thread_cmd(im->native.target, pt->texture);
 
 #ifdef GL_GLES
 #else
@@ -733,12 +757,12 @@ _pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, in
      }
 #endif
 
-   glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-   glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-   glBindTexture(im->native.target, 0);
-   glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
+   glTexParameteri_thread_cmd(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glBindTexture_thread_cmd(im->native.target, 0);
+   glBindTexture_thread_cmd(gc->state.current.tex_target, gc->state.current.cur_tex);
 
    texinfo.n.num++;
    texinfo.n.pix += pt->w * pt->h;
@@ -775,12 +799,12 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
 
    pt->dyn.target = GL_TEXTURE_2D;
 
-   glGenTextures(1, &(pt->texture));
-   glBindTexture(pt->dyn.target, pt->texture);
-   glTexParameteri(pt->dyn.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(pt->dyn.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-   glTexParameteri(pt->dyn.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-   glTexParameteri(pt->dyn.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+   glGenTextures_thread_cmd(1, &(pt->texture));
+   glBindTexture_thread_cmd(pt->dyn.target, pt->texture);
+   glTexParameteri_thread_cmd(pt->dyn.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(pt->dyn.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+   glTexParameteri_thread_cmd(pt->dyn.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+   glTexParameteri_thread_cmd(pt->dyn.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
    egldisplay = pt->gc->egldisp;
 
@@ -888,7 +912,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
         goto error;
      }
 
-   glBindTexture(gc->state.current.tex_target, gc->state.current.cur_tex);
+   glBindTexture_thread_cmd(gc->state.current.tex_target, gc->state.current.cur_tex);
 #else
    if (gc + w + h + intformat + format) return pt;
 #endif
@@ -902,8 +926,8 @@ error:
        secsym_eglDestroyImage(egldisplay, pt->dyn.img);
        pt->dyn.img = NULL;
     }
-  glBindTexture(pt->dyn.target, 0);
-  glDeleteTextures(1, &(pt->texture));
+  glBindTexture_thread_cmd(pt->dyn.target, 0);
+  glDeleteTextures_thread_cmd(1, &(pt->texture));
   if (pt->eina_pool)
     eina_rectangle_pool_free(pt->eina_pool);
   free(pt);
@@ -974,12 +998,12 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
      }
 #endif
 
-   glDeleteTextures(1, &(pt->texture));
+   glDeleteTextures_thread_cmd(1, &(pt->texture));
    if (pt->gc->state.current.cur_tex == pt->texture)
      pt->gc->state.current.cur_tex = 0;
    if (pt->stencil)
      {
-        glDeleteRenderbuffers(1, &(pt->stencil));
+        glDeleteRenderbuffers_thread_cmd(1, &(pt->stencil));
         pt->stencil = 0;
      }
    if (pt->fb)
@@ -1102,10 +1126,10 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
    GLuint fmt;
 
    fmt = tex->pt->format;
-   glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
    if (tex->gc->shared->info.unpack_row_length)
-     glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
-   glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
+     glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, 0);
+   glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, bytes_count);
 
    if ((tex->gc->shared->info.tune.atlas.max_memcpy_size > im->cache_entry.w) &&
            (tex->gc->shared->info.tune.atlas.max_memcpy_size > im->cache_entry.h))
@@ -1202,7 +1226,7 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
                     im->image.data8 + (im->cache_entry.w - 1) * bytes_count);
         if (tex->gc->shared->info.unpack_row_length)
           {
-            glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
+            glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
             // |xxx
             // |xxx
             //
@@ -1256,9 +1280,9 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
                         tpix);
           }
      }
-   //glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+   //glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 4);
    if (tex->pt->texture != tex->gc->state.current.cur_tex)
-     glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+     glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
 }
 
 void
@@ -1320,22 +1344,22 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
            height = im->cache_entry.h + im->cache_entry.borders.t + im->cache_entry.borders.b;
            EINA_SAFETY_ON_FALSE_RETURN(!(width & 0x3) && !(height & 0x3));
 
-           glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+           glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
 
            if ((tex->gc->shared->info.etc1_subimage ||
                (im->cache_entry.space != EVAS_COLORSPACE_ETC1))
                && (tex->pt->w != width || tex->pt->h != height))
              {
                 int err;
-                err = glGetError();
+                err = glGetError_thread_cmd();
 
-                glCompressedTexSubImage2D(GL_TEXTURE_2D, 0,
+                glCompressedTexSubImage2D_thread_cmd(GL_TEXTURE_2D, 0,
                                           x, y, width, height,
                                           tex->pt->format,
                                           ((width * height) >> 4) * bsize,
                                           im->image.data);
 
-                err = glGetError();
+                err = glGetError_thread_cmd();
                 if (err != GL_NO_ERROR)
                   {
                      __evas_gl_err(err, __FILE__, __FUNCTION__, __LINE__,
@@ -1350,7 +1374,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
              }
            else
              {
-                glCompressedTexImage2D(GL_TEXTURE_2D, 0, tex->pt->format,
+                glCompressedTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, tex->pt->format,
                                        width, height, 0,
                                        ((width * height) >> 4) * bsize,
                                        im->image.data);
@@ -1358,7 +1382,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
 
            if (tex->pt->texture != tex->gc->state.current.cur_tex)
              {
-                glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+                glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
              }
            return;
         }
@@ -1467,18 +1491,18 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
 
         // Bind and upload ! Vooom !
         fmt = tex->ptt->format;
-        glBindTexture(GL_TEXTURE_2D, tex->ptt->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptt->texture);
         if (tex->gc->shared->info.unpack_row_length)
           {
-             glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+             glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, 0);
           }
-        glPixelStorei(GL_UNPACK_ALIGNMENT, bytes_count);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, bytes_count);
 
         _tex_sub_2d(tex->gc, u, tex->ty, EVAS_GL_TILE_SIZE, EVAS_GL_TILE_SIZE, fmt, tex->ptt->dataformat, out);
 
         // Switch back to current texture
         if (tex->ptt->texture != tex->gc->state.current.cur_tex)
-          glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+          glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
 
         // Now prepare uploading the main texture before returning;
         async = malloc(sizeof (Evas_GL_Texture_Async_Preload));
@@ -1614,16 +1638,16 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
                                     unsigned int w, unsigned int h, int fh EINA_UNUSED)
 {
    if (!tex->pt) return;
-   glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
    if (tex->gc->shared->info.unpack_row_length)
      {
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, 0);
      }
-   glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+   glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 4);
    _tex_sub_2d(tex->gc, tex->x, tex->y, w, h, tex->pt->format,
                tex->pt->dataformat, pixels);
    if (tex->pt->texture != tex->gc->state.current.cur_tex)
-     glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+     glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
 }
 
 Evas_GL_Texture *
@@ -1716,35 +1740,35 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
    if (!subimage || tex->gc->shared->info.unpack_row_length)
      {
         if (tex->gc->shared->info.unpack_row_length)
-          glPixelStorei(GL_UNPACK_ROW_LENGTH, w);
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+          glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, w);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
           goto on_error;
         if (upload)
           {
              if (comp)
-               glCompressedTexImage2D(GL_TEXTURE_2D, 0, tex->pt->intformat, w, h, 0, sz, data1);
+               glCompressedTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, tex->pt->intformat, w, h, 0, sz, data1);
              else
-               _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
+               _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
           }
-        glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pta->texture);
         if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format, tex->pta->dataformat, NULL))
           goto on_error;
         if (upload)
           {
              if (comp)
-               glCompressedTexImage2D(GL_TEXTURE_2D, 0, tex->pta->intformat, w, h, 0, sz, data2);
+               glCompressedTexImage2D_thread_cmd(GL_TEXTURE_2D, 0, tex->pta->intformat, w, h, 0, sz, data2);
              else
-               _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pta->format, tex->pta->dataformat, data2);
+               _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pta->format, tex->pta->dataformat, data2);
           }
      }
    else
      {
         int y;
 
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format,
                      tex->pt->dataformat, NULL))
           goto on_error;
@@ -1755,7 +1779,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
                   if (comp)
                     _comp_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, sz, data1);
                   else
-                    _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
+                    _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, data1);
                }
              else
                {
@@ -1764,13 +1788,13 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
                        if (comp)
                          _comp_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, sz, data1);
                        else
-                         _tex_sub_2d(tex->gc, 0, y, w, ystep, tex->pt->format,
+                         _tex_sub_2d_push(tex->gc, 0, y, w, ystep, tex->pt->format,
                                      tex->pt->dataformat, data1 + rowlen * y / ystep);
                     }
                }
           }
 
-        glBindTexture(GL_TEXTURE_2D, tex->pta->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pta->texture);
         if (!_tex_2d(tex->gc, tex->pta->intformat, w, h, tex->pta->format,
                      tex->pta->dataformat, NULL))
           goto on_error;
@@ -1781,7 +1805,7 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
                   if (comp)
                     _comp_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pta->format, sz, data2);
                   else
-                    _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pta->format, tex->pta->dataformat, data2);
+                    _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pta->format, tex->pta->dataformat, data2);
                }
              else
                {
@@ -1790,14 +1814,14 @@ evas_gl_common_texture_rgb_a_pair_update(Evas_GL_Texture *tex,
                        if (comp)
                          _comp_tex_sub_2d(tex->gc, 0, 0, w, h, tex->pta->format, sz, data2);
                        else
-                         _tex_sub_2d(tex->gc, 0, y, w, ystep, tex->pta->format,
+                         _tex_sub_2d_push(tex->gc, 0, y, w, ystep, tex->pta->format,
                                      tex->pta->dataformat, data2 + rowlen * y / ystep);
                     }
                }
           }
      }
 on_error:
-   glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+   glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
 }
 
 Evas_GL_Texture *
@@ -1905,7 +1929,7 @@ evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigne
 }
 
 void
-evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
+_orig_evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
 {
    Evas_GL_Texture_Pool *pt, *ptu, *ptv;
 
@@ -1924,63 +1948,108 @@ evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned i
    // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
    if (tex->gc->shared->info.unpack_row_length)
      {
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
-          return;
-        _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
-        glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
+          goto finish;
+        _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptu->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
         if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, NULL))
-          return;
-        _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
-        glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
+          goto finish;
+        _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptv->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
         if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, NULL))
-          return;
-        _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
+          goto finish;
+        _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
      }
    else
      {
         unsigned int y;
         
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
-          return;
+          goto finish;
         if ((rows[1] - rows[0]) == (int)w)
-          _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+          _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
         else
           {
              for (y = 0; y < h; y++)
-               _tex_sub_2d(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
+               _tex_sub_2d_push(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
           }
 
-        glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptu->texture);
         if (!_tex_2d(tex->gc, tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, NULL))
-          return;
+          goto finish;
         if ((rows[h + 1] - rows[h]) == (int)(w / 2))
-          _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
+          _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
         else
           {
              for (y = 0; y < (h / 2); y++)
-               _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
+               _tex_sub_2d_push(tex->gc, 0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
           }
 
-        glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptv->texture);
         if (!_tex_2d(tex->gc, tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, NULL))
-          return;
+          goto finish;
         if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
-          _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
+          _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
         else
           {
              for (y = 0; y < (h / 2); y++)
-               _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
+               _tex_sub_2d_push(tex->gc, 0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
           }
      }
    if (tex->pt->texture != tex->gc->state.current.cur_tex)
-     glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+     glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+
+finish:
+   evas_gl_thread_finish();
+}
+
+typedef struct
+{
+   Evas_GL_Texture *tex;
+   DATA8 **rows;
+   unsigned int w;
+   unsigned int h;
+} Evas_Thread_Command_evas_gl_common_texture_yuv_update;
+
+static void
+_gl_thread_evas_gl_common_texture_yuv_update(void *data)
+{
+   Evas_Thread_Command_evas_gl_common_texture_yuv_update *thread_param =
+      (Evas_Thread_Command_evas_gl_common_texture_yuv_update *)data;
+
+   evas_gl_thread_begin();
+   _orig_evas_gl_common_texture_yuv_update(thread_param->tex, thread_param->rows, thread_param->w, thread_param->h);
+   evas_gl_thread_end();
+}
+
+void
+evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        _orig_evas_gl_common_texture_yuv_update(tex, rows, w, h);
+        return;
+     }
+
+   Evas_Thread_Command_evas_gl_common_texture_yuv_update thread_param_local;
+   Evas_Thread_Command_evas_gl_common_texture_yuv_update *thread_param = &thread_param_local;
+   thread_param->tex = tex;
+   thread_param->rows = rows;
+   thread_param->w = w;
+   thread_param->h = h;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_evas_gl_common_texture_yuv_update,
+                              thread_param,
+                              EVAS_GL_THREAD_MODE_FINISH);
+
 }
 
 static Evas_GL_Texture *
@@ -2119,21 +2188,21 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
    tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
    tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
 
-   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-   glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+   glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
    if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
      return;
    if ((rows[1] - rows[0]) == (int)w * 4)
-     _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+     _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
    else
      {
         for (y = 0; y < h; y++)
-          _tex_sub_2d(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
+          _tex_sub_2d_push(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
      }
 
-   glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptuv->texture);
    if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat, NULL))
-     return;
+     goto finish;
 #if 0
    /*
      FIXME: this piece of code doesn't work anymore since texture width
@@ -2145,11 +2214,13 @@ evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
 #endif
      {
         for (y = 0; y < h; y++)
-          _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
+          _tex_sub_2d_push(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
      }
 
    if (tex->pt->texture != tex->gc->state.current.cur_tex)
-     glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+     glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+finish:
+   evas_gl_thread_finish();
 }
 
 void
@@ -2164,47 +2235,49 @@ evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned
    // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
    if (tex->gc->shared->info.unpack_row_length)
      {
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
-          return;
-        _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
-        glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
-        glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
+          goto finish;
+        _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptuv->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
         if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, NULL))
-          return;
-        _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
+          goto finish;
+        _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
      }
    else
      {
         unsigned int y;
 
-        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-        glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+        glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
         if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
-          return;
+          goto finish;
         if ((rows[1] - rows[0]) == (int)w)
-          _tex_sub_2d(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+          _tex_sub_2d_push(tex->gc, 0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
         else
           {
              for (y = 0; y < h; y++)
-               _tex_sub_2d(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
+               _tex_sub_2d_push(tex->gc, 0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
           }
 
-        glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptuv->texture);
         if (!_tex_2d(tex->gc, tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, NULL))
-          return;
+          goto finish;
         if ((rows[h + 1] - rows[h]) == (int)(w / 2))
-          _tex_sub_2d(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
+          _tex_sub_2d_push(tex->gc, 0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
         else
           {
              for (y = 0; y < (h / 2); y++)
-               _tex_sub_2d(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
+               _tex_sub_2d_push(tex->gc, 0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
           }
      }
    if (tex->pt->texture != tex->gc->state.current.cur_tex)
-     glBindTexture(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+     glBindTexture_thread_cmd(tex->gc->state.current.tex_target, tex->gc->state.current.cur_tex);
+finish:
+   evas_gl_thread_finish();
 }
 
 void
@@ -2361,12 +2434,12 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
      }
 #endif
 
-   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-   glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+   glPixelStorei_thread_cmd(GL_UNPACK_ALIGNMENT, 1);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->pt->texture);
 
    // We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
    if (!_tex_2d(tex->gc, tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat, NULL))
-     return;
+     goto finish;
 
    /* Iterate each Y macroblock like we do in evas_convert_yuv.c */
    for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
@@ -2382,7 +2455,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
 
         for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
           {
-             _tex_sub_2d(tex->gc, x, ry[offset], 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
+             _tex_sub_2d_push(tex->gc, x, ry[offset], 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
 
              step++;
              if ((step & 0x3) == 0)
@@ -2406,13 +2479,13 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
         ry = mb_y * 2 * 32;
 
         for (mb_x = 0; mb_x < mb_w; mb_x++, x += 64, rmb_x += 64 * 32)
-          _tex_sub_2d(tex->gc, x, ry, 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
+          _tex_sub_2d_push(tex->gc, x, ry, 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
      }
 
-   glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+   glBindTexture_thread_cmd(GL_TEXTURE_2D, tex->ptuv->texture);
 
    if (!_tex_2d(tex->gc, tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat, NULL))
-     return;
+     goto finish;
 
    /* Iterate each UV macroblock like we do in evas_convert_yuv.c */
    base_h = (mb_h >> 1) + (mb_h & 0x1);
@@ -2437,7 +2510,7 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
 
         for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
           {
-             _tex_sub_2d(tex->gc, x, ry[offset], 32, 32,
+             _tex_sub_2d_push(tex->gc, x, ry[offset], 32, 32,
                          tex->ptuv->format, tex->ptuv->dataformat,
                          rows[mb_y + base_h] + rmb_x);
              step++;
@@ -2462,6 +2535,8 @@ evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsi
         ry = mb_y * 2 * 32;
 
         for (mb_x = 0; mb_x < mb_w; mb_x++, x += 32, rmb_x += 64 * 32)
-          _tex_sub_2d(tex->gc, x, ry, 64, 32, tex->ptuv->format, tex->ptuv->dataformat, rows[mb_y + base_h] + rmb_x);
+          _tex_sub_2d_push(tex->gc, x, ry, 64, 32, tex->ptuv->format, tex->ptuv->dataformat, rows[mb_y + base_h] + rmb_x);
      }
+finish:
+   evas_gl_thread_finish();
 }
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread.c b/src/modules/evas/engines/gl_common/evas_gl_thread.c
new file mode 100644 (file)
index 0000000..3865bc3
--- /dev/null
@@ -0,0 +1,219 @@
+#include "evas_gl_common.h"
+#include "evas_gl_thread.h"
+
+/* Main Thread id */
+Eina_Thread _main_thread_id = 0;
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+/* Memory Pool */
+Eina_Mempool *_mp_default = NULL;
+Eina_Mempool *_mp_command = NULL;
+Eina_Mempool *_mp_uniform = NULL;
+Eina_Mempool *_mp_delete_object = NULL;
+Eina_Mempool *_mp_texture = NULL;
+
+unsigned int _mp_default_memory_size = 128;
+unsigned int _mp_command_memory_size = 256;
+unsigned int _mp_uniform_memory_size = 128;
+unsigned int _mp_delete_object_memory_size = 128;
+unsigned int _mp_texture_memory_size = 4 * 256 * 256;
+
+unsigned int _mp_default_pool_size     = 64;
+unsigned int _mp_command_pool_size     = 64;
+unsigned int _mp_uniform_pool_size     = 32;
+unsigned int _mp_delete_object_pool_size = 32;
+unsigned int _mp_texture_pool_size = 8;
+
+
+/* Thread Environment */
+static int env_evas_gl_render_thread = -1;
+static int env_evas_evgl_render_thread = -1;
+static int env_evas_gl_force_finish = -1;
+static int evas_gl_enable_thread = 0;
+static int evas_evgl_enable_thread = 0;
+
+int
+evas_gl_thread_enabled()
+{
+   if (env_evas_gl_render_thread == -1)
+     {
+        char *env_thread = getenv("EVAS_GL_RENDER_THREAD");
+        int env_thread_value = 0;
+        if (env_thread)
+           env_thread_value = atoi(env_thread);
+
+        /* Thread rendering is forced off because direct rendering explicitly on */
+        char *env_direct_override = getenv("EVAS_GL_DIRECT_OVERRIDE");
+        int env_direct_override_value = 0;
+        if (env_direct_override)
+           env_direct_override_value = atoi(env_direct_override);
+
+        if (env_thread_value == 1 && env_direct_override_value == 0)
+          env_evas_gl_render_thread = 1;
+        else
+          env_evas_gl_render_thread = 0;
+     }
+   return env_evas_gl_render_thread &&
+      (evas_gl_enable_thread == 0);
+}
+
+int
+evas_evgl_thread_enabled()
+{
+   if (env_evas_evgl_render_thread == -1)
+     {
+        char *env_thread = getenv("EVAS_EVGL_RENDER_THREAD");
+        int env_thread_value = 0;
+        if (env_thread)
+           env_thread_value = atoi(env_thread);
+
+        if (env_thread_value)
+          env_evas_evgl_render_thread = 1;
+        else
+          env_evas_evgl_render_thread = 0;
+     }
+   return env_evas_gl_render_thread &&
+      env_evas_evgl_render_thread &&
+      (evas_evgl_enable_thread == 0);
+}
+
+int
+evas_gl_thread_force_finish()
+{
+   if (env_evas_gl_force_finish == -1)
+     {
+        if (getenv("EVAS_GL_RENDER_THREAD_FORCE_FINISH"))
+          env_evas_gl_force_finish = 1;
+        else
+          env_evas_gl_force_finish = 0;
+     }
+   return env_evas_gl_force_finish;
+}
+
+
+void evas_gl_thread_init()
+{
+#define BUILD_MEMPOOL(name) \
+   name = eina_mempool_add("chained_mempool", #name, NULL, \
+                           name##_memory_size, name##_pool_size); \
+   if (name == NULL) \
+   EINA_LOG_ERR("eina_mempool_add() failed");
+
+   BUILD_MEMPOOL(_mp_default);
+   BUILD_MEMPOOL(_mp_command);
+   BUILD_MEMPOOL(_mp_uniform);
+   BUILD_MEMPOOL(_mp_delete_object);
+   BUILD_MEMPOOL(_mp_texture);
+
+   _main_thread_id = eina_thread_self();
+}
+
+void evas_gl_thread_terminate()
+{
+   eina_mempool_del(_mp_default);
+   eina_mempool_del(_mp_command);
+   eina_mempool_del(_mp_uniform);
+   eina_mempool_del(_mp_delete_object);
+   eina_mempool_del(_mp_texture);
+}
+
+void
+evas_gl_thread_begin()
+{
+   evas_gl_enable_thread++;
+}
+
+void
+evas_gl_thread_end()
+{
+   evas_gl_enable_thread--;
+}
+
+static void
+_gl_thread_finish(void *data)
+{
+    data = data;
+}
+
+void
+evas_gl_thread_finish()
+{
+   if (evas_gl_thread_enabled())
+   {
+      evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_finish, NULL, EVAS_GL_THREAD_MODE_FINISH);
+   }
+}
+
+void
+evas_evgl_thread_begin()
+{
+   evas_evgl_enable_thread++;
+}
+
+void
+evas_evgl_thread_end()
+{
+   evas_evgl_enable_thread--;
+}
+
+static void
+_evgl_thread_finish(void *data)
+{
+    data = data;
+}
+
+void
+evas_evgl_thread_finish()
+{
+   if (evas_gl_thread_enabled())
+   {
+      evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_finish, NULL, EVAS_GL_THREAD_MODE_FINISH);
+   }
+}
+
+
+#else /* ! EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#include <dlfcn.h>
+
+int (*evas_gl_thread_enabled)();
+int (*evas_evgl_thread_enabled)();
+
+void (*evas_gl_thread_begin)();
+void (*evas_gl_thread_end)();
+void (*evas_gl_thread_finish)();
+void (*evas_evgl_thread_begin)();
+void (*evas_evgl_thread_end)();
+void (*evas_evgl_thread_finish)();
+
+void evas_gl_thread_link_init()
+{
+#define LINK2GENERIC(sym) \
+   sym = dlsym(RTLD_DEFAULT, #sym); \
+   if (!sym) ERR("Could not find function '%s'", #sym);
+
+   LINK2GENERIC(evas_gl_thread_enabled);
+   LINK2GENERIC(evas_evgl_thread_enabled);
+
+   LINK2GENERIC(evas_gl_thread_begin);
+   LINK2GENERIC(evas_gl_thread_end);
+   LINK2GENERIC(evas_gl_thread_finish);
+   LINK2GENERIC(evas_evgl_thread_begin);
+   LINK2GENERIC(evas_evgl_thread_end);
+   LINK2GENERIC(evas_evgl_thread_finish);
+
+#ifdef GL_GLES
+   _egl_thread_link_init();
+#else
+   _glx_thread_link_init();
+#endif
+   _gl_thread_link_init();
+   _evgl_thread_link_init();
+
+   _main_thread_id = eina_thread_self();
+}
+
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread.h b/src/modules/evas/engines/gl_common/evas_gl_thread.h
new file mode 100644 (file)
index 0000000..3b0d907
--- /dev/null
@@ -0,0 +1,99 @@
+#ifndef EVAS_GL_THREAD_H
+#define EVAS_GL_THREAD_H
+
+extern Eina_Thread _main_thread_id;
+
+#include "evas_gl_common.h"
+
+/* Memory Pool */
+extern Eina_Mempool *_mp_default;
+extern Eina_Mempool *_mp_command;
+extern Eina_Mempool *_mp_uniform;
+extern Eina_Mempool *_mp_delete_object;
+extern Eina_Mempool *_mp_texture;
+
+extern unsigned int _mp_default_memory_size;
+extern unsigned int _mp_command_memory_size;
+extern unsigned int _mp_uniform_memory_size;
+extern unsigned int _mp_delete_object_memory_size;
+extern unsigned int _mp_texture_memory_size;
+
+extern unsigned int _mp_default_pool_size;
+extern unsigned int _mp_command_pool_size;
+extern unsigned int _mp_uniform_pool_size;
+extern unsigned int _mp_delete_object_pool_size;
+extern unsigned int _mp_texture_pool_size;
+
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+
+EAPI int evas_gl_thread_enabled();
+EAPI int evas_evgl_thread_enabled();
+EAPI int evas_gl_thread_force_finish();
+
+EAPI void evas_gl_thread_begin();
+EAPI void evas_gl_thread_end();
+EAPI void evas_gl_thread_finish();
+EAPI void evas_evgl_thread_begin();
+EAPI void evas_evgl_thread_end();
+EAPI void evas_evgl_thread_finish();
+
+extern void evas_gl_thread_init();
+extern void evas_gl_thread_terminate();
+
+
+#else /* ! EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+extern int (*evas_gl_thread_enabled)();
+extern int (*evas_evgl_thread_enabled)();
+
+extern void (*evas_gl_thread_begin)();
+extern void (*evas_gl_thread_end)();
+extern void (*evas_gl_thread_finish)();
+extern void (*evas_evgl_thread_begin)();
+extern void (*evas_evgl_thread_end)();
+extern void (*evas_evgl_thread_finish)();
+
+extern void evas_gl_thread_link_init();
+
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#include "evas_gl_thread_gl.h"
+#ifdef GL_GLES
+#include "evas_gl_thread_egl.h"
+#else
+#include "evas_gl_thread_glx.h"
+#endif
+
+
+#endif /* EVAS_GL_THREAD_H */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_egl.c b/src/modules/evas/engines/gl_common/evas_gl_thread_egl.c
new file mode 100644 (file)
index 0000000..07bbb4a
--- /dev/null
@@ -0,0 +1,705 @@
+#include "evas_common_private.h"
+#include "evas_gl_thread.h"
+
+#ifdef GL_GLES
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+
+
+typedef struct
+{
+   EGLint return_value;
+} Evas_Thread_Command_eglGetError;
+
+static void
+_gl_thread_eglGetError(void *data)
+{
+   Evas_Thread_Command_eglGetError *thread_param = data;
+   thread_param->return_value = eglGetError();
+}
+
+EAPI EGLint
+eglGetError_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglGetError();
+
+   Evas_Thread_Command_eglGetError thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglGetError, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLenum api;
+} Evas_Thread_Command_eglBindAPI;
+
+static void
+_gl_thread_eglBindAPI(void *data)
+{
+   Evas_Thread_Command_eglBindAPI *thread_param = data;
+   thread_param->return_value = eglBindAPI(thread_param->api);
+}
+
+EAPI EGLBoolean
+eglBindAPI_thread_cmd(EGLenum api)
+{
+   if (!evas_gl_thread_enabled())
+     return eglBindAPI(api);
+
+   Evas_Thread_Command_eglBindAPI thread_param;
+   thread_param.api = api;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglBindAPI, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLenum return_value;
+} Evas_Thread_Command_eglQueryAPI;
+
+static void
+_gl_thread_eglQueryAPI(void *data)
+{
+   Evas_Thread_Command_eglQueryAPI *thread_param = data;
+   thread_param->return_value = eglQueryAPI();
+}
+
+EAPI EGLenum
+eglQueryAPI_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglQueryAPI();
+
+   Evas_Thread_Command_eglQueryAPI thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglQueryAPI, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface draw;
+   EGLSurface read;
+   EGLContext ctx;
+} Evas_Thread_Command_eglMakeCurrent;
+
+EGLContext current_thread_ctx = EGL_NO_CONTEXT;
+
+static void
+_gl_thread_eglMakeCurrent(void *data)
+{
+   Evas_Thread_Command_eglMakeCurrent *thread_param = data;
+   ERR("THREAD >> OTHER THREAD MAKECURRENT : (%p, %p, %p, %p)\n", thread_param->dpy, thread_param->draw, thread_param->read, thread_param->ctx);
+   thread_param->return_value = eglMakeCurrent(thread_param->dpy, thread_param->draw, thread_param->read, thread_param->ctx);
+   if (thread_param->return_value == EGL_TRUE)
+     current_thread_ctx = thread_param->ctx;
+}
+
+EAPI EGLBoolean
+eglMakeCurrent_thread_cmd(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
+{
+   if (!evas_gl_thread_enabled())
+     return eglMakeCurrent(dpy, draw, read, ctx);
+
+   Evas_Thread_Command_eglMakeCurrent thread_param;
+   thread_param.dpy = dpy;
+   thread_param.draw = draw;
+   thread_param.read = read;
+   thread_param.ctx = ctx;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglMakeCurrent, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+EAPI EGLContext
+eglGetCurrentContext_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglGetCurrentContext();
+
+   /* Current thread is one per thread */
+   return current_thread_ctx;
+}
+
+
+
+typedef struct
+{
+   EGLDisplay return_value;
+   EGLint     readdraw;
+} Evas_Thread_Command_eglGetCurrentSurface;
+
+static void
+_gl_thread_eglGetCurrentSurface(void *data)
+{
+   Evas_Thread_Command_eglGetCurrentSurface *thread_param = data;
+   thread_param->return_value = eglGetCurrentSurface(thread_param->readdraw);
+}
+
+EAPI EGLSurface
+eglGetCurrentSurface_thread_cmd(EGLint readdraw)
+{
+   if (!evas_gl_thread_enabled())
+     return eglGetCurrentSurface(readdraw);
+
+   Evas_Thread_Command_eglGetCurrentSurface thread_param;
+   thread_param.readdraw = readdraw;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglGetCurrentSurface, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLDisplay return_value;
+} Evas_Thread_Command_eglGetCurrentDisplay;
+
+static void
+_gl_thread_eglGetCurrentDisplay(void *data)
+{
+   Evas_Thread_Command_eglGetCurrentDisplay *thread_param = data;
+   thread_param->return_value = eglGetCurrentDisplay();
+}
+
+EAPI EGLDisplay
+eglGetCurrentDisplay_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglGetCurrentDisplay();
+
+   Evas_Thread_Command_eglGetCurrentDisplay thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglGetCurrentDisplay, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+} Evas_Thread_Command_eglReleaseThread;
+
+static void
+_gl_thread_eglReleaseThread(void *data)
+{
+   Evas_Thread_Command_eglReleaseThread *thread_param = data;
+   thread_param->return_value = eglReleaseThread();
+}
+
+EAPI EGLBoolean
+eglReleaseThread_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglReleaseThread();
+
+   Evas_Thread_Command_eglReleaseThread thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglReleaseThread, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface surface;
+   EGLint attribute;
+   EGLint *value;
+} Evas_Thread_Command_eglQuerySurface;
+
+static void
+_gl_thread_eglQuerySurface(void *data)
+{
+   Evas_Thread_Command_eglQuerySurface *thread_param = data;
+   thread_param->return_value = eglQuerySurface(thread_param->dpy, thread_param->surface, thread_param->attribute, thread_param->value);
+}
+
+EAPI EGLBoolean
+eglQuerySurface_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     return eglQuerySurface(dpy, surface, attribute, value);
+
+   Evas_Thread_Command_eglQuerySurface thread_param;
+   thread_param.dpy = dpy;
+   thread_param.surface = surface;
+   thread_param.attribute = attribute;
+   thread_param.value = value;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglQuerySurface, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLint interval;
+} Evas_Thread_Command_eglSwapInterval;
+
+static void
+_gl_thread_eglSwapInterval(void *data)
+{
+   Evas_Thread_Command_eglSwapInterval *thread_param = data;
+   thread_param->return_value = eglSwapInterval(thread_param->dpy, thread_param->interval);
+}
+
+EAPI EGLBoolean
+eglSwapInterval_thread_cmd(EGLDisplay dpy, EGLint interval)
+{
+   if (!evas_gl_thread_enabled())
+     return eglSwapInterval(dpy, interval);
+
+   Evas_Thread_Command_eglSwapInterval thread_param;
+   thread_param.dpy = dpy;
+   thread_param.interval = interval;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglSwapInterval, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+} Evas_Thread_Command_eglWaitGL;
+
+static void
+_gl_thread_eglWaitGL(void *data)
+{
+   Evas_Thread_Command_eglWaitGL *thread_param = data;
+   thread_param->return_value = eglWaitGL();
+}
+
+EAPI EGLBoolean
+eglWaitGL_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     return eglWaitGL();
+
+   Evas_Thread_Command_eglWaitGL thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglWaitGL, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface surface;
+} Evas_Thread_Command_eglSwapBuffers;
+
+static void
+_gl_thread_eglSwapBuffers(void *data)
+{
+   Evas_Thread_Command_eglSwapBuffers *thread_param = data;
+   thread_param->return_value = eglSwapBuffers(thread_param->dpy, thread_param->surface);
+}
+
+EAPI EGLBoolean
+eglSwapBuffers_thread_cmd(EGLDisplay dpy, EGLSurface surface)
+{
+   if (!evas_gl_thread_enabled())
+     return eglSwapBuffers(dpy, surface);
+
+   Evas_Thread_Command_eglSwapBuffers thread_param;
+   thread_param.dpy = dpy;
+   thread_param.surface = surface;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglSwapBuffers, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface surface;
+   EGLint *rects;
+   EGLint n_rects;
+} Evas_Thread_Command_eglSwapBuffersWithDamage;
+
+EGLBoolean (*orig_evas_eglSwapBuffersWithDamage)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+EAPI void
+eglSwapBuffersWithDamage_orig_evas_set(void *func)
+{
+   orig_evas_eglSwapBuffersWithDamage = func;
+}
+
+EAPI void *
+eglSwapBuffersWithDamage_orig_evas_get()
+{
+   return orig_evas_eglSwapBuffersWithDamage;
+}
+
+static void
+_gl_thread_eglSwapBuffersWithDamage(void *data)
+{
+   Evas_Thread_Command_eglSwapBuffersWithDamage *thread_param = data;
+   thread_param->return_value = orig_evas_eglSwapBuffersWithDamage(thread_param->dpy, thread_param->surface, thread_param->rects, thread_param->n_rects);
+}
+
+EAPI EGLBoolean
+eglSwapBuffersWithDamage_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
+{
+   if (!evas_gl_thread_enabled())
+     return orig_evas_eglSwapBuffersWithDamage(dpy, surface, rects, n_rects);
+
+   Evas_Thread_Command_eglSwapBuffersWithDamage thread_param;
+   thread_param.dpy = dpy;
+   thread_param.surface = surface;
+   thread_param.rects = rects;
+   thread_param.n_rects = n_rects;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglSwapBuffersWithDamage, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface surface;
+   EGLint *rects;
+   EGLint n_rects;
+} Evas_Thread_Command_eglSetDamageRegion;
+
+EGLBoolean (*orig_evas_eglSetDamageRegion)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+EAPI void
+eglSetDamageRegion_orig_evas_set(void *func)
+{
+   orig_evas_eglSetDamageRegion = func;
+}
+
+EAPI void *
+eglSetDamageRegion_orig_evas_get()
+{
+   return orig_evas_eglSetDamageRegion;
+}
+
+static void
+_gl_thread_eglSetDamageRegion(void *data)
+{
+   Evas_Thread_Command_eglSetDamageRegion *thread_param = data;
+   thread_param->return_value = orig_evas_eglSetDamageRegion(thread_param->dpy, thread_param->surface, thread_param->rects, thread_param->n_rects);
+}
+
+EAPI EGLBoolean
+eglSetDamageRegion_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
+{
+   if (!evas_gl_thread_enabled())
+     return orig_evas_eglSetDamageRegion(dpy, surface, rects, n_rects);
+
+   Evas_Thread_Command_eglSetDamageRegion thread_param;
+   thread_param.dpy = dpy;
+   thread_param.surface = surface;
+   thread_param.rects = rects;
+   thread_param.n_rects = n_rects;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglSetDamageRegion, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   void *buffer;
+   EGLint attribute;
+   EGLint *value;
+} Evas_Thread_Command_eglQueryWaylandBuffer;
+
+EGLBoolean (*orig_evas_eglQueryWaylandBuffer)(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
+
+EAPI void
+eglQueryWaylandBuffer_orig_evas_set(void *func)
+{
+   orig_evas_eglQueryWaylandBuffer = func;
+}
+
+EAPI void *
+eglQueryWaylandBuffer_orig_evas_get()
+{
+   return orig_evas_eglQueryWaylandBuffer;
+}
+
+static void
+_gl_thread_eglQueryWaylandBuffer(void *data)
+{
+   Evas_Thread_Command_eglQueryWaylandBuffer *thread_param = data;
+   thread_param->return_value = orig_evas_eglQueryWaylandBuffer(thread_param->dpy, thread_param->buffer, thread_param->attribute, thread_param->value);
+}
+
+EAPI EGLBoolean
+eglQueryWaylandBuffer_thread_cmd(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     return orig_evas_eglQueryWaylandBuffer(dpy, buffer, attribute, value);
+
+   Evas_Thread_Command_eglQueryWaylandBuffer thread_param;
+   thread_param.dpy = dpy;
+   thread_param.buffer = buffer;
+   thread_param.attribute = attribute;
+   thread_param.value = value;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, _gl_thread_eglQueryWaylandBuffer, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+/***** EVAS GL *****/
+
+typedef struct
+{
+   EGLint return_value;
+} Evas_GL_Thread_Command_eglGetError;
+
+static void
+_evgl_thread_eglGetError(void *data)
+{
+   Evas_GL_Thread_Command_eglGetError *thread_param = data;
+   thread_param->return_value = eglGetError();
+}
+
+EAPI EGLint
+eglGetError_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     return eglGetError();
+
+   Evas_GL_Thread_Command_eglGetError thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_eglGetError, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+EGLContext current_evgl_thread_context = EGL_NO_CONTEXT;
+
+
+typedef struct
+{
+   EGLBoolean return_value;
+   EGLDisplay dpy;
+   EGLSurface draw;
+   EGLSurface read;
+   EGLContext ctx;
+} Evas_GL_Thread_Command_eglMakeCurrent;
+
+static void
+_evgl_thread_eglMakeCurrent(void *data)
+{
+   Evas_GL_Thread_Command_eglMakeCurrent *thread_param = data;
+   ERR("THREAD >> EVGL OTHER THREAD MAKECURRENT : (%p, %p, %p, %p)\n", thread_param->dpy, thread_param->draw, thread_param->read, thread_param->ctx);
+   thread_param->return_value = eglMakeCurrent(thread_param->dpy, thread_param->draw, thread_param->read, thread_param->ctx);
+   if (thread_param->return_value == EGL_TRUE)
+          current_evgl_thread_context = thread_param->ctx;
+}
+
+EAPI EGLBoolean
+eglMakeCurrent_evgl_thread_cmd(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        if (eina_thread_self() == evas_gl_thread_get(EVAS_GL_THREAD_TYPE_EVGL))
+           ERR("THREAD >> EVGL OTHER THREAD MAKECURRENT(INNER) : (%p, %p, %p, %p)\n", dpy, draw, read, ctx);
+        return eglMakeCurrent(dpy, draw, read, ctx);
+     }
+
+   Evas_GL_Thread_Command_eglMakeCurrent thread_param;
+   thread_param.dpy = dpy;
+   thread_param.draw = draw;
+   thread_param.read = read;
+   thread_param.ctx = ctx;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_eglMakeCurrent, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLContext return_value;
+} Evas_GL_Thread_Command_eglGetCurrentContext;
+
+static void
+_evgl_thread_eglGetCurrentContext(void *data)
+{
+   Evas_GL_Thread_Command_eglGetCurrentContext *thread_param = data;
+   thread_param->return_value = eglGetCurrentContext();
+}
+
+EAPI EGLContext
+eglGetCurrentContext_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     return eglGetCurrentContext();
+
+   return current_evgl_thread_context;
+
+   Evas_GL_Thread_Command_eglGetCurrentContext thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_eglGetCurrentContext, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLDisplay return_value;
+   EGLint     readdraw;
+} Evas_GL_Thread_Command_eglGetCurrentSurface;
+
+static void
+_evgl_thread_eglGetCurrentSurface(void *data)
+{
+   Evas_GL_Thread_Command_eglGetCurrentSurface *thread_param = data;
+   thread_param->return_value = eglGetCurrentSurface(thread_param->readdraw);
+}
+
+EAPI EGLSurface
+eglGetCurrentSurface_evgl_thread_cmd(EGLint readdraw)
+{
+   if (!evas_evgl_thread_enabled())
+     return eglGetCurrentSurface(readdraw);
+
+   Evas_GL_Thread_Command_eglGetCurrentSurface thread_param;
+   thread_param.readdraw = readdraw;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_eglGetCurrentSurface, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+typedef struct
+{
+   EGLDisplay return_value;
+} Evas_GL_Thread_Command_eglGetCurrentDisplay;
+
+static void
+_evgl_thread_eglGetCurrentDisplay(void *data)
+{
+   Evas_GL_Thread_Command_eglGetCurrentDisplay *thread_param = data;
+   thread_param->return_value = eglGetCurrentDisplay();
+}
+
+EAPI EGLDisplay
+eglGetCurrentDisplay_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     return eglGetCurrentDisplay();
+
+   Evas_GL_Thread_Command_eglGetCurrentDisplay thread_param;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL, _evgl_thread_eglGetCurrentDisplay, &thread_param, EVAS_GL_THREAD_MODE_FINISH);
+   return thread_param.return_value;
+}
+
+
+
+#else /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#include <dlfcn.h>
+
+EGLint (*eglGetError_thread_cmd)();
+EGLBoolean (*eglBindAPI_thread_cmd)(EGLenum api);
+EGLenum (*eglQueryAPI_thread_cmd)();
+EGLBoolean (*eglMakeCurrent_thread_cmd)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+EGLContext (*eglGetCurrentContext_thread_cmd)(void);
+EGLSurface (*eglGetCurrentSurface_thread_cmd)(EGLint readdraw);
+EGLDisplay (*eglGetCurrentDisplay_thread_cmd)(void);
+EGLBoolean (*eglReleaseThread_thread_cmd)();
+
+EGLBoolean (*eglQuerySurface_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
+EGLBoolean (*eglSwapInterval_thread_cmd)(EGLDisplay dpy, EGLint interval);
+EGLBoolean (*eglWaitGL_thread_cmd)(void);
+EGLBoolean (*eglSwapBuffers_thread_cmd)(EGLDisplay dpy, EGLSurface surface);
+
+void (*eglSwapBuffersWithDamage_orig_evas_set)(void *func);
+void *(*eglSwapBuffersWithDamage_orig_evas_get)();
+EGLBoolean (*eglSwapBuffersWithDamage_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+void (*eglSetDamageRegion_orig_evas_set)(void *func);
+void *(*eglSetDamageRegion_orig_evas_get)();
+EGLBoolean (*eglSetDamageRegion_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+void (*eglQueryWaylandBuffer_orig_evas_set)(void *func);
+void *(*eglQueryWaylandBuffer_orig_evas_get)();
+EGLBoolean (*eglQueryWaylandBuffer_thread_cmd)(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
+
+
+/***** EVAS GL *****/
+
+EGLint (*eglGetError_evgl_thread_cmd)();
+EGLBoolean (*eglMakeCurrent_evgl_thread_cmd)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+EGLContext (*eglGetCurrentContext_evgl_thread_cmd)(void);
+EGLSurface (*eglGetCurrentSurface_evgl_thread_cmd)(EGLint readdraw);
+EGLDisplay (*eglGetCurrentDisplay_evgl_thread_cmd)(void);
+
+
+void _egl_thread_link_init()
+{
+#define LINK2GENERIC(sym) \
+   sym = dlsym(RTLD_DEFAULT, #sym); \
+   if (!sym) ERR("Could not find function '%s'", #sym);
+
+   // Get function pointer to evas_gl_common that is now provided through the link of GL_Generic.
+   LINK2GENERIC(eglGetError_thread_cmd);
+   LINK2GENERIC(eglBindAPI_thread_cmd);
+   LINK2GENERIC(eglQueryAPI_thread_cmd);
+   LINK2GENERIC(eglMakeCurrent_thread_cmd);
+   LINK2GENERIC(eglGetCurrentContext_thread_cmd);
+   LINK2GENERIC(eglGetCurrentSurface_thread_cmd);
+   LINK2GENERIC(eglGetCurrentDisplay_thread_cmd);
+   LINK2GENERIC(eglReleaseThread_thread_cmd);
+
+   LINK2GENERIC(eglQuerySurface_thread_cmd);
+   LINK2GENERIC(eglSwapInterval_thread_cmd);
+   LINK2GENERIC(eglWaitGL_thread_cmd);
+   LINK2GENERIC(eglSwapBuffers_thread_cmd);
+
+   LINK2GENERIC(eglSwapBuffersWithDamage_orig_evas_set);
+   LINK2GENERIC(eglSwapBuffersWithDamage_orig_evas_get);
+   LINK2GENERIC(eglSwapBuffersWithDamage_thread_cmd);
+
+   LINK2GENERIC(eglSetDamageRegion_orig_evas_set);
+   LINK2GENERIC(eglSetDamageRegion_orig_evas_get);
+   LINK2GENERIC(eglSetDamageRegion_thread_cmd);
+
+   LINK2GENERIC(eglQueryWaylandBuffer_orig_evas_set);
+   LINK2GENERIC(eglQueryWaylandBuffer_orig_evas_get);
+   LINK2GENERIC(eglQueryWaylandBuffer_thread_cmd);
+
+   /***** EVAS GL *****/
+
+   LINK2GENERIC(eglGetError_evgl_thread_cmd);
+   LINK2GENERIC(eglMakeCurrent_evgl_thread_cmd);
+   LINK2GENERIC(eglGetCurrentContext_evgl_thread_cmd);
+   LINK2GENERIC(eglGetCurrentSurface_evgl_thread_cmd);
+   LINK2GENERIC(eglGetCurrentDisplay_evgl_thread_cmd);
+}
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+#endif
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_egl.h b/src/modules/evas/engines/gl_common/evas_gl_thread_egl.h
new file mode 100644 (file)
index 0000000..e90ea52
--- /dev/null
@@ -0,0 +1,127 @@
+#ifndef EVAS_GL_THREAD_EGL_H
+#define EVAS_GL_THREAD_EGL_H
+
+#ifdef GL_GLES
+
+#include <EGL/egl.h>
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+/* EGL 1.4 Referencing to Thread Local Storage */
+EAPI EGLint eglGetError_thread_cmd();
+EAPI EGLBoolean eglBindAPI_thread_cmd(EGLenum api);
+EAPI EGLenum eglQueryAPI_thread_cmd();
+EAPI EGLBoolean eglMakeCurrent_thread_cmd(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+EAPI EGLContext eglGetCurrentContext_thread_cmd(void);
+EAPI EGLSurface eglGetCurrentSurface_thread_cmd(EGLint readdraw);
+EAPI EGLDisplay eglGetCurrentDisplay_thread_cmd(void);
+EAPI EGLBoolean eglReleaseThread_thread_cmd();
+
+
+/* EGL 1.4 Sequential Operations */
+EAPI EGLBoolean eglQuerySurface_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
+EAPI EGLBoolean eglSwapInterval_thread_cmd(EGLDisplay dpy, EGLint interval);
+EAPI EGLBoolean eglWaitGL_thread_cmd(void);
+EAPI EGLBoolean eglSwapBuffers_thread_cmd(EGLDisplay dpy, EGLSurface surface);
+
+EAPI void eglSwapBuffersWithDamage_orig_evas_set(void *func);
+EAPI void *eglSwapBuffersWithDamage_orig_evas_get();
+EAPI EGLBoolean eglSwapBuffersWithDamage_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+EAPI void eglSetDamageRegion_orig_evas_set(void *func);
+EAPI void *eglSetDamageRegion_orig_evas_get();
+EAPI EGLBoolean eglSetDamageRegion_thread_cmd(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+
+EAPI void eglQueryWaylandBuffer_orig_evas_set(void *func);
+EAPI void *eglQueryWaylandBuffer_orig_evas_get();
+EAPI EGLBoolean eglQueryWaylandBuffer_thread_cmd(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
+
+
+/***** EVAS GL *****/
+
+/* EGL 1.4 Referencing to Thread Local Storage */
+EAPI EGLint eglGetError_evgl_thread_cmd();
+EAPI EGLBoolean eglMakeCurrent_evgl_thread_cmd(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+EAPI EGLContext eglGetCurrentContext_evgl_thread_cmd(void);
+EAPI EGLSurface eglGetCurrentSurface_evgl_thread_cmd(EGLint readdraw);
+EAPI EGLDisplay eglGetCurrentDisplay_evgl_thread_cmd(void);
+
+
+#else /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+/* EGL 1.4 Referencing to Thread Local Storage */
+extern EGLint (*eglGetError_thread_cmd)();
+extern EGLBoolean (*eglBindAPI_thread_cmd)(EGLenum api);
+extern EGLenum (*eglQueryAPI_thread_cmd)();
+extern EGLBoolean (*eglMakeCurrent_thread_cmd)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+extern EGLContext (*eglGetCurrentContext_thread_cmd)(void);
+extern EGLSurface (*eglGetCurrentSurface_thread_cmd)(EGLint readdraw);
+extern EGLDisplay (*eglGetCurrentDisplay_thread_cmd)(void);
+extern EGLBoolean (*eglReleaseThread_thread_cmd)();
+
+
+/* EGL 1.4 Sequential Operations */
+extern EGLBoolean (*eglQuerySurface_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
+extern EGLBoolean (*eglSwapInterval_thread_cmd)(EGLDisplay dpy, EGLint interval);
+extern EGLBoolean (*eglWaitGL_thread_cmd)(void);
+extern EGLBoolean (*eglSwapBuffers_thread_cmd)(EGLDisplay dpy, EGLSurface surface);
+extern void (*eglSwapBuffersWithDamage_orig_evas_set)(void *func);
+extern void *(*eglSwapBuffersWithDamage_orig_evas_get)();
+extern EGLBoolean (*eglSwapBuffersWithDamage_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+extern void (*eglSetDamageRegion_orig_evas_set)(void *func);
+extern void *(*eglSetDamageRegion_orig_evas_get)();
+extern EGLBoolean (*eglSetDamageRegion_thread_cmd)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
+extern void (*eglQueryWaylandBuffer_orig_evas_set)(void *func);
+extern void *(*eglQueryWaylandBuffer_orig_evas_get)();
+extern EGLBoolean (*eglQueryWaylandBuffer_thread_cmd)(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
+
+
+/***** EVAS GL *****/
+
+/* EGL 1.4 Referencing to Thread Local Storage */
+extern EGLint (*eglGetError_evgl_thread_cmd)();
+extern EGLBoolean (*eglMakeCurrent_evgl_thread_cmd)(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
+extern EGLContext (*eglGetCurrentContext_evgl_thread_cmd)(void);
+extern EGLSurface (*eglGetCurrentSurface_evgl_thread_cmd)(EGLint readdraw);
+extern EGLDisplay (*eglGetCurrentDisplay_evgl_thread_cmd)(void);
+
+
+
+extern void _egl_thread_link_init();
+
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+#endif /* GL_GLES */
+
+#define SCORE_EGL_MOVE_TO_OTHER_THREAD
+
+#endif
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.c b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.c
new file mode 100644 (file)
index 0000000..6858144
--- /dev/null
@@ -0,0 +1,32833 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+/*
+   void
+   glActiveTexture(GLenum texture);
+ */
+
+typedef struct
+{
+   GLenum texture;
+
+} EVGL_API_Thread_Command_glActiveTexture;
+
+void (*orig_evgl_api_glActiveTexture)(GLenum texture);
+
+static void
+_evgl_api_thread_glActiveTexture(void *data)
+{
+   EVGL_API_Thread_Command_glActiveTexture *thread_param =
+      (EVGL_API_Thread_Command_glActiveTexture *)data;
+
+   orig_evgl_api_glActiveTexture(thread_param->texture);
+
+}
+
+EAPI void
+glActiveTexture_evgl_api_thread_cmd(GLenum texture)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glActiveTexture(texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glActiveTexture thread_param_local;
+   EVGL_API_Thread_Command_glActiveTexture *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glActiveTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glAttachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glAttachShader;
+
+void (*orig_evgl_api_glAttachShader)(GLuint program, GLuint shader);
+
+static void
+_evgl_api_thread_glAttachShader(void *data)
+{
+   EVGL_API_Thread_Command_glAttachShader *thread_param =
+      (EVGL_API_Thread_Command_glAttachShader *)data;
+
+   orig_evgl_api_glAttachShader(thread_param->program,
+                                thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glAttachShader_evgl_api_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glAttachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glAttachShader thread_param_local;
+   EVGL_API_Thread_Command_glAttachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glAttachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glAttachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glAttachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindAttribLocation(GLuint program, GLuint index, const char* name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   const char* name;
+
+} EVGL_API_Thread_Command_glBindAttribLocation;
+
+void (*orig_evgl_api_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
+
+static void
+_evgl_api_thread_glBindAttribLocation(void *data)
+{
+   EVGL_API_Thread_Command_glBindAttribLocation *thread_param =
+      (EVGL_API_Thread_Command_glBindAttribLocation *)data;
+
+   orig_evgl_api_glBindAttribLocation(thread_param->program,
+                                      thread_param->index,
+                                      thread_param->name);
+
+}
+
+EAPI void
+glBindAttribLocation_evgl_api_thread_cmd(GLuint program, GLuint index, const char* name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindAttribLocation(program, index, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindAttribLocation thread_param_local;
+   EVGL_API_Thread_Command_glBindAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindAttribLocation,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindBuffer(GLenum target, GLuint buffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint buffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindBuffer;
+
+void (*orig_evgl_api_glBindBuffer)(GLenum target, GLuint buffer);
+
+static void
+_evgl_api_thread_glBindBuffer(void *data)
+{
+   EVGL_API_Thread_Command_glBindBuffer *thread_param =
+      (EVGL_API_Thread_Command_glBindBuffer *)data;
+
+   orig_evgl_api_glBindBuffer(thread_param->target,
+                              thread_param->buffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindBuffer_evgl_api_thread_cmd(GLenum target, GLuint buffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindBuffer(target, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindBuffer thread_param_local;
+   EVGL_API_Thread_Command_glBindBuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindBuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindBuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindBuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindFramebuffer(GLenum target, GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint framebuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindFramebuffer;
+
+void (*orig_evgl_api_glBindFramebuffer)(GLenum target, GLuint framebuffer);
+
+static void
+_evgl_api_thread_glBindFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glBindFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glBindFramebuffer *)data;
+
+   orig_evgl_api_glBindFramebuffer(thread_param->target,
+                                   thread_param->framebuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindFramebuffer_evgl_api_thread_cmd(GLenum target, GLuint framebuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindFramebuffer(target, framebuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glBindFramebuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindFramebuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindFramebuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindRenderbuffer;
+
+void (*orig_evgl_api_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glBindRenderbuffer(void *data)
+{
+   EVGL_API_Thread_Command_glBindRenderbuffer *thread_param =
+      (EVGL_API_Thread_Command_glBindRenderbuffer *)data;
+
+   orig_evgl_api_glBindRenderbuffer(thread_param->target,
+                                    thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindRenderbuffer_evgl_api_thread_cmd(GLenum target, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindRenderbuffer(target, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindRenderbuffer thread_param_local;
+   EVGL_API_Thread_Command_glBindRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindTexture(GLenum target, GLuint texture);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint texture;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindTexture;
+
+void (*orig_evgl_api_glBindTexture)(GLenum target, GLuint texture);
+
+static void
+_evgl_api_thread_glBindTexture(void *data)
+{
+   EVGL_API_Thread_Command_glBindTexture *thread_param =
+      (EVGL_API_Thread_Command_glBindTexture *)data;
+
+   orig_evgl_api_glBindTexture(thread_param->target,
+                               thread_param->texture);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindTexture_evgl_api_thread_cmd(GLenum target, GLuint texture)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindTexture(target, texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindTexture thread_param_local;
+   EVGL_API_Thread_Command_glBindTexture *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindTexture *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindTexture));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ */
+
+typedef struct
+{
+   GLclampf red;
+   GLclampf green;
+   GLclampf blue;
+   GLclampf alpha;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBlendColor;
+
+void (*orig_evgl_api_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+
+static void
+_evgl_api_thread_glBlendColor(void *data)
+{
+   EVGL_API_Thread_Command_glBlendColor *thread_param =
+      (EVGL_API_Thread_Command_glBlendColor *)data;
+
+   orig_evgl_api_glBlendColor(thread_param->red,
+                              thread_param->green,
+                              thread_param->blue,
+                              thread_param->alpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendColor_evgl_api_thread_cmd(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendColor thread_param_local;
+   EVGL_API_Thread_Command_glBlendColor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBlendColor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBlendColor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendEquation(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBlendEquation;
+
+void (*orig_evgl_api_glBlendEquation)(GLenum mode);
+
+static void
+_evgl_api_thread_glBlendEquation(void *data)
+{
+   EVGL_API_Thread_Command_glBlendEquation *thread_param =
+      (EVGL_API_Thread_Command_glBlendEquation *)data;
+
+   orig_evgl_api_glBlendEquation(thread_param->mode);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendEquation_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendEquation(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendEquation thread_param_local;
+   EVGL_API_Thread_Command_glBlendEquation *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBlendEquation *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBlendEquation));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendEquation,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+ */
+
+typedef struct
+{
+   GLenum modeRGB;
+   GLenum modeAlpha;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBlendEquationSeparate;
+
+void (*orig_evgl_api_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
+
+static void
+_evgl_api_thread_glBlendEquationSeparate(void *data)
+{
+   EVGL_API_Thread_Command_glBlendEquationSeparate *thread_param =
+      (EVGL_API_Thread_Command_glBlendEquationSeparate *)data;
+
+   orig_evgl_api_glBlendEquationSeparate(thread_param->modeRGB,
+                                         thread_param->modeAlpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendEquationSeparate_evgl_api_thread_cmd(GLenum modeRGB, GLenum modeAlpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendEquationSeparate(modeRGB, modeAlpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendEquationSeparate thread_param_local;
+   EVGL_API_Thread_Command_glBlendEquationSeparate *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBlendEquationSeparate *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBlendEquationSeparate));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->modeRGB = modeRGB;
+   thread_param->modeAlpha = modeAlpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendEquationSeparate,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendFunc(GLenum sfactor, GLenum dfactor);
+ */
+
+typedef struct
+{
+   GLenum sfactor;
+   GLenum dfactor;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBlendFunc;
+
+void (*orig_evgl_api_glBlendFunc)(GLenum sfactor, GLenum dfactor);
+
+static void
+_evgl_api_thread_glBlendFunc(void *data)
+{
+   EVGL_API_Thread_Command_glBlendFunc *thread_param =
+      (EVGL_API_Thread_Command_glBlendFunc *)data;
+
+   orig_evgl_api_glBlendFunc(thread_param->sfactor,
+                             thread_param->dfactor);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendFunc_evgl_api_thread_cmd(GLenum sfactor, GLenum dfactor)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendFunc(sfactor, dfactor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendFunc thread_param_local;
+   EVGL_API_Thread_Command_glBlendFunc *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBlendFunc *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBlendFunc));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->sfactor = sfactor;
+   thread_param->dfactor = dfactor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+ */
+
+typedef struct
+{
+   GLenum srcRGB;
+   GLenum dstRGB;
+   GLenum srcAlpha;
+   GLenum dstAlpha;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBlendFuncSeparate;
+
+void (*orig_evgl_api_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+
+static void
+_evgl_api_thread_glBlendFuncSeparate(void *data)
+{
+   EVGL_API_Thread_Command_glBlendFuncSeparate *thread_param =
+      (EVGL_API_Thread_Command_glBlendFuncSeparate *)data;
+
+   orig_evgl_api_glBlendFuncSeparate(thread_param->srcRGB,
+                                     thread_param->dstRGB,
+                                     thread_param->srcAlpha,
+                                     thread_param->dstAlpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendFuncSeparate_evgl_api_thread_cmd(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendFuncSeparate thread_param_local;
+   EVGL_API_Thread_Command_glBlendFuncSeparate *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBlendFuncSeparate *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBlendFuncSeparate));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->srcRGB = srcRGB;
+   thread_param->dstRGB = dstRGB;
+   thread_param->srcAlpha = srcAlpha;
+   thread_param->dstAlpha = dstAlpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendFuncSeparate,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizeiptr size;
+   const void* data;
+   GLenum usage;
+
+} EVGL_API_Thread_Command_glBufferData;
+
+void (*orig_evgl_api_glBufferData)(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+
+static void
+_evgl_api_thread_glBufferData(void *data)
+{
+   EVGL_API_Thread_Command_glBufferData *thread_param =
+      (EVGL_API_Thread_Command_glBufferData *)data;
+
+   orig_evgl_api_glBufferData(thread_param->target,
+                              thread_param->size,
+                              thread_param->data,
+                              thread_param->usage);
+
+}
+
+EAPI void
+glBufferData_evgl_api_thread_cmd(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBufferData(target, size, data, usage);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBufferData thread_param_local;
+   EVGL_API_Thread_Command_glBufferData *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->size = size;
+   thread_param->data = data;
+   thread_param->usage = usage;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBufferData,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLintptr offset;
+   GLsizeiptr size;
+   const void* data;
+
+} EVGL_API_Thread_Command_glBufferSubData;
+
+void (*orig_evgl_api_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+
+static void
+_evgl_api_thread_glBufferSubData(void *data)
+{
+   EVGL_API_Thread_Command_glBufferSubData *thread_param =
+      (EVGL_API_Thread_Command_glBufferSubData *)data;
+
+   orig_evgl_api_glBufferSubData(thread_param->target,
+                                 thread_param->offset,
+                                 thread_param->size,
+                                 thread_param->data);
+
+}
+
+EAPI void
+glBufferSubData_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBufferSubData(target, offset, size, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBufferSubData thread_param_local;
+   EVGL_API_Thread_Command_glBufferSubData *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->offset = offset;
+   thread_param->size = size;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBufferSubData,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glCheckFramebufferStatus(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLenum target;
+
+} EVGL_API_Thread_Command_glCheckFramebufferStatus;
+
+GLenum (*orig_evgl_api_glCheckFramebufferStatus)(GLenum target);
+
+static void
+_evgl_api_thread_glCheckFramebufferStatus(void *data)
+{
+   EVGL_API_Thread_Command_glCheckFramebufferStatus *thread_param =
+      (EVGL_API_Thread_Command_glCheckFramebufferStatus *)data;
+
+   thread_param->return_value = orig_evgl_api_glCheckFramebufferStatus(thread_param->target);
+
+}
+
+EAPI GLenum
+glCheckFramebufferStatus_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glCheckFramebufferStatus(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCheckFramebufferStatus thread_param_local;
+   EVGL_API_Thread_Command_glCheckFramebufferStatus *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCheckFramebufferStatus,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glClear(GLbitfield mask);
+ */
+
+typedef struct
+{
+   GLbitfield mask;
+
+} EVGL_API_Thread_Command_glClear;
+
+void (*orig_evgl_api_glClear)(GLbitfield mask);
+
+static void
+_evgl_api_thread_glClear(void *data)
+{
+   EVGL_API_Thread_Command_glClear *thread_param =
+      (EVGL_API_Thread_Command_glClear *)data;
+
+   orig_evgl_api_glClear(thread_param->mask);
+
+}
+
+EAPI void
+glClear_evgl_api_thread_cmd(GLbitfield mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClear(mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClear thread_param_local;
+   EVGL_API_Thread_Command_glClear *thread_param = &thread_param_local;
+
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClear,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ */
+
+typedef struct
+{
+   GLclampf red;
+   GLclampf green;
+   GLclampf blue;
+   GLclampf alpha;
+
+} EVGL_API_Thread_Command_glClearColor;
+
+void (*orig_evgl_api_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+
+static void
+_evgl_api_thread_glClearColor(void *data)
+{
+   EVGL_API_Thread_Command_glClearColor *thread_param =
+      (EVGL_API_Thread_Command_glClearColor *)data;
+
+   orig_evgl_api_glClearColor(thread_param->red,
+                              thread_param->green,
+                              thread_param->blue,
+                              thread_param->alpha);
+
+}
+
+EAPI void
+glClearColor_evgl_api_thread_cmd(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearColor thread_param_local;
+   EVGL_API_Thread_Command_glClearColor *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearDepthf(GLclampf depth);
+ */
+
+typedef struct
+{
+   GLclampf depth;
+
+} EVGL_API_Thread_Command_glClearDepthf;
+
+void (*orig_evgl_api_glClearDepthf)(GLclampf depth);
+
+static void
+_evgl_api_thread_glClearDepthf(void *data)
+{
+   EVGL_API_Thread_Command_glClearDepthf *thread_param =
+      (EVGL_API_Thread_Command_glClearDepthf *)data;
+
+   orig_evgl_api_glClearDepthf(thread_param->depth);
+
+}
+
+EAPI void
+glClearDepthf_evgl_api_thread_cmd(GLclampf depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearDepthf(depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearDepthf thread_param_local;
+   EVGL_API_Thread_Command_glClearDepthf *thread_param = &thread_param_local;
+
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearDepthf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearStencil(GLint s);
+ */
+
+typedef struct
+{
+   GLint s;
+
+} EVGL_API_Thread_Command_glClearStencil;
+
+void (*orig_evgl_api_glClearStencil)(GLint s);
+
+static void
+_evgl_api_thread_glClearStencil(void *data)
+{
+   EVGL_API_Thread_Command_glClearStencil *thread_param =
+      (EVGL_API_Thread_Command_glClearStencil *)data;
+
+   orig_evgl_api_glClearStencil(thread_param->s);
+
+}
+
+EAPI void
+glClearStencil_evgl_api_thread_cmd(GLint s)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearStencil(s);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearStencil thread_param_local;
+   EVGL_API_Thread_Command_glClearStencil *thread_param = &thread_param_local;
+
+   thread_param->s = s;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearStencil,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+ */
+
+typedef struct
+{
+   GLboolean red;
+   GLboolean green;
+   GLboolean blue;
+   GLboolean alpha;
+
+} EVGL_API_Thread_Command_glColorMask;
+
+void (*orig_evgl_api_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+
+static void
+_evgl_api_thread_glColorMask(void *data)
+{
+   EVGL_API_Thread_Command_glColorMask *thread_param =
+      (EVGL_API_Thread_Command_glColorMask *)data;
+
+   orig_evgl_api_glColorMask(thread_param->red,
+                             thread_param->green,
+                             thread_param->blue,
+                             thread_param->alpha);
+
+}
+
+EAPI void
+glColorMask_evgl_api_thread_cmd(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColorMask(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColorMask thread_param_local;
+   EVGL_API_Thread_Command_glColorMask *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColorMask,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompileShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glCompileShader;
+
+void (*orig_evgl_api_glCompileShader)(GLuint shader);
+
+static void
+_evgl_api_thread_glCompileShader(void *data)
+{
+   EVGL_API_Thread_Command_glCompileShader *thread_param =
+      (EVGL_API_Thread_Command_glCompileShader *)data;
+
+   orig_evgl_api_glCompileShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompileShader_evgl_api_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompileShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompileShader thread_param_local;
+   EVGL_API_Thread_Command_glCompileShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glCompileShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glCompileShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompileShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLsizei imageSize;
+   const void* data;
+   int command_allocated;
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_API_Thread_Command_glCompressedTexImage2D;
+
+void (*orig_evgl_api_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+
+static void
+_evgl_api_thread_glCompressedTexImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexImage2D *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexImage2D *)data;
+
+   orig_evgl_api_glCompressedTexImage2D(thread_param->target,
+                                        thread_param->level,
+                                        thread_param->internalformat,
+                                        thread_param->width,
+                                        thread_param->height,
+                                        thread_param->border,
+                                        thread_param->imageSize,
+                                        thread_param->data);
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexImage2D thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glCompressedTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glCompressedTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLsizei imageSize;
+   const void* data;
+   int command_allocated;
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_API_Thread_Command_glCompressedTexSubImage2D;
+
+void (*orig_evgl_api_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+
+static void
+_evgl_api_thread_glCompressedTexSubImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexSubImage2D *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexSubImage2D *)data;
+
+   orig_evgl_api_glCompressedTexSubImage2D(thread_param->target,
+                                           thread_param->level,
+                                           thread_param->xoffset,
+                                           thread_param->yoffset,
+                                           thread_param->width,
+                                           thread_param->height,
+                                           thread_param->format,
+                                           thread_param->imageSize,
+                                           thread_param->data);
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexSubImage2D thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glCompressedTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glCompressedTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+
+} EVGL_API_Thread_Command_glCopyTexImage2D;
+
+void (*orig_evgl_api_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+
+static void
+_evgl_api_thread_glCopyTexImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glCopyTexImage2D *thread_param =
+      (EVGL_API_Thread_Command_glCopyTexImage2D *)data;
+
+   orig_evgl_api_glCopyTexImage2D(thread_param->target,
+                                  thread_param->level,
+                                  thread_param->internalformat,
+                                  thread_param->x,
+                                  thread_param->y,
+                                  thread_param->width,
+                                  thread_param->height,
+                                  thread_param->border);
+
+}
+
+EAPI void
+glCopyTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyTexImage2D thread_param_local;
+   EVGL_API_Thread_Command_glCopyTexImage2D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glCopyTexSubImage2D;
+
+void (*orig_evgl_api_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glCopyTexSubImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glCopyTexSubImage2D *thread_param =
+      (EVGL_API_Thread_Command_glCopyTexSubImage2D *)data;
+
+   orig_evgl_api_glCopyTexSubImage2D(thread_param->target,
+                                     thread_param->level,
+                                     thread_param->xoffset,
+                                     thread_param->yoffset,
+                                     thread_param->x,
+                                     thread_param->y,
+                                     thread_param->width,
+                                     thread_param->height);
+
+}
+
+EAPI void
+glCopyTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyTexSubImage2D thread_param_local;
+   EVGL_API_Thread_Command_glCopyTexSubImage2D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glCreateProgram(void);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+
+} EVGL_API_Thread_Command_glCreateProgram;
+
+GLuint (*orig_evgl_api_glCreateProgram)(void);
+
+static void
+_evgl_api_thread_glCreateProgram(void *data)
+{
+   EVGL_API_Thread_Command_glCreateProgram *thread_param =
+      (EVGL_API_Thread_Command_glCreateProgram *)data;
+
+   thread_param->return_value = orig_evgl_api_glCreateProgram();
+
+}
+
+EAPI GLuint
+glCreateProgram_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glCreateProgram();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCreateProgram thread_param_local;
+   EVGL_API_Thread_Command_glCreateProgram *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCreateProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLuint
+   glCreateShader(GLenum type);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLenum type;
+
+} EVGL_API_Thread_Command_glCreateShader;
+
+GLuint (*orig_evgl_api_glCreateShader)(GLenum type);
+
+static void
+_evgl_api_thread_glCreateShader(void *data)
+{
+   EVGL_API_Thread_Command_glCreateShader *thread_param =
+      (EVGL_API_Thread_Command_glCreateShader *)data;
+
+   thread_param->return_value = orig_evgl_api_glCreateShader(thread_param->type);
+
+}
+
+EAPI GLuint
+glCreateShader_evgl_api_thread_cmd(GLenum type)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glCreateShader(type);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCreateShader thread_param_local;
+   EVGL_API_Thread_Command_glCreateShader *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCreateShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glCullFace(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+
+} EVGL_API_Thread_Command_glCullFace;
+
+void (*orig_evgl_api_glCullFace)(GLenum mode);
+
+static void
+_evgl_api_thread_glCullFace(void *data)
+{
+   EVGL_API_Thread_Command_glCullFace *thread_param =
+      (EVGL_API_Thread_Command_glCullFace *)data;
+
+   orig_evgl_api_glCullFace(thread_param->mode);
+
+}
+
+EAPI void
+glCullFace_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCullFace(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCullFace thread_param_local;
+   EVGL_API_Thread_Command_glCullFace *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCullFace,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteBuffers(GLsizei n, const GLuint* buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* buffers;
+   void *buffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteBuffers;
+
+void (*orig_evgl_api_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
+
+static void
+_evgl_api_thread_glDeleteBuffers(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteBuffers *thread_param =
+      (EVGL_API_Thread_Command_glDeleteBuffers *)data;
+
+   orig_evgl_api_glDeleteBuffers(thread_param->n,
+                                 thread_param->buffers);
+
+
+   if (thread_param->buffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->buffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteBuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* buffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteBuffers thread_param_local;
+   EVGL_API_Thread_Command_glDeleteBuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteBuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteBuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   thread_param->buffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (buffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->buffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->buffers_copied)
+          {
+             memcpy(thread_param->buffers_copied, buffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->buffers = (const GLuint *)thread_param->buffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* framebuffers;
+   void *framebuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteFramebuffers;
+
+void (*orig_evgl_api_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
+
+static void
+_evgl_api_thread_glDeleteFramebuffers(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteFramebuffers *thread_param =
+      (EVGL_API_Thread_Command_glDeleteFramebuffers *)data;
+
+   orig_evgl_api_glDeleteFramebuffers(thread_param->n,
+                                      thread_param->framebuffers);
+
+
+   if (thread_param->framebuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->framebuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteFramebuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* framebuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteFramebuffers thread_param_local;
+   EVGL_API_Thread_Command_glDeleteFramebuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteFramebuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteFramebuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   thread_param->framebuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (framebuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->framebuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->framebuffers_copied)
+          {
+             memcpy(thread_param->framebuffers_copied, framebuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->framebuffers = (const GLuint *)thread_param->framebuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+
+} EVGL_API_Thread_Command_glDeleteProgram;
+
+void (*orig_evgl_api_glDeleteProgram)(GLuint program);
+
+static void
+_evgl_api_thread_glDeleteProgram(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteProgram *thread_param =
+      (EVGL_API_Thread_Command_glDeleteProgram *)data;
+
+   orig_evgl_api_glDeleteProgram(thread_param->program);
+
+}
+
+EAPI void
+glDeleteProgram_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteProgram thread_param_local;
+   EVGL_API_Thread_Command_glDeleteProgram *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* renderbuffers;
+   void *renderbuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteRenderbuffers;
+
+void (*orig_evgl_api_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
+
+static void
+_evgl_api_thread_glDeleteRenderbuffers(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteRenderbuffers *thread_param =
+      (EVGL_API_Thread_Command_glDeleteRenderbuffers *)data;
+
+   orig_evgl_api_glDeleteRenderbuffers(thread_param->n,
+                                       thread_param->renderbuffers);
+
+
+   if (thread_param->renderbuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->renderbuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteRenderbuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* renderbuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteRenderbuffers thread_param_local;
+   EVGL_API_Thread_Command_glDeleteRenderbuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteRenderbuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteRenderbuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   thread_param->renderbuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (renderbuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->renderbuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->renderbuffers_copied)
+          {
+             memcpy(thread_param->renderbuffers_copied, renderbuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->renderbuffers = (const GLuint *)thread_param->renderbuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteShader;
+
+void (*orig_evgl_api_glDeleteShader)(GLuint shader);
+
+static void
+_evgl_api_thread_glDeleteShader(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteShader *thread_param =
+      (EVGL_API_Thread_Command_glDeleteShader *)data;
+
+   orig_evgl_api_glDeleteShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteShader_evgl_api_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteShader thread_param_local;
+   EVGL_API_Thread_Command_glDeleteShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteTextures(GLsizei n, const GLuint* textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* textures;
+   void *textures_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteTextures;
+
+void (*orig_evgl_api_glDeleteTextures)(GLsizei n, const GLuint* textures);
+
+static void
+_evgl_api_thread_glDeleteTextures(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteTextures *thread_param =
+      (EVGL_API_Thread_Command_glDeleteTextures *)data;
+
+   orig_evgl_api_glDeleteTextures(thread_param->n,
+                                  thread_param->textures);
+
+
+   if (thread_param->textures_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->textures_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteTextures_evgl_api_thread_cmd(GLsizei n, const GLuint* textures)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteTextures thread_param_local;
+   EVGL_API_Thread_Command_glDeleteTextures *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteTextures *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteTextures));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   thread_param->textures_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (textures)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->textures_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->textures_copied)
+          {
+             memcpy(thread_param->textures_copied, textures, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->textures = (const GLuint *)thread_param->textures_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthFunc(GLenum func);
+ */
+
+typedef struct
+{
+   GLenum func;
+
+} EVGL_API_Thread_Command_glDepthFunc;
+
+void (*orig_evgl_api_glDepthFunc)(GLenum func);
+
+static void
+_evgl_api_thread_glDepthFunc(void *data)
+{
+   EVGL_API_Thread_Command_glDepthFunc *thread_param =
+      (EVGL_API_Thread_Command_glDepthFunc *)data;
+
+   orig_evgl_api_glDepthFunc(thread_param->func);
+
+}
+
+EAPI void
+glDepthFunc_evgl_api_thread_cmd(GLenum func)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthFunc(func);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthFunc thread_param_local;
+   EVGL_API_Thread_Command_glDepthFunc *thread_param = &thread_param_local;
+
+   thread_param->func = func;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthMask(GLboolean flag);
+ */
+
+typedef struct
+{
+   GLboolean flag;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDepthMask;
+
+void (*orig_evgl_api_glDepthMask)(GLboolean flag);
+
+static void
+_evgl_api_thread_glDepthMask(void *data)
+{
+   EVGL_API_Thread_Command_glDepthMask *thread_param =
+      (EVGL_API_Thread_Command_glDepthMask *)data;
+
+   orig_evgl_api_glDepthMask(thread_param->flag);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDepthMask_evgl_api_thread_cmd(GLboolean flag)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthMask(flag);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthMask thread_param_local;
+   EVGL_API_Thread_Command_glDepthMask *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDepthMask *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDepthMask));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->flag = flag;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthMask,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthRangef(GLclampf zNear, GLclampf zFar);
+ */
+
+typedef struct
+{
+   GLclampf zNear;
+   GLclampf zFar;
+
+} EVGL_API_Thread_Command_glDepthRangef;
+
+void (*orig_evgl_api_glDepthRangef)(GLclampf zNear, GLclampf zFar);
+
+static void
+_evgl_api_thread_glDepthRangef(void *data)
+{
+   EVGL_API_Thread_Command_glDepthRangef *thread_param =
+      (EVGL_API_Thread_Command_glDepthRangef *)data;
+
+   orig_evgl_api_glDepthRangef(thread_param->zNear,
+                               thread_param->zFar);
+
+}
+
+EAPI void
+glDepthRangef_evgl_api_thread_cmd(GLclampf zNear, GLclampf zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthRangef(zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthRangef thread_param_local;
+   EVGL_API_Thread_Command_glDepthRangef *thread_param = &thread_param_local;
+
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthRangef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDetachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDetachShader;
+
+void (*orig_evgl_api_glDetachShader)(GLuint program, GLuint shader);
+
+static void
+_evgl_api_thread_glDetachShader(void *data)
+{
+   EVGL_API_Thread_Command_glDetachShader *thread_param =
+      (EVGL_API_Thread_Command_glDetachShader *)data;
+
+   orig_evgl_api_glDetachShader(thread_param->program,
+                                thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDetachShader_evgl_api_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDetachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDetachShader thread_param_local;
+   EVGL_API_Thread_Command_glDetachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDetachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDetachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDetachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDisable;
+
+void (*orig_evgl_api_glDisable)(GLenum cap);
+
+static void
+_evgl_api_thread_glDisable(void *data)
+{
+   EVGL_API_Thread_Command_glDisable *thread_param =
+      (EVGL_API_Thread_Command_glDisable *)data;
+
+   orig_evgl_api_glDisable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisable_evgl_api_thread_cmd(GLenum cap)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDisable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDisable thread_param_local;
+   EVGL_API_Thread_Command_glDisable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDisable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDisable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDisable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDisableVertexAttribArray;
+
+void (*orig_evgl_api_glDisableVertexAttribArray)(GLuint index);
+
+static void
+_evgl_api_thread_glDisableVertexAttribArray(void *data)
+{
+   EVGL_API_Thread_Command_glDisableVertexAttribArray *thread_param =
+      (EVGL_API_Thread_Command_glDisableVertexAttribArray *)data;
+
+   orig_evgl_api_glDisableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisableVertexAttribArray_evgl_api_thread_cmd(GLuint index)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDisableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDisableVertexAttribArray thread_param_local;
+   EVGL_API_Thread_Command_glDisableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDisableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDisableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDisableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawArrays(GLenum mode, GLint first, GLsizei count);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint first;
+   GLsizei count;
+
+} EVGL_API_Thread_Command_glDrawArrays;
+
+void (*orig_evgl_api_glDrawArrays)(GLenum mode, GLint first, GLsizei count);
+
+static void
+_evgl_api_thread_glDrawArrays(void *data)
+{
+   EVGL_API_Thread_Command_glDrawArrays *thread_param =
+      (EVGL_API_Thread_Command_glDrawArrays *)data;
+
+   orig_evgl_api_glDrawArrays(thread_param->mode,
+                              thread_param->first,
+                              thread_param->count);
+
+}
+
+EAPI void
+glDrawArrays_evgl_api_thread_cmd(GLenum mode, GLint first, GLsizei count)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawArrays(mode, first, count);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawArrays thread_param_local;
+   EVGL_API_Thread_Command_glDrawArrays *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLsizei count;
+   GLenum type;
+   const void* indices;
+
+} EVGL_API_Thread_Command_glDrawElements;
+
+void (*orig_evgl_api_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void* indices);
+
+static void
+_evgl_api_thread_glDrawElements(void *data)
+{
+   EVGL_API_Thread_Command_glDrawElements *thread_param =
+      (EVGL_API_Thread_Command_glDrawElements *)data;
+
+   orig_evgl_api_glDrawElements(thread_param->mode,
+                                thread_param->count,
+                                thread_param->type,
+                                thread_param->indices);
+
+}
+
+EAPI void
+glDrawElements_evgl_api_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void* indices)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawElements(mode, count, type, indices);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawElements thread_param_local;
+   EVGL_API_Thread_Command_glDrawElements *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawElements,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glEnable;
+
+void (*orig_evgl_api_glEnable)(GLenum cap);
+
+static void
+_evgl_api_thread_glEnable(void *data)
+{
+   EVGL_API_Thread_Command_glEnable *thread_param =
+      (EVGL_API_Thread_Command_glEnable *)data;
+
+   orig_evgl_api_glEnable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnable_evgl_api_thread_cmd(GLenum cap)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEnable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEnable thread_param_local;
+   EVGL_API_Thread_Command_glEnable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glEnable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glEnable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEnable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glEnableVertexAttribArray;
+
+void (*orig_evgl_api_glEnableVertexAttribArray)(GLuint index);
+
+static void
+_evgl_api_thread_glEnableVertexAttribArray(void *data)
+{
+   EVGL_API_Thread_Command_glEnableVertexAttribArray *thread_param =
+      (EVGL_API_Thread_Command_glEnableVertexAttribArray *)data;
+
+   orig_evgl_api_glEnableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnableVertexAttribArray_evgl_api_thread_cmd(GLuint index)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEnableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEnableVertexAttribArray thread_param_local;
+   EVGL_API_Thread_Command_glEnableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glEnableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glEnableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEnableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFinish(void);
+ */
+
+void (*orig_evgl_api_glFinish)(void);
+
+static void
+_evgl_api_thread_glFinish(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glFinish();
+
+}
+
+EAPI void
+glFinish_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFinish();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFinish,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glFlush(void);
+ */
+
+void (*orig_evgl_api_glFlush)(void);
+
+static void
+_evgl_api_thread_glFlush(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glFlush();
+
+}
+
+EAPI void
+glFlush_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFlush();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFlush,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum renderbuffertarget;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferRenderbuffer;
+
+void (*orig_evgl_api_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glFramebufferRenderbuffer(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferRenderbuffer *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferRenderbuffer *)data;
+
+   orig_evgl_api_glFramebufferRenderbuffer(thread_param->target,
+                                           thread_param->attachment,
+                                           thread_param->renderbuffertarget,
+                                           thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferRenderbuffer_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferRenderbuffer thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->renderbuffertarget = renderbuffertarget;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferTexture2D;
+
+void (*orig_evgl_api_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+static void
+_evgl_api_thread_glFramebufferTexture2D(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture2D *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture2D *)data;
+
+   orig_evgl_api_glFramebufferTexture2D(thread_param->target,
+                                        thread_param->attachment,
+                                        thread_param->textarget,
+                                        thread_param->texture,
+                                        thread_param->level);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2D_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture2D thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferTexture2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferTexture2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFrontFace(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+
+} EVGL_API_Thread_Command_glFrontFace;
+
+void (*orig_evgl_api_glFrontFace)(GLenum mode);
+
+static void
+_evgl_api_thread_glFrontFace(void *data)
+{
+   EVGL_API_Thread_Command_glFrontFace *thread_param =
+      (EVGL_API_Thread_Command_glFrontFace *)data;
+
+   orig_evgl_api_glFrontFace(thread_param->mode);
+
+}
+
+EAPI void
+glFrontFace_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFrontFace(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFrontFace thread_param_local;
+   EVGL_API_Thread_Command_glFrontFace *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFrontFace,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenBuffers(GLsizei n, GLuint* buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* buffers;
+
+} EVGL_API_Thread_Command_glGenBuffers;
+
+void (*orig_evgl_api_glGenBuffers)(GLsizei n, GLuint* buffers);
+
+static void
+_evgl_api_thread_glGenBuffers(void *data)
+{
+   EVGL_API_Thread_Command_glGenBuffers *thread_param =
+      (EVGL_API_Thread_Command_glGenBuffers *)data;
+
+   orig_evgl_api_glGenBuffers(thread_param->n,
+                              thread_param->buffers);
+
+}
+
+EAPI void
+glGenBuffers_evgl_api_thread_cmd(GLsizei n, GLuint* buffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenBuffers thread_param_local;
+   EVGL_API_Thread_Command_glGenBuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenerateMipmap(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum target;
+
+} EVGL_API_Thread_Command_glGenerateMipmap;
+
+void (*orig_evgl_api_glGenerateMipmap)(GLenum target);
+
+static void
+_evgl_api_thread_glGenerateMipmap(void *data)
+{
+   EVGL_API_Thread_Command_glGenerateMipmap *thread_param =
+      (EVGL_API_Thread_Command_glGenerateMipmap *)data;
+
+   orig_evgl_api_glGenerateMipmap(thread_param->target);
+
+}
+
+EAPI void
+glGenerateMipmap_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenerateMipmap(target);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenerateMipmap thread_param_local;
+   EVGL_API_Thread_Command_glGenerateMipmap *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenerateMipmap,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenFramebuffers(GLsizei n, GLuint* framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* framebuffers;
+
+} EVGL_API_Thread_Command_glGenFramebuffers;
+
+void (*orig_evgl_api_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
+
+static void
+_evgl_api_thread_glGenFramebuffers(void *data)
+{
+   EVGL_API_Thread_Command_glGenFramebuffers *thread_param =
+      (EVGL_API_Thread_Command_glGenFramebuffers *)data;
+
+   orig_evgl_api_glGenFramebuffers(thread_param->n,
+                                   thread_param->framebuffers);
+
+}
+
+EAPI void
+glGenFramebuffers_evgl_api_thread_cmd(GLsizei n, GLuint* framebuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenFramebuffers thread_param_local;
+   EVGL_API_Thread_Command_glGenFramebuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* renderbuffers;
+
+} EVGL_API_Thread_Command_glGenRenderbuffers;
+
+void (*orig_evgl_api_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
+
+static void
+_evgl_api_thread_glGenRenderbuffers(void *data)
+{
+   EVGL_API_Thread_Command_glGenRenderbuffers *thread_param =
+      (EVGL_API_Thread_Command_glGenRenderbuffers *)data;
+
+   orig_evgl_api_glGenRenderbuffers(thread_param->n,
+                                    thread_param->renderbuffers);
+
+}
+
+EAPI void
+glGenRenderbuffers_evgl_api_thread_cmd(GLsizei n, GLuint* renderbuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenRenderbuffers thread_param_local;
+   EVGL_API_Thread_Command_glGenRenderbuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenTextures(GLsizei n, GLuint* textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* textures;
+
+} EVGL_API_Thread_Command_glGenTextures;
+
+void (*orig_evgl_api_glGenTextures)(GLsizei n, GLuint* textures);
+
+static void
+_evgl_api_thread_glGenTextures(void *data)
+{
+   EVGL_API_Thread_Command_glGenTextures *thread_param =
+      (EVGL_API_Thread_Command_glGenTextures *)data;
+
+   orig_evgl_api_glGenTextures(thread_param->n,
+                               thread_param->textures);
+
+}
+
+EAPI void
+glGenTextures_evgl_api_thread_cmd(GLsizei n, GLuint* textures)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenTextures thread_param_local;
+   EVGL_API_Thread_Command_glGenTextures *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   GLsizei bufsize;
+   GLsizei* length;
+   GLint* size;
+   GLenum* type;
+   char* name;
+
+} EVGL_API_Thread_Command_glGetActiveAttrib;
+
+void (*orig_evgl_api_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+
+static void
+_evgl_api_thread_glGetActiveAttrib(void *data)
+{
+   EVGL_API_Thread_Command_glGetActiveAttrib *thread_param =
+      (EVGL_API_Thread_Command_glGetActiveAttrib *)data;
+
+   orig_evgl_api_glGetActiveAttrib(thread_param->program,
+                                   thread_param->index,
+                                   thread_param->bufsize,
+                                   thread_param->length,
+                                   thread_param->size,
+                                   thread_param->type,
+                                   thread_param->name);
+
+}
+
+EAPI void
+glGetActiveAttrib_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetActiveAttrib(program, index, bufsize, length, size, type, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetActiveAttrib thread_param_local;
+   EVGL_API_Thread_Command_glGetActiveAttrib *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetActiveAttrib,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   GLsizei bufsize;
+   GLsizei* length;
+   GLint* size;
+   GLenum* type;
+   char* name;
+
+} EVGL_API_Thread_Command_glGetActiveUniform;
+
+void (*orig_evgl_api_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+
+static void
+_evgl_api_thread_glGetActiveUniform(void *data)
+{
+   EVGL_API_Thread_Command_glGetActiveUniform *thread_param =
+      (EVGL_API_Thread_Command_glGetActiveUniform *)data;
+
+   orig_evgl_api_glGetActiveUniform(thread_param->program,
+                                    thread_param->index,
+                                    thread_param->bufsize,
+                                    thread_param->length,
+                                    thread_param->size,
+                                    thread_param->type,
+                                    thread_param->name);
+
+}
+
+EAPI void
+glGetActiveUniform_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetActiveUniform(program, index, bufsize, length, size, type, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetActiveUniform thread_param_local;
+   EVGL_API_Thread_Command_glGetActiveUniform *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetActiveUniform,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei maxcount;
+   GLsizei* count;
+   GLuint* shaders;
+
+} EVGL_API_Thread_Command_glGetAttachedShaders;
+
+void (*orig_evgl_api_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+
+static void
+_evgl_api_thread_glGetAttachedShaders(void *data)
+{
+   EVGL_API_Thread_Command_glGetAttachedShaders *thread_param =
+      (EVGL_API_Thread_Command_glGetAttachedShaders *)data;
+
+   orig_evgl_api_glGetAttachedShaders(thread_param->program,
+                                      thread_param->maxcount,
+                                      thread_param->count,
+                                      thread_param->shaders);
+
+}
+
+EAPI void
+glGetAttachedShaders_evgl_api_thread_cmd(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetAttachedShaders(program, maxcount, count, shaders);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetAttachedShaders thread_param_local;
+   EVGL_API_Thread_Command_glGetAttachedShaders *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->maxcount = maxcount;
+   thread_param->count = count;
+   thread_param->shaders = shaders;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetAttachedShaders,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glGetAttribLocation(GLuint program, const char* name);
+ */
+
+typedef struct
+{
+   int return_value;
+   GLuint program;
+   const char* name;
+
+} EVGL_API_Thread_Command_glGetAttribLocation;
+
+int (*orig_evgl_api_glGetAttribLocation)(GLuint program, const char* name);
+
+static void
+_evgl_api_thread_glGetAttribLocation(void *data)
+{
+   EVGL_API_Thread_Command_glGetAttribLocation *thread_param =
+      (EVGL_API_Thread_Command_glGetAttribLocation *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetAttribLocation(thread_param->program,
+                                                                  thread_param->name);
+
+}
+
+EAPI int
+glGetAttribLocation_evgl_api_thread_cmd(GLuint program, const char* name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetAttribLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetAttribLocation thread_param_local;
+   EVGL_API_Thread_Command_glGetAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetAttribLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBooleanv(GLenum pname, GLboolean* params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLboolean* params;
+
+} EVGL_API_Thread_Command_glGetBooleanv;
+
+void (*orig_evgl_api_glGetBooleanv)(GLenum pname, GLboolean* params);
+
+static void
+_evgl_api_thread_glGetBooleanv(void *data)
+{
+   EVGL_API_Thread_Command_glGetBooleanv *thread_param =
+      (EVGL_API_Thread_Command_glGetBooleanv *)data;
+
+   orig_evgl_api_glGetBooleanv(thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetBooleanv_evgl_api_thread_cmd(GLenum pname, GLboolean* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBooleanv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBooleanv thread_param_local;
+   EVGL_API_Thread_Command_glGetBooleanv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBooleanv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetBufferParameteriv;
+
+void (*orig_evgl_api_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetBufferParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetBufferParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetBufferParameteriv *)data;
+
+   orig_evgl_api_glGetBufferParameteriv(thread_param->target,
+                                        thread_param->pname,
+                                        thread_param->params);
+
+}
+
+EAPI void
+glGetBufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBufferParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetBufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glGetError(void);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+
+} EVGL_API_Thread_Command_glGetError;
+
+GLenum (*orig_evgl_api_glGetError)(void);
+
+static void
+_evgl_api_thread_glGetError(void *data)
+{
+   EVGL_API_Thread_Command_glGetError *thread_param =
+      (EVGL_API_Thread_Command_glGetError *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetError();
+
+}
+
+EAPI GLenum
+glGetError_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetError();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetError thread_param_local;
+   EVGL_API_Thread_Command_glGetError *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetError,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetFloatv(GLenum pname, GLfloat* params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat* params;
+
+} EVGL_API_Thread_Command_glGetFloatv;
+
+void (*orig_evgl_api_glGetFloatv)(GLenum pname, GLfloat* params);
+
+static void
+_evgl_api_thread_glGetFloatv(void *data)
+{
+   EVGL_API_Thread_Command_glGetFloatv *thread_param =
+      (EVGL_API_Thread_Command_glGetFloatv *)data;
+
+   orig_evgl_api_glGetFloatv(thread_param->pname,
+                             thread_param->params);
+
+}
+
+EAPI void
+glGetFloatv_evgl_api_thread_cmd(GLenum pname, GLfloat* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFloatv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFloatv thread_param_local;
+   EVGL_API_Thread_Command_glGetFloatv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFloatv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetFramebufferAttachmentParameteriv;
+
+void (*orig_evgl_api_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetFramebufferAttachmentParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetFramebufferAttachmentParameteriv *)data;
+
+   orig_evgl_api_glGetFramebufferAttachmentParameteriv(thread_param->target,
+                                                       thread_param->attachment,
+                                                       thread_param->pname,
+                                                       thread_param->params);
+
+}
+
+EAPI void
+glGetFramebufferAttachmentParameteriv_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFramebufferAttachmentParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetIntegerv(GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetIntegerv;
+
+void (*orig_evgl_api_glGetIntegerv)(GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetIntegerv(void *data)
+{
+   EVGL_API_Thread_Command_glGetIntegerv *thread_param =
+      (EVGL_API_Thread_Command_glGetIntegerv *)data;
+
+   orig_evgl_api_glGetIntegerv(thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetIntegerv_evgl_api_thread_cmd(GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetIntegerv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetIntegerv thread_param_local;
+   EVGL_API_Thread_Command_glGetIntegerv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetIntegerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramiv(GLuint program, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetProgramiv;
+
+void (*orig_evgl_api_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetProgramiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramiv *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramiv *)data;
+
+   orig_evgl_api_glGetProgramiv(thread_param->program,
+                                thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetProgramiv_evgl_api_thread_cmd(GLuint program, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramiv(program, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramiv thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufsize;
+   GLsizei* length;
+   char* infolog;
+
+} EVGL_API_Thread_Command_glGetProgramInfoLog;
+
+void (*orig_evgl_api_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+
+static void
+_evgl_api_thread_glGetProgramInfoLog(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramInfoLog *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramInfoLog *)data;
+
+   orig_evgl_api_glGetProgramInfoLog(thread_param->program,
+                                     thread_param->bufsize,
+                                     thread_param->length,
+                                     thread_param->infolog);
+
+}
+
+EAPI void
+glGetProgramInfoLog_evgl_api_thread_cmd(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramInfoLog(program, bufsize, length, infolog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramInfoLog thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramInfoLog *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->infolog = infolog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetRenderbufferParameteriv;
+
+void (*orig_evgl_api_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetRenderbufferParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetRenderbufferParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetRenderbufferParameteriv *)data;
+
+   orig_evgl_api_glGetRenderbufferParameteriv(thread_param->target,
+                                              thread_param->pname,
+                                              thread_param->params);
+
+}
+
+EAPI void
+glGetRenderbufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetRenderbufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetRenderbufferParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetRenderbufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetRenderbufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetShaderiv;
+
+void (*orig_evgl_api_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetShaderiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetShaderiv *thread_param =
+      (EVGL_API_Thread_Command_glGetShaderiv *)data;
+
+   orig_evgl_api_glGetShaderiv(thread_param->shader,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetShaderiv_evgl_api_thread_cmd(GLuint shader, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetShaderiv(shader, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetShaderiv thread_param_local;
+   EVGL_API_Thread_Command_glGetShaderiv *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetShaderiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufsize;
+   GLsizei* length;
+   char* infolog;
+
+} EVGL_API_Thread_Command_glGetShaderInfoLog;
+
+void (*orig_evgl_api_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+
+static void
+_evgl_api_thread_glGetShaderInfoLog(void *data)
+{
+   EVGL_API_Thread_Command_glGetShaderInfoLog *thread_param =
+      (EVGL_API_Thread_Command_glGetShaderInfoLog *)data;
+
+   orig_evgl_api_glGetShaderInfoLog(thread_param->shader,
+                                    thread_param->bufsize,
+                                    thread_param->length,
+                                    thread_param->infolog);
+
+}
+
+EAPI void
+glGetShaderInfoLog_evgl_api_thread_cmd(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetShaderInfoLog(shader, bufsize, length, infolog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetShaderInfoLog thread_param_local;
+   EVGL_API_Thread_Command_glGetShaderInfoLog *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->infolog = infolog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetShaderInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+ */
+
+typedef struct
+{
+   GLenum shadertype;
+   GLenum precisiontype;
+   GLint* range;
+   GLint* precision;
+
+} EVGL_API_Thread_Command_glGetShaderPrecisionFormat;
+
+void (*orig_evgl_api_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+
+static void
+_evgl_api_thread_glGetShaderPrecisionFormat(void *data)
+{
+   EVGL_API_Thread_Command_glGetShaderPrecisionFormat *thread_param =
+      (EVGL_API_Thread_Command_glGetShaderPrecisionFormat *)data;
+
+   orig_evgl_api_glGetShaderPrecisionFormat(thread_param->shadertype,
+                                            thread_param->precisiontype,
+                                            thread_param->range,
+                                            thread_param->precision);
+
+}
+
+EAPI void
+glGetShaderPrecisionFormat_evgl_api_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetShaderPrecisionFormat thread_param_local;
+   EVGL_API_Thread_Command_glGetShaderPrecisionFormat *thread_param = &thread_param_local;
+
+   thread_param->shadertype = shadertype;
+   thread_param->precisiontype = precisiontype;
+   thread_param->range = range;
+   thread_param->precision = precision;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetShaderPrecisionFormat,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufsize;
+   GLsizei* length;
+   char* source;
+
+} EVGL_API_Thread_Command_glGetShaderSource;
+
+void (*orig_evgl_api_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+
+static void
+_evgl_api_thread_glGetShaderSource(void *data)
+{
+   EVGL_API_Thread_Command_glGetShaderSource *thread_param =
+      (EVGL_API_Thread_Command_glGetShaderSource *)data;
+
+   orig_evgl_api_glGetShaderSource(thread_param->shader,
+                                   thread_param->bufsize,
+                                   thread_param->length,
+                                   thread_param->source);
+
+}
+
+EAPI void
+glGetShaderSource_evgl_api_thread_cmd(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetShaderSource(shader, bufsize, length, source);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetShaderSource thread_param_local;
+   EVGL_API_Thread_Command_glGetShaderSource *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->source = source;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   const GLubyte*
+   glGetString(GLenum name);
+ */
+
+typedef struct
+{
+   const GLubyte* return_value;
+   GLenum name;
+
+} EVGL_API_Thread_Command_glGetString;
+
+const GLubyte* (*orig_evgl_api_glGetString)(GLenum name);
+
+static void
+_evgl_api_thread_glGetString(void *data)
+{
+   EVGL_API_Thread_Command_glGetString *thread_param =
+      (EVGL_API_Thread_Command_glGetString *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetString(thread_param->name);
+
+}
+
+EAPI const GLubyte*
+glGetString_evgl_api_thread_cmd(GLenum name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetString(name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetString thread_param_local;
+   EVGL_API_Thread_Command_glGetString *thread_param = &thread_param_local;
+
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetString,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfloat* params;
+
+} EVGL_API_Thread_Command_glGetTexParameterfv;
+
+void (*orig_evgl_api_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params);
+
+static void
+_evgl_api_thread_glGetTexParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexParameterfv *)data;
+
+   orig_evgl_api_glGetTexParameterfv(thread_param->target,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetTexParameterfv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexParameterfv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexParameterfv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetTexParameteriv;
+
+void (*orig_evgl_api_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetTexParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexParameteriv *)data;
+
+   orig_evgl_api_glGetTexParameteriv(thread_param->target,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetTexParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetUniformfv(GLuint program, GLint location, GLfloat* params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLfloat* params;
+
+} EVGL_API_Thread_Command_glGetUniformfv;
+
+void (*orig_evgl_api_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
+
+static void
+_evgl_api_thread_glGetUniformfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformfv *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformfv *)data;
+
+   orig_evgl_api_glGetUniformfv(thread_param->program,
+                                thread_param->location,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetUniformfv_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetUniformfv(program, location, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformfv thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformfv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetUniformiv(GLuint program, GLint location, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetUniformiv;
+
+void (*orig_evgl_api_glGetUniformiv)(GLuint program, GLint location, GLint* params);
+
+static void
+_evgl_api_thread_glGetUniformiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformiv *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformiv *)data;
+
+   orig_evgl_api_glGetUniformiv(thread_param->program,
+                                thread_param->location,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetUniformiv_evgl_api_thread_cmd(GLuint program, GLint location, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetUniformiv(program, location, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformiv thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glGetUniformLocation(GLuint program, const char* name);
+ */
+
+typedef struct
+{
+   int return_value;
+   GLuint program;
+   const char* name;
+
+} EVGL_API_Thread_Command_glGetUniformLocation;
+
+int (*orig_evgl_api_glGetUniformLocation)(GLuint program, const char* name);
+
+static void
+_evgl_api_thread_glGetUniformLocation(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformLocation *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformLocation *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetUniformLocation(thread_param->program,
+                                                                   thread_param->name);
+
+}
+
+EAPI int
+glGetUniformLocation_evgl_api_thread_cmd(GLuint program, const char* name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetUniformLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformLocation thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLfloat* params;
+
+} EVGL_API_Thread_Command_glGetVertexAttribfv;
+
+void (*orig_evgl_api_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
+
+static void
+_evgl_api_thread_glGetVertexAttribfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetVertexAttribfv *thread_param =
+      (EVGL_API_Thread_Command_glGetVertexAttribfv *)data;
+
+   orig_evgl_api_glGetVertexAttribfv(thread_param->index,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribfv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLfloat* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetVertexAttribfv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetVertexAttribfv thread_param_local;
+   EVGL_API_Thread_Command_glGetVertexAttribfv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetVertexAttribfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetVertexAttribiv;
+
+void (*orig_evgl_api_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetVertexAttribiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetVertexAttribiv *thread_param =
+      (EVGL_API_Thread_Command_glGetVertexAttribiv *)data;
+
+   orig_evgl_api_glGetVertexAttribiv(thread_param->index,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetVertexAttribiv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetVertexAttribiv thread_param_local;
+   EVGL_API_Thread_Command_glGetVertexAttribiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetVertexAttribiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   void** pointer;
+
+} EVGL_API_Thread_Command_glGetVertexAttribPointerv;
+
+void (*orig_evgl_api_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
+
+static void
+_evgl_api_thread_glGetVertexAttribPointerv(void *data)
+{
+   EVGL_API_Thread_Command_glGetVertexAttribPointerv *thread_param =
+      (EVGL_API_Thread_Command_glGetVertexAttribPointerv *)data;
+
+   orig_evgl_api_glGetVertexAttribPointerv(thread_param->index,
+                                           thread_param->pname,
+                                           thread_param->pointer);
+
+}
+
+EAPI void
+glGetVertexAttribPointerv_evgl_api_thread_cmd(GLuint index, GLenum pname, void** pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetVertexAttribPointerv(index, pname, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetVertexAttribPointerv thread_param_local;
+   EVGL_API_Thread_Command_glGetVertexAttribPointerv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetVertexAttribPointerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glHint(GLenum target, GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum mode;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glHint;
+
+void (*orig_evgl_api_glHint)(GLenum target, GLenum mode);
+
+static void
+_evgl_api_thread_glHint(void *data)
+{
+   EVGL_API_Thread_Command_glHint *thread_param =
+      (EVGL_API_Thread_Command_glHint *)data;
+
+   orig_evgl_api_glHint(thread_param->target,
+                        thread_param->mode);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glHint_evgl_api_thread_cmd(GLenum target, GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glHint(target, mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glHint thread_param_local;
+   EVGL_API_Thread_Command_glHint *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glHint *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glHint));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glHint,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsBuffer(GLuint buffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint buffer;
+
+} EVGL_API_Thread_Command_glIsBuffer;
+
+GLboolean (*orig_evgl_api_glIsBuffer)(GLuint buffer);
+
+static void
+_evgl_api_thread_glIsBuffer(void *data)
+{
+   EVGL_API_Thread_Command_glIsBuffer *thread_param =
+      (EVGL_API_Thread_Command_glIsBuffer *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsBuffer(thread_param->buffer);
+
+}
+
+EAPI GLboolean
+glIsBuffer_evgl_api_thread_cmd(GLuint buffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsBuffer(buffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsBuffer thread_param_local;
+   EVGL_API_Thread_Command_glIsBuffer *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsEnabled(GLenum cap);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLenum cap;
+
+} EVGL_API_Thread_Command_glIsEnabled;
+
+GLboolean (*orig_evgl_api_glIsEnabled)(GLenum cap);
+
+static void
+_evgl_api_thread_glIsEnabled(void *data)
+{
+   EVGL_API_Thread_Command_glIsEnabled *thread_param =
+      (EVGL_API_Thread_Command_glIsEnabled *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsEnabled(thread_param->cap);
+
+}
+
+EAPI GLboolean
+glIsEnabled_evgl_api_thread_cmd(GLenum cap)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsEnabled(cap);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsEnabled thread_param_local;
+   EVGL_API_Thread_Command_glIsEnabled *thread_param = &thread_param_local;
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsEnabled,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsFramebuffer(GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint framebuffer;
+
+} EVGL_API_Thread_Command_glIsFramebuffer;
+
+GLboolean (*orig_evgl_api_glIsFramebuffer)(GLuint framebuffer);
+
+static void
+_evgl_api_thread_glIsFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glIsFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glIsFramebuffer *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsFramebuffer(thread_param->framebuffer);
+
+}
+
+EAPI GLboolean
+glIsFramebuffer_evgl_api_thread_cmd(GLuint framebuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsFramebuffer(framebuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glIsFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsFramebuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint program;
+
+} EVGL_API_Thread_Command_glIsProgram;
+
+GLboolean (*orig_evgl_api_glIsProgram)(GLuint program);
+
+static void
+_evgl_api_thread_glIsProgram(void *data)
+{
+   EVGL_API_Thread_Command_glIsProgram *thread_param =
+      (EVGL_API_Thread_Command_glIsProgram *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsProgram(thread_param->program);
+
+}
+
+EAPI GLboolean
+glIsProgram_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsProgram(program);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsProgram thread_param_local;
+   EVGL_API_Thread_Command_glIsProgram *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsRenderbuffer(GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint renderbuffer;
+
+} EVGL_API_Thread_Command_glIsRenderbuffer;
+
+GLboolean (*orig_evgl_api_glIsRenderbuffer)(GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glIsRenderbuffer(void *data)
+{
+   EVGL_API_Thread_Command_glIsRenderbuffer *thread_param =
+      (EVGL_API_Thread_Command_glIsRenderbuffer *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsRenderbuffer(thread_param->renderbuffer);
+
+}
+
+EAPI GLboolean
+glIsRenderbuffer_evgl_api_thread_cmd(GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsRenderbuffer(renderbuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsRenderbuffer thread_param_local;
+   EVGL_API_Thread_Command_glIsRenderbuffer *thread_param = &thread_param_local;
+
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsRenderbuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint shader;
+
+} EVGL_API_Thread_Command_glIsShader;
+
+GLboolean (*orig_evgl_api_glIsShader)(GLuint shader);
+
+static void
+_evgl_api_thread_glIsShader(void *data)
+{
+   EVGL_API_Thread_Command_glIsShader *thread_param =
+      (EVGL_API_Thread_Command_glIsShader *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsShader(thread_param->shader);
+
+}
+
+EAPI GLboolean
+glIsShader_evgl_api_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsShader(shader);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsShader thread_param_local;
+   EVGL_API_Thread_Command_glIsShader *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsTexture(GLuint texture);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint texture;
+
+} EVGL_API_Thread_Command_glIsTexture;
+
+GLboolean (*orig_evgl_api_glIsTexture)(GLuint texture);
+
+static void
+_evgl_api_thread_glIsTexture(void *data)
+{
+   EVGL_API_Thread_Command_glIsTexture *thread_param =
+      (EVGL_API_Thread_Command_glIsTexture *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsTexture(thread_param->texture);
+
+}
+
+EAPI GLboolean
+glIsTexture_evgl_api_thread_cmd(GLuint texture)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsTexture(texture);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsTexture thread_param_local;
+   EVGL_API_Thread_Command_glIsTexture *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsTexture,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glLineWidth(GLfloat width);
+ */
+
+typedef struct
+{
+   GLfloat width;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glLineWidth;
+
+void (*orig_evgl_api_glLineWidth)(GLfloat width);
+
+static void
+_evgl_api_thread_glLineWidth(void *data)
+{
+   EVGL_API_Thread_Command_glLineWidth *thread_param =
+      (EVGL_API_Thread_Command_glLineWidth *)data;
+
+   orig_evgl_api_glLineWidth(thread_param->width);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLineWidth_evgl_api_thread_cmd(GLfloat width)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLineWidth(width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLineWidth thread_param_local;
+   EVGL_API_Thread_Command_glLineWidth *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glLineWidth *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glLineWidth));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLineWidth,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLinkProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glLinkProgram;
+
+void (*orig_evgl_api_glLinkProgram)(GLuint program);
+
+static void
+_evgl_api_thread_glLinkProgram(void *data)
+{
+   EVGL_API_Thread_Command_glLinkProgram *thread_param =
+      (EVGL_API_Thread_Command_glLinkProgram *)data;
+
+   orig_evgl_api_glLinkProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLinkProgram_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLinkProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLinkProgram thread_param_local;
+   EVGL_API_Thread_Command_glLinkProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glLinkProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glLinkProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLinkProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPixelStorei(GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glPixelStorei;
+
+void (*orig_evgl_api_glPixelStorei)(GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glPixelStorei(void *data)
+{
+   EVGL_API_Thread_Command_glPixelStorei *thread_param =
+      (EVGL_API_Thread_Command_glPixelStorei *)data;
+
+   orig_evgl_api_glPixelStorei(thread_param->pname,
+                               thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPixelStorei_evgl_api_thread_cmd(GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPixelStorei(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPixelStorei thread_param_local;
+   EVGL_API_Thread_Command_glPixelStorei *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glPixelStorei *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glPixelStorei));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPixelStorei,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPolygonOffset(GLfloat factor, GLfloat units);
+ */
+
+typedef struct
+{
+   GLfloat factor;
+   GLfloat units;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glPolygonOffset;
+
+void (*orig_evgl_api_glPolygonOffset)(GLfloat factor, GLfloat units);
+
+static void
+_evgl_api_thread_glPolygonOffset(void *data)
+{
+   EVGL_API_Thread_Command_glPolygonOffset *thread_param =
+      (EVGL_API_Thread_Command_glPolygonOffset *)data;
+
+   orig_evgl_api_glPolygonOffset(thread_param->factor,
+                                 thread_param->units);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPolygonOffset_evgl_api_thread_cmd(GLfloat factor, GLfloat units)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPolygonOffset(factor, units);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPolygonOffset thread_param_local;
+   EVGL_API_Thread_Command_glPolygonOffset *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glPolygonOffset *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glPolygonOffset));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->factor = factor;
+   thread_param->units = units;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPolygonOffset,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   void* pixels;
+
+} EVGL_API_Thread_Command_glReadPixels;
+
+void (*orig_evgl_api_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+
+static void
+_evgl_api_thread_glReadPixels(void *data)
+{
+   EVGL_API_Thread_Command_glReadPixels *thread_param =
+      (EVGL_API_Thread_Command_glReadPixels *)data;
+
+   orig_evgl_api_glReadPixels(thread_param->x,
+                              thread_param->y,
+                              thread_param->width,
+                              thread_param->height,
+                              thread_param->format,
+                              thread_param->type,
+                              thread_param->pixels);
+
+}
+
+EAPI void
+glReadPixels_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glReadPixels(x, y, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glReadPixels thread_param_local;
+   EVGL_API_Thread_Command_glReadPixels *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glReadPixels,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReleaseShaderCompiler(void);
+ */
+
+void (*orig_evgl_api_glReleaseShaderCompiler)(void);
+
+static void
+_evgl_api_thread_glReleaseShaderCompiler(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glReleaseShaderCompiler();
+
+}
+
+EAPI void
+glReleaseShaderCompiler_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glReleaseShaderCompiler();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glReleaseShaderCompiler,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glRenderbufferStorage;
+
+void (*orig_evgl_api_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glRenderbufferStorage(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorage *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorage *)data;
+
+   orig_evgl_api_glRenderbufferStorage(thread_param->target,
+                                       thread_param->internalformat,
+                                       thread_param->width,
+                                       thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glRenderbufferStorage_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorage(target, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorage thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorage *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glRenderbufferStorage *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glRenderbufferStorage));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSampleCoverage(GLclampf value, GLboolean invert);
+ */
+
+typedef struct
+{
+   GLclampf value;
+   GLboolean invert;
+
+} EVGL_API_Thread_Command_glSampleCoverage;
+
+void (*orig_evgl_api_glSampleCoverage)(GLclampf value, GLboolean invert);
+
+static void
+_evgl_api_thread_glSampleCoverage(void *data)
+{
+   EVGL_API_Thread_Command_glSampleCoverage *thread_param =
+      (EVGL_API_Thread_Command_glSampleCoverage *)data;
+
+   orig_evgl_api_glSampleCoverage(thread_param->value,
+                                  thread_param->invert);
+
+}
+
+EAPI void
+glSampleCoverage_evgl_api_thread_cmd(GLclampf value, GLboolean invert)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSampleCoverage(value, invert);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSampleCoverage thread_param_local;
+   EVGL_API_Thread_Command_glSampleCoverage *thread_param = &thread_param_local;
+
+   thread_param->value = value;
+   thread_param->invert = invert;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSampleCoverage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glScissor;
+
+void (*orig_evgl_api_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glScissor(void *data)
+{
+   EVGL_API_Thread_Command_glScissor *thread_param =
+      (EVGL_API_Thread_Command_glScissor *)data;
+
+   orig_evgl_api_glScissor(thread_param->x,
+                           thread_param->y,
+                           thread_param->width,
+                           thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glScissor_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glScissor(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glScissor thread_param_local;
+   EVGL_API_Thread_Command_glScissor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glScissor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glScissor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glScissor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* shaders;
+   GLenum binaryformat;
+   const void* binary;
+   GLsizei length;
+
+} EVGL_API_Thread_Command_glShaderBinary;
+
+void (*orig_evgl_api_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+
+static void
+_evgl_api_thread_glShaderBinary(void *data)
+{
+   EVGL_API_Thread_Command_glShaderBinary *thread_param =
+      (EVGL_API_Thread_Command_glShaderBinary *)data;
+
+   orig_evgl_api_glShaderBinary(thread_param->n,
+                                thread_param->shaders,
+                                thread_param->binaryformat,
+                                thread_param->binary,
+                                thread_param->length);
+
+}
+
+EAPI void
+glShaderBinary_evgl_api_thread_cmd(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glShaderBinary(n, shaders, binaryformat, binary, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glShaderBinary thread_param_local;
+   EVGL_API_Thread_Command_glShaderBinary *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->shaders = shaders;
+   thread_param->binaryformat = binaryformat;
+   thread_param->binary = binary;
+   thread_param->length = length;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glShaderBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glShaderSource(GLuint shader, GLsizei count, const char* const * string, const GLint* length);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei count;
+   const char* const * string;
+   const GLint* length;
+   int command_allocated;
+   GLSHADERSOURCE_COPY_VARIABLE; /* TODO */
+
+} EVGL_API_Thread_Command_glShaderSource;
+
+void (*orig_evgl_api_glShaderSource)(GLuint shader, GLsizei count, const char* const * string, const GLint* length);
+
+static void
+_evgl_api_thread_glShaderSource(void *data)
+{
+   EVGL_API_Thread_Command_glShaderSource *thread_param =
+      (EVGL_API_Thread_Command_glShaderSource *)data;
+
+   orig_evgl_api_glShaderSource(thread_param->shader,
+                                thread_param->count,
+                                thread_param->string,
+                                thread_param->length);
+
+   GLSHADERSOURCE_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glShaderSource_evgl_api_thread_cmd(GLuint shader, GLsizei count, const char* const * string, const GLint* length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glShaderSource(shader, count, string, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glShaderSource thread_param_local;
+   EVGL_API_Thread_Command_glShaderSource *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glShaderSource *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glShaderSource));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+   thread_param->count = count;
+   thread_param->string = string;
+   thread_param->length = length;
+
+   GLSHADERSOURCE_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLSHADERSOURCE_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilFunc(GLenum func, GLint ref, GLuint mask);
+ */
+
+typedef struct
+{
+   GLenum func;
+   GLint ref;
+   GLuint mask;
+
+} EVGL_API_Thread_Command_glStencilFunc;
+
+void (*orig_evgl_api_glStencilFunc)(GLenum func, GLint ref, GLuint mask);
+
+static void
+_evgl_api_thread_glStencilFunc(void *data)
+{
+   EVGL_API_Thread_Command_glStencilFunc *thread_param =
+      (EVGL_API_Thread_Command_glStencilFunc *)data;
+
+   orig_evgl_api_glStencilFunc(thread_param->func,
+                               thread_param->ref,
+                               thread_param->mask);
+
+}
+
+EAPI void
+glStencilFunc_evgl_api_thread_cmd(GLenum func, GLint ref, GLuint mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilFunc(func, ref, mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilFunc thread_param_local;
+   EVGL_API_Thread_Command_glStencilFunc *thread_param = &thread_param_local;
+
+   thread_param->func = func;
+   thread_param->ref = ref;
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum func;
+   GLint ref;
+   GLuint mask;
+
+} EVGL_API_Thread_Command_glStencilFuncSeparate;
+
+void (*orig_evgl_api_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
+
+static void
+_evgl_api_thread_glStencilFuncSeparate(void *data)
+{
+   EVGL_API_Thread_Command_glStencilFuncSeparate *thread_param =
+      (EVGL_API_Thread_Command_glStencilFuncSeparate *)data;
+
+   orig_evgl_api_glStencilFuncSeparate(thread_param->face,
+                                       thread_param->func,
+                                       thread_param->ref,
+                                       thread_param->mask);
+
+}
+
+EAPI void
+glStencilFuncSeparate_evgl_api_thread_cmd(GLenum face, GLenum func, GLint ref, GLuint mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilFuncSeparate(face, func, ref, mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilFuncSeparate thread_param_local;
+   EVGL_API_Thread_Command_glStencilFuncSeparate *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->func = func;
+   thread_param->ref = ref;
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilFuncSeparate,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilMask(GLuint mask);
+ */
+
+typedef struct
+{
+   GLuint mask;
+
+} EVGL_API_Thread_Command_glStencilMask;
+
+void (*orig_evgl_api_glStencilMask)(GLuint mask);
+
+static void
+_evgl_api_thread_glStencilMask(void *data)
+{
+   EVGL_API_Thread_Command_glStencilMask *thread_param =
+      (EVGL_API_Thread_Command_glStencilMask *)data;
+
+   orig_evgl_api_glStencilMask(thread_param->mask);
+
+}
+
+EAPI void
+glStencilMask_evgl_api_thread_cmd(GLuint mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilMask(mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilMask thread_param_local;
+   EVGL_API_Thread_Command_glStencilMask *thread_param = &thread_param_local;
+
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilMask,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilMaskSeparate(GLenum face, GLuint mask);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLuint mask;
+
+} EVGL_API_Thread_Command_glStencilMaskSeparate;
+
+void (*orig_evgl_api_glStencilMaskSeparate)(GLenum face, GLuint mask);
+
+static void
+_evgl_api_thread_glStencilMaskSeparate(void *data)
+{
+   EVGL_API_Thread_Command_glStencilMaskSeparate *thread_param =
+      (EVGL_API_Thread_Command_glStencilMaskSeparate *)data;
+
+   orig_evgl_api_glStencilMaskSeparate(thread_param->face,
+                                       thread_param->mask);
+
+}
+
+EAPI void
+glStencilMaskSeparate_evgl_api_thread_cmd(GLenum face, GLuint mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilMaskSeparate(face, mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilMaskSeparate thread_param_local;
+   EVGL_API_Thread_Command_glStencilMaskSeparate *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilMaskSeparate,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+ */
+
+typedef struct
+{
+   GLenum fail;
+   GLenum zfail;
+   GLenum zpass;
+
+} EVGL_API_Thread_Command_glStencilOp;
+
+void (*orig_evgl_api_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
+
+static void
+_evgl_api_thread_glStencilOp(void *data)
+{
+   EVGL_API_Thread_Command_glStencilOp *thread_param =
+      (EVGL_API_Thread_Command_glStencilOp *)data;
+
+   orig_evgl_api_glStencilOp(thread_param->fail,
+                             thread_param->zfail,
+                             thread_param->zpass);
+
+}
+
+EAPI void
+glStencilOp_evgl_api_thread_cmd(GLenum fail, GLenum zfail, GLenum zpass)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilOp(fail, zfail, zpass);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilOp thread_param_local;
+   EVGL_API_Thread_Command_glStencilOp *thread_param = &thread_param_local;
+
+   thread_param->fail = fail;
+   thread_param->zfail = zfail;
+   thread_param->zpass = zpass;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilOp,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum fail;
+   GLenum zfail;
+   GLenum zpass;
+
+} EVGL_API_Thread_Command_glStencilOpSeparate;
+
+void (*orig_evgl_api_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+
+static void
+_evgl_api_thread_glStencilOpSeparate(void *data)
+{
+   EVGL_API_Thread_Command_glStencilOpSeparate *thread_param =
+      (EVGL_API_Thread_Command_glStencilOpSeparate *)data;
+
+   orig_evgl_api_glStencilOpSeparate(thread_param->face,
+                                     thread_param->fail,
+                                     thread_param->zfail,
+                                     thread_param->zpass);
+
+}
+
+EAPI void
+glStencilOpSeparate_evgl_api_thread_cmd(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStencilOpSeparate(face, fail, zfail, zpass);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStencilOpSeparate thread_param_local;
+   EVGL_API_Thread_Command_glStencilOpSeparate *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->fail = fail;
+   thread_param->zfail = zfail;
+   thread_param->zpass = zpass;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStencilOpSeparate,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLenum format;
+   GLenum type;
+   const void* pixels;
+   int command_allocated;
+   GLTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_API_Thread_Command_glTexImage2D;
+
+void (*orig_evgl_api_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+
+static void
+_evgl_api_thread_glTexImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glTexImage2D *thread_param =
+      (EVGL_API_Thread_Command_glTexImage2D *)data;
+
+   orig_evgl_api_glTexImage2D(thread_param->target,
+                              thread_param->level,
+                              thread_param->internalformat,
+                              thread_param->width,
+                              thread_param->height,
+                              thread_param->border,
+                              thread_param->format,
+                              thread_param->type,
+                              thread_param->pixels);
+
+   GLTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexImage2D thread_param_local;
+   EVGL_API_Thread_Command_glTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfloat param;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glTexParameterf;
+
+void (*orig_evgl_api_glTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glTexParameterf(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterf *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterf *)data;
+
+   orig_evgl_api_glTexParameterf(thread_param->target,
+                                 thread_param->pname,
+                                 thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterf_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterf(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterf thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterf *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexParameterf *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexParameterf));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfloat* params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glTexParameterfv;
+
+void (*orig_evgl_api_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params);
+
+static void
+_evgl_api_thread_glTexParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterfv *)data;
+
+   orig_evgl_api_glTexParameterfv(thread_param->target,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterfv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfloat* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterfv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterfv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexParameterfv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexParameterfv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLfloat);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLfloat *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteri(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glTexParameteri;
+
+void (*orig_evgl_api_glTexParameteri)(GLenum target, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glTexParameteri(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameteri *thread_param =
+      (EVGL_API_Thread_Command_glTexParameteri *)data;
+
+   orig_evgl_api_glTexParameteri(thread_param->target,
+                                 thread_param->pname,
+                                 thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteri_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameteri(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameteri thread_param_local;
+   EVGL_API_Thread_Command_glTexParameteri *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexParameteri *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexParameteri));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLint* params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glTexParameteriv;
+
+void (*orig_evgl_api_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params);
+
+static void
+_evgl_api_thread_glTexParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glTexParameteriv *)data;
+
+   orig_evgl_api_glTexParameteriv(thread_param->target,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glTexParameteriv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexParameteriv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexParameteriv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLint);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLint *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   const void* pixels;
+   int command_allocated;
+   GLTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_API_Thread_Command_glTexSubImage2D;
+
+void (*orig_evgl_api_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+
+static void
+_evgl_api_thread_glTexSubImage2D(void *data)
+{
+   EVGL_API_Thread_Command_glTexSubImage2D *thread_param =
+      (EVGL_API_Thread_Command_glTexSubImage2D *)data;
+
+   orig_evgl_api_glTexSubImage2D(thread_param->target,
+                                 thread_param->level,
+                                 thread_param->xoffset,
+                                 thread_param->yoffset,
+                                 thread_param->width,
+                                 thread_param->height,
+                                 thread_param->format,
+                                 thread_param->type,
+                                 thread_param->pixels);
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexSubImage2D thread_param_local;
+   EVGL_API_Thread_Command_glTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1f(GLint location, GLfloat x);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat x;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform1f;
+
+void (*orig_evgl_api_glUniform1f)(GLint location, GLfloat x);
+
+static void
+_evgl_api_thread_glUniform1f(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1f *thread_param =
+      (EVGL_API_Thread_Command_glUniform1f *)data;
+
+   orig_evgl_api_glUniform1f(thread_param->location,
+                             thread_param->x);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1f_evgl_api_thread_cmd(GLint location, GLfloat x)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1f(location, x);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1f thread_param_local;
+   EVGL_API_Thread_Command_glUniform1f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform1f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform1f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform1fv;
+
+void (*orig_evgl_api_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
+
+static void
+_evgl_api_thread_glUniform1fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1fv *thread_param =
+      (EVGL_API_Thread_Command_glUniform1fv *)data;
+
+   orig_evgl_api_glUniform1fv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1fv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1fv thread_param_local;
+   EVGL_API_Thread_Command_glUniform1fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform1fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform1fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLfloat *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1i(GLint location, GLint x);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint x;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform1i;
+
+void (*orig_evgl_api_glUniform1i)(GLint location, GLint x);
+
+static void
+_evgl_api_thread_glUniform1i(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1i *thread_param =
+      (EVGL_API_Thread_Command_glUniform1i *)data;
+
+   orig_evgl_api_glUniform1i(thread_param->location,
+                             thread_param->x);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1i_evgl_api_thread_cmd(GLint location, GLint x)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1i(location, x);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1i thread_param_local;
+   EVGL_API_Thread_Command_glUniform1i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform1i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform1i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1iv(GLint location, GLsizei count, const GLint* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform1iv;
+
+void (*orig_evgl_api_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
+
+static void
+_evgl_api_thread_glUniform1iv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1iv *thread_param =
+      (EVGL_API_Thread_Command_glUniform1iv *)data;
+
+   orig_evgl_api_glUniform1iv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1iv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1iv thread_param_local;
+   EVGL_API_Thread_Command_glUniform1iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform1iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform1iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLint *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2f(GLint location, GLfloat x, GLfloat y);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat x;
+   GLfloat y;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform2f;
+
+void (*orig_evgl_api_glUniform2f)(GLint location, GLfloat x, GLfloat y);
+
+static void
+_evgl_api_thread_glUniform2f(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2f *thread_param =
+      (EVGL_API_Thread_Command_glUniform2f *)data;
+
+   orig_evgl_api_glUniform2f(thread_param->location,
+                             thread_param->x,
+                             thread_param->y);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2f(location, x, y);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2f thread_param_local;
+   EVGL_API_Thread_Command_glUniform2f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform2f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform2f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform2fv;
+
+void (*orig_evgl_api_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
+
+static void
+_evgl_api_thread_glUniform2fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2fv *thread_param =
+      (EVGL_API_Thread_Command_glUniform2fv *)data;
+
+   orig_evgl_api_glUniform2fv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2fv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2fv thread_param_local;
+   EVGL_API_Thread_Command_glUniform2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLfloat *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2i(GLint location, GLint x, GLint y);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint x;
+   GLint y;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform2i;
+
+void (*orig_evgl_api_glUniform2i)(GLint location, GLint x, GLint y);
+
+static void
+_evgl_api_thread_glUniform2i(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2i *thread_param =
+      (EVGL_API_Thread_Command_glUniform2i *)data;
+
+   orig_evgl_api_glUniform2i(thread_param->location,
+                             thread_param->x,
+                             thread_param->y);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2i_evgl_api_thread_cmd(GLint location, GLint x, GLint y)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2i(location, x, y);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2i thread_param_local;
+   EVGL_API_Thread_Command_glUniform2i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform2i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform2i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2iv(GLint location, GLsizei count, const GLint* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform2iv;
+
+void (*orig_evgl_api_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
+
+static void
+_evgl_api_thread_glUniform2iv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2iv *thread_param =
+      (EVGL_API_Thread_Command_glUniform2iv *)data;
+
+   orig_evgl_api_glUniform2iv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2iv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2iv thread_param_local;
+   EVGL_API_Thread_Command_glUniform2iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform2iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform2iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLint *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform3f;
+
+void (*orig_evgl_api_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
+
+static void
+_evgl_api_thread_glUniform3f(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3f *thread_param =
+      (EVGL_API_Thread_Command_glUniform3f *)data;
+
+   orig_evgl_api_glUniform3f(thread_param->location,
+                             thread_param->x,
+                             thread_param->y,
+                             thread_param->z);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3f(location, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3f thread_param_local;
+   EVGL_API_Thread_Command_glUniform3f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform3f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform3f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform3fv;
+
+void (*orig_evgl_api_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
+
+static void
+_evgl_api_thread_glUniform3fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3fv *thread_param =
+      (EVGL_API_Thread_Command_glUniform3fv *)data;
+
+   orig_evgl_api_glUniform3fv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3fv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3fv thread_param_local;
+   EVGL_API_Thread_Command_glUniform3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLfloat *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3i(GLint location, GLint x, GLint y, GLint z);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint x;
+   GLint y;
+   GLint z;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform3i;
+
+void (*orig_evgl_api_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
+
+static void
+_evgl_api_thread_glUniform3i(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3i *thread_param =
+      (EVGL_API_Thread_Command_glUniform3i *)data;
+
+   orig_evgl_api_glUniform3i(thread_param->location,
+                             thread_param->x,
+                             thread_param->y,
+                             thread_param->z);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3i_evgl_api_thread_cmd(GLint location, GLint x, GLint y, GLint z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3i(location, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3i thread_param_local;
+   EVGL_API_Thread_Command_glUniform3i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform3i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform3i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3iv(GLint location, GLsizei count, const GLint* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform3iv;
+
+void (*orig_evgl_api_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
+
+static void
+_evgl_api_thread_glUniform3iv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3iv *thread_param =
+      (EVGL_API_Thread_Command_glUniform3iv *)data;
+
+   orig_evgl_api_glUniform3iv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3iv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3iv thread_param_local;
+   EVGL_API_Thread_Command_glUniform3iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform3iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform3iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLint *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+   GLfloat w;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform4f;
+
+void (*orig_evgl_api_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+static void
+_evgl_api_thread_glUniform4f(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4f *thread_param =
+      (EVGL_API_Thread_Command_glUniform4f *)data;
+
+   orig_evgl_api_glUniform4f(thread_param->location,
+                             thread_param->x,
+                             thread_param->y,
+                             thread_param->z,
+                             thread_param->w);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4f(location, x, y, z, w);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4f thread_param_local;
+   EVGL_API_Thread_Command_glUniform4f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform4f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform4f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->w = w;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform4fv;
+
+void (*orig_evgl_api_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
+
+static void
+_evgl_api_thread_glUniform4fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4fv *thread_param =
+      (EVGL_API_Thread_Command_glUniform4fv *)data;
+
+   orig_evgl_api_glUniform4fv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4fv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4fv thread_param_local;
+   EVGL_API_Thread_Command_glUniform4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLfloat *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint x;
+   GLint y;
+   GLint z;
+   GLint w;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform4i;
+
+void (*orig_evgl_api_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
+
+static void
+_evgl_api_thread_glUniform4i(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4i *thread_param =
+      (EVGL_API_Thread_Command_glUniform4i *)data;
+
+   orig_evgl_api_glUniform4i(thread_param->location,
+                             thread_param->x,
+                             thread_param->y,
+                             thread_param->z,
+                             thread_param->w);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4i_evgl_api_thread_cmd(GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4i(location, x, y, z, w);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4i thread_param_local;
+   EVGL_API_Thread_Command_glUniform4i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform4i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform4i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->w = w;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4iv(GLint location, GLsizei count, const GLint* v);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint* v;
+   void *v_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniform4iv;
+
+void (*orig_evgl_api_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
+
+static void
+_evgl_api_thread_glUniform4iv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4iv *thread_param =
+      (EVGL_API_Thread_Command_glUniform4iv *)data;
+
+   orig_evgl_api_glUniform4iv(thread_param->location,
+                              thread_param->count,
+                              thread_param->v);
+
+
+   if (thread_param->v_copied)
+     eina_mempool_free(_mp_uniform, thread_param->v_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4iv(location, count, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4iv thread_param_local;
+   EVGL_API_Thread_Command_glUniform4iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniform4iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniform4iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->v = v;
+
+   thread_param->v_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (v)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->v_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->v_copied)
+          {
+             memcpy(thread_param->v_copied, v, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->v = (const GLint *)thread_param->v_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat* value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniformMatrix2fv;
+
+void (*orig_evgl_api_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+static void
+_evgl_api_thread_glUniformMatrix2fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix2fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix2fv *)data;
+
+   orig_evgl_api_glUniformMatrix2fv(thread_param->location,
+                                    thread_param->count,
+                                    thread_param->transpose,
+                                    thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix2fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix2fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniformMatrix2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniformMatrix2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat* value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniformMatrix3fv;
+
+void (*orig_evgl_api_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+static void
+_evgl_api_thread_glUniformMatrix3fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix3fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix3fv *)data;
+
+   orig_evgl_api_glUniformMatrix3fv(thread_param->location,
+                                    thread_param->count,
+                                    thread_param->transpose,
+                                    thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix3fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix3fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniformMatrix3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniformMatrix3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 9 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat* value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUniformMatrix4fv;
+
+void (*orig_evgl_api_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+static void
+_evgl_api_thread_glUniformMatrix4fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix4fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix4fv *)data;
+
+   orig_evgl_api_glUniformMatrix4fv(thread_param->location,
+                                    thread_param->count,
+                                    thread_param->transpose,
+                                    thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix4fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix4fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUniformMatrix4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUniformMatrix4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 16 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUseProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glUseProgram;
+
+void (*orig_evgl_api_glUseProgram)(GLuint program);
+
+static void
+_evgl_api_thread_glUseProgram(void *data)
+{
+   EVGL_API_Thread_Command_glUseProgram *thread_param =
+      (EVGL_API_Thread_Command_glUseProgram *)data;
+
+   orig_evgl_api_glUseProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUseProgram_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUseProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUseProgram thread_param_local;
+   EVGL_API_Thread_Command_glUseProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glUseProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glUseProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUseProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glValidateProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+
+} EVGL_API_Thread_Command_glValidateProgram;
+
+void (*orig_evgl_api_glValidateProgram)(GLuint program);
+
+static void
+_evgl_api_thread_glValidateProgram(void *data)
+{
+   EVGL_API_Thread_Command_glValidateProgram *thread_param =
+      (EVGL_API_Thread_Command_glValidateProgram *)data;
+
+   orig_evgl_api_glValidateProgram(thread_param->program);
+
+}
+
+EAPI void
+glValidateProgram_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glValidateProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glValidateProgram thread_param_local;
+   EVGL_API_Thread_Command_glValidateProgram *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glValidateProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib1f(GLuint indx, GLfloat x);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   GLfloat x;
+
+} EVGL_API_Thread_Command_glVertexAttrib1f;
+
+void (*orig_evgl_api_glVertexAttrib1f)(GLuint indx, GLfloat x);
+
+static void
+_evgl_api_thread_glVertexAttrib1f(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib1f *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib1f *)data;
+
+   orig_evgl_api_glVertexAttrib1f(thread_param->indx,
+                                  thread_param->x);
+
+}
+
+EAPI void
+glVertexAttrib1f_evgl_api_thread_cmd(GLuint indx, GLfloat x)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib1f(indx, x);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib1f thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib1f *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->x = x;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib1f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib1fv(GLuint indx, const GLfloat* values);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   const GLfloat* values;
+
+} EVGL_API_Thread_Command_glVertexAttrib1fv;
+
+void (*orig_evgl_api_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
+
+static void
+_evgl_api_thread_glVertexAttrib1fv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib1fv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib1fv *)data;
+
+   orig_evgl_api_glVertexAttrib1fv(thread_param->indx,
+                                   thread_param->values);
+
+}
+
+EAPI void
+glVertexAttrib1fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib1fv(indx, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib1fv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib1fv *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib1fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   GLfloat x;
+   GLfloat y;
+
+} EVGL_API_Thread_Command_glVertexAttrib2f;
+
+void (*orig_evgl_api_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
+
+static void
+_evgl_api_thread_glVertexAttrib2f(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib2f *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib2f *)data;
+
+   orig_evgl_api_glVertexAttrib2f(thread_param->indx,
+                                  thread_param->x,
+                                  thread_param->y);
+
+}
+
+EAPI void
+glVertexAttrib2f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib2f(indx, x, y);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib2f thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib2f *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->x = x;
+   thread_param->y = y;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib2f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib2fv(GLuint indx, const GLfloat* values);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   const GLfloat* values;
+
+} EVGL_API_Thread_Command_glVertexAttrib2fv;
+
+void (*orig_evgl_api_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
+
+static void
+_evgl_api_thread_glVertexAttrib2fv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib2fv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib2fv *)data;
+
+   orig_evgl_api_glVertexAttrib2fv(thread_param->indx,
+                                   thread_param->values);
+
+}
+
+EAPI void
+glVertexAttrib2fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib2fv(indx, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib2fv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib2fv *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+
+} EVGL_API_Thread_Command_glVertexAttrib3f;
+
+void (*orig_evgl_api_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+
+static void
+_evgl_api_thread_glVertexAttrib3f(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib3f *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib3f *)data;
+
+   orig_evgl_api_glVertexAttrib3f(thread_param->indx,
+                                  thread_param->x,
+                                  thread_param->y,
+                                  thread_param->z);
+
+}
+
+EAPI void
+glVertexAttrib3f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib3f(indx, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib3f thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib3f *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib3fv(GLuint indx, const GLfloat* values);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   const GLfloat* values;
+
+} EVGL_API_Thread_Command_glVertexAttrib3fv;
+
+void (*orig_evgl_api_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
+
+static void
+_evgl_api_thread_glVertexAttrib3fv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib3fv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib3fv *)data;
+
+   orig_evgl_api_glVertexAttrib3fv(thread_param->indx,
+                                   thread_param->values);
+
+}
+
+EAPI void
+glVertexAttrib3fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib3fv(indx, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib3fv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib3fv *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+   GLfloat w;
+
+} EVGL_API_Thread_Command_glVertexAttrib4f;
+
+void (*orig_evgl_api_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+static void
+_evgl_api_thread_glVertexAttrib4f(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib4f *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib4f *)data;
+
+   orig_evgl_api_glVertexAttrib4f(thread_param->indx,
+                                  thread_param->x,
+                                  thread_param->y,
+                                  thread_param->z,
+                                  thread_param->w);
+
+}
+
+EAPI void
+glVertexAttrib4f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib4f(indx, x, y, z, w);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib4f thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib4f *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->w = w;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttrib4fv(GLuint indx, const GLfloat* values);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   const GLfloat* values;
+
+} EVGL_API_Thread_Command_glVertexAttrib4fv;
+
+void (*orig_evgl_api_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
+
+static void
+_evgl_api_thread_glVertexAttrib4fv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttrib4fv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttrib4fv *)data;
+
+   orig_evgl_api_glVertexAttrib4fv(thread_param->indx,
+                                   thread_param->values);
+
+}
+
+EAPI void
+glVertexAttrib4fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttrib4fv(indx, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttrib4fv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttrib4fv *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttrib4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+ */
+
+typedef struct
+{
+   GLuint indx;
+   GLint size;
+   GLenum type;
+   GLboolean normalized;
+   GLsizei stride;
+   const void* ptr;
+
+} EVGL_API_Thread_Command_glVertexAttribPointer;
+
+void (*orig_evgl_api_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+
+static void
+_evgl_api_thread_glVertexAttribPointer(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribPointer *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribPointer *)data;
+
+   orig_evgl_api_glVertexAttribPointer(thread_param->indx,
+                                       thread_param->size,
+                                       thread_param->type,
+                                       thread_param->normalized,
+                                       thread_param->stride,
+                                       thread_param->ptr);
+
+}
+
+EAPI void
+glVertexAttribPointer_evgl_api_thread_cmd(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribPointer thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribPointer *thread_param = &thread_param_local;
+
+   thread_param->indx = indx;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->normalized = normalized;
+   thread_param->stride = stride;
+   thread_param->ptr = ptr;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glViewport;
+
+void (*orig_evgl_api_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glViewport(void *data)
+{
+   EVGL_API_Thread_Command_glViewport *thread_param =
+      (EVGL_API_Thread_Command_glViewport *)data;
+
+   orig_evgl_api_glViewport(thread_param->x,
+                            thread_param->y,
+                            thread_param->width,
+                            thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glViewport_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glViewport(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glViewport thread_param_local;
+   EVGL_API_Thread_Command_glViewport *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glViewport *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glViewport));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glViewport,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEvasGLImageTargetTexture2DOES(GLenum target, EvasGLImage image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   EvasGLImage image;
+
+} EVGL_API_Thread_Command_glEvasGLImageTargetTexture2DOES;
+
+void (*orig_evgl_api_glEvasGLImageTargetTexture2DOES)(GLenum target, EvasGLImage image);
+
+static void
+_evgl_api_thread_glEvasGLImageTargetTexture2DOES(void *data)
+{
+   EVGL_API_Thread_Command_glEvasGLImageTargetTexture2DOES *thread_param =
+      (EVGL_API_Thread_Command_glEvasGLImageTargetTexture2DOES *)data;
+
+   orig_evgl_api_glEvasGLImageTargetTexture2DOES(thread_param->target,
+                                                 thread_param->image);
+
+}
+
+EAPI void
+glEvasGLImageTargetTexture2DOES_evgl_api_thread_cmd(GLenum target, EvasGLImage image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEvasGLImageTargetTexture2DOES(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEvasGLImageTargetTexture2DOES thread_param_local;
+   EVGL_API_Thread_Command_glEvasGLImageTargetTexture2DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEvasGLImageTargetTexture2DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEvasGLImageTargetRenderbufferStorageOES(GLenum target, EvasGLImage image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   EvasGLImage image;
+
+} EVGL_API_Thread_Command_glEvasGLImageTargetRenderbufferStorageOES;
+
+void (*orig_evgl_api_glEvasGLImageTargetRenderbufferStorageOES)(GLenum target, EvasGLImage image);
+
+static void
+_evgl_api_thread_glEvasGLImageTargetRenderbufferStorageOES(void *data)
+{
+   EVGL_API_Thread_Command_glEvasGLImageTargetRenderbufferStorageOES *thread_param =
+      (EVGL_API_Thread_Command_glEvasGLImageTargetRenderbufferStorageOES *)data;
+
+   orig_evgl_api_glEvasGLImageTargetRenderbufferStorageOES(thread_param->target,
+                                                           thread_param->image);
+
+}
+
+EAPI void
+glEvasGLImageTargetRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, EvasGLImage image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEvasGLImageTargetRenderbufferStorageOES(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEvasGLImageTargetRenderbufferStorageOES thread_param_local;
+   EVGL_API_Thread_Command_glEvasGLImageTargetRenderbufferStorageOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEvasGLImageTargetRenderbufferStorageOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLenum *binaryFormat;
+   void *binary;
+
+} EVGL_API_Thread_Command_glGetProgramBinaryOES;
+
+void (*orig_evgl_api_glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+static void
+_evgl_api_thread_glGetProgramBinaryOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramBinaryOES *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramBinaryOES *)data;
+
+   orig_evgl_api_glGetProgramBinaryOES(thread_param->program,
+                                       thread_param->bufSize,
+                                       thread_param->length,
+                                       thread_param->binaryFormat,
+                                       thread_param->binary);
+
+}
+
+EAPI void
+glGetProgramBinaryOES_evgl_api_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramBinaryOES thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramBinaryOES *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramBinaryOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramBinaryOES(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum binaryFormat;
+   const void *binary;
+   GLint length;
+   void *binary_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glProgramBinaryOES;
+
+void (*orig_evgl_api_glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+
+static void
+_evgl_api_thread_glProgramBinaryOES(void *data)
+{
+   EVGL_API_Thread_Command_glProgramBinaryOES *thread_param =
+      (EVGL_API_Thread_Command_glProgramBinaryOES *)data;
+
+   orig_evgl_api_glProgramBinaryOES(thread_param->program,
+                                    thread_param->binaryFormat,
+                                    thread_param->binary,
+                                    thread_param->length);
+
+
+   if (thread_param->binary_copied)
+     eina_mempool_free(_mp_default, thread_param->binary_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glProgramBinaryOES_evgl_api_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramBinaryOES(program, binaryFormat, binary, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramBinaryOES thread_param_local;
+   EVGL_API_Thread_Command_glProgramBinaryOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glProgramBinaryOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glProgramBinaryOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+   thread_param->length = length;
+
+   thread_param->binary_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (binary)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = length;
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->binary_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->binary_copied)
+          {
+             memcpy(thread_param->binary_copied, binary, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->binary = (const void  *)thread_param->binary_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramBinaryOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void *
+   glMapBufferOES(GLenum target, GLenum access);
+ */
+
+typedef struct
+{
+   void * return_value;
+   GLenum target;
+   GLenum access;
+
+} EVGL_API_Thread_Command_glMapBufferOES;
+
+void * (*orig_evgl_api_glMapBufferOES)(GLenum target, GLenum access);
+
+static void
+_evgl_api_thread_glMapBufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glMapBufferOES *thread_param =
+      (EVGL_API_Thread_Command_glMapBufferOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glMapBufferOES(thread_param->target,
+                                                             thread_param->access);
+
+}
+
+EAPI void *
+glMapBufferOES_evgl_api_thread_cmd(GLenum target, GLenum access)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glMapBufferOES(target, access);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMapBufferOES thread_param_local;
+   EVGL_API_Thread_Command_glMapBufferOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->access = access;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMapBufferOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glUnmapBufferOES(GLenum target);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLenum target;
+
+} EVGL_API_Thread_Command_glUnmapBufferOES;
+
+GLboolean (*orig_evgl_api_glUnmapBufferOES)(GLenum target);
+
+static void
+_evgl_api_thread_glUnmapBufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glUnmapBufferOES *thread_param =
+      (EVGL_API_Thread_Command_glUnmapBufferOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glUnmapBufferOES(thread_param->target);
+
+}
+
+EAPI GLboolean
+glUnmapBufferOES_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glUnmapBufferOES(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUnmapBufferOES thread_param_local;
+   EVGL_API_Thread_Command_glUnmapBufferOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUnmapBufferOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBufferPointervOES(GLenum target, GLenum pname, void** params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   void** params;
+
+} EVGL_API_Thread_Command_glGetBufferPointervOES;
+
+void (*orig_evgl_api_glGetBufferPointervOES)(GLenum target, GLenum pname, void** params);
+
+static void
+_evgl_api_thread_glGetBufferPointervOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetBufferPointervOES *thread_param =
+      (EVGL_API_Thread_Command_glGetBufferPointervOES *)data;
+
+   orig_evgl_api_glGetBufferPointervOES(thread_param->target,
+                                        thread_param->pname,
+                                        thread_param->params);
+
+}
+
+EAPI void
+glGetBufferPointervOES_evgl_api_thread_cmd(GLenum target, GLenum pname, void** params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBufferPointervOES(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBufferPointervOES thread_param_local;
+   EVGL_API_Thread_Command_glGetBufferPointervOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBufferPointervOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLint border;
+   GLenum format;
+   GLenum type;
+   const void* pixels;
+
+} EVGL_API_Thread_Command_glTexImage3DOES;
+
+void (*orig_evgl_api_glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+
+static void
+_evgl_api_thread_glTexImage3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexImage3DOES *thread_param =
+      (EVGL_API_Thread_Command_glTexImage3DOES *)data;
+
+   orig_evgl_api_glTexImage3DOES(thread_param->target,
+                                 thread_param->level,
+                                 thread_param->internalformat,
+                                 thread_param->width,
+                                 thread_param->height,
+                                 thread_param->depth,
+                                 thread_param->border,
+                                 thread_param->format,
+                                 thread_param->type,
+                                 thread_param->pixels);
+
+}
+
+EAPI void
+glTexImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexImage3DOES thread_param_local;
+   EVGL_API_Thread_Command_glTexImage3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->border = border;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexImage3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLenum format;
+   GLenum type;
+   const void* pixels;
+
+} EVGL_API_Thread_Command_glTexSubImage3DOES;
+
+void (*orig_evgl_api_glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+
+static void
+_evgl_api_thread_glTexSubImage3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexSubImage3DOES *thread_param =
+      (EVGL_API_Thread_Command_glTexSubImage3DOES *)data;
+
+   orig_evgl_api_glTexSubImage3DOES(thread_param->target,
+                                    thread_param->level,
+                                    thread_param->xoffset,
+                                    thread_param->yoffset,
+                                    thread_param->zoffset,
+                                    thread_param->width,
+                                    thread_param->height,
+                                    thread_param->depth,
+                                    thread_param->format,
+                                    thread_param->type,
+                                    thread_param->pixels);
+
+}
+
+EAPI void
+glTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexSubImage3DOES thread_param_local;
+   EVGL_API_Thread_Command_glTexSubImage3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexSubImage3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glCopyTexSubImage3DOES;
+
+void (*orig_evgl_api_glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glCopyTexSubImage3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glCopyTexSubImage3DOES *thread_param =
+      (EVGL_API_Thread_Command_glCopyTexSubImage3DOES *)data;
+
+   orig_evgl_api_glCopyTexSubImage3DOES(thread_param->target,
+                                        thread_param->level,
+                                        thread_param->xoffset,
+                                        thread_param->yoffset,
+                                        thread_param->zoffset,
+                                        thread_param->x,
+                                        thread_param->y,
+                                        thread_param->width,
+                                        thread_param->height);
+
+}
+
+EAPI void
+glCopyTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyTexSubImage3DOES thread_param_local;
+   EVGL_API_Thread_Command_glCopyTexSubImage3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyTexSubImage3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLint border;
+   GLsizei imageSize;
+   const void* data;
+
+} EVGL_API_Thread_Command_glCompressedTexImage3DOES;
+
+void (*orig_evgl_api_glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+
+static void
+_evgl_api_thread_glCompressedTexImage3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexImage3DOES *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexImage3DOES *)data;
+
+   orig_evgl_api_glCompressedTexImage3DOES(thread_param->target,
+                                           thread_param->level,
+                                           thread_param->internalformat,
+                                           thread_param->width,
+                                           thread_param->height,
+                                           thread_param->depth,
+                                           thread_param->border,
+                                           thread_param->imageSize,
+                                           thread_param->data);
+
+}
+
+EAPI void
+glCompressedTexImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexImage3DOES thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexImage3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->border = border;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexImage3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLenum format;
+   GLsizei imageSize;
+   const void* data;
+
+} EVGL_API_Thread_Command_glCompressedTexSubImage3DOES;
+
+void (*orig_evgl_api_glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+
+static void
+_evgl_api_thread_glCompressedTexSubImage3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexSubImage3DOES *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexSubImage3DOES *)data;
+
+   orig_evgl_api_glCompressedTexSubImage3DOES(thread_param->target,
+                                              thread_param->level,
+                                              thread_param->xoffset,
+                                              thread_param->yoffset,
+                                              thread_param->zoffset,
+                                              thread_param->width,
+                                              thread_param->height,
+                                              thread_param->depth,
+                                              thread_param->format,
+                                              thread_param->imageSize,
+                                              thread_param->data);
+
+}
+
+EAPI void
+glCompressedTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexSubImage3DOES thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexSubImage3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->format = format;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexSubImage3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   GLint zoffset;
+
+} EVGL_API_Thread_Command_glFramebufferTexture3DOES;
+
+void (*orig_evgl_api_glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+
+static void
+_evgl_api_thread_glFramebufferTexture3DOES(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture3DOES *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture3DOES *)data;
+
+   orig_evgl_api_glFramebufferTexture3DOES(thread_param->target,
+                                           thread_param->attachment,
+                                           thread_param->textarget,
+                                           thread_param->texture,
+                                           thread_param->level,
+                                           thread_param->zoffset);
+
+}
+
+EAPI void
+glFramebufferTexture3DOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture3DOES thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture3DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+   thread_param->zoffset = zoffset;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture3DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
+ */
+
+typedef struct
+{
+   GLint* numGroups;
+   GLsizei groupsSize;
+   GLuint* groups;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorGroupsAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorGroupsAMD)(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
+
+static void
+_evgl_api_thread_glGetPerfMonitorGroupsAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupsAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorGroupsAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorGroupsAMD(thread_param->numGroups,
+                                           thread_param->groupsSize,
+                                           thread_param->groups);
+
+}
+
+EAPI void
+glGetPerfMonitorGroupsAMD_evgl_api_thread_cmd(GLint* numGroups, GLsizei groupsSize, GLuint* groups)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupsAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupsAMD *thread_param = &thread_param_local;
+
+   thread_param->numGroups = numGroups;
+   thread_param->groupsSize = groupsSize;
+   thread_param->groups = groups;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorGroupsAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
+ */
+
+typedef struct
+{
+   GLuint group;
+   GLint* numCounters;
+   GLint* maxActiveCounters;
+   GLsizei counterSize;
+   GLuint* counters;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorCountersAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorCountersAMD)(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
+
+static void
+_evgl_api_thread_glGetPerfMonitorCountersAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorCountersAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorCountersAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorCountersAMD(thread_param->group,
+                                             thread_param->numCounters,
+                                             thread_param->maxActiveCounters,
+                                             thread_param->counterSize,
+                                             thread_param->counters);
+
+}
+
+EAPI void
+glGetPerfMonitorCountersAMD_evgl_api_thread_cmd(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorCountersAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorCountersAMD *thread_param = &thread_param_local;
+
+   thread_param->group = group;
+   thread_param->numCounters = numCounters;
+   thread_param->maxActiveCounters = maxActiveCounters;
+   thread_param->counterSize = counterSize;
+   thread_param->counters = counters;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorCountersAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
+ */
+
+typedef struct
+{
+   GLuint group;
+   GLsizei bufSize;
+   GLsizei* length;
+   char* groupString;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorGroupStringAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
+
+static void
+_evgl_api_thread_glGetPerfMonitorGroupStringAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupStringAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorGroupStringAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorGroupStringAMD(thread_param->group,
+                                                thread_param->bufSize,
+                                                thread_param->length,
+                                                thread_param->groupString);
+
+}
+
+EAPI void
+glGetPerfMonitorGroupStringAMD_evgl_api_thread_cmd(GLuint group, GLsizei bufSize, GLsizei* length, char* groupString)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupStringAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorGroupStringAMD *thread_param = &thread_param_local;
+
+   thread_param->group = group;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->groupString = groupString;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorGroupStringAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
+ */
+
+typedef struct
+{
+   GLuint group;
+   GLuint counter;
+   GLsizei bufSize;
+   GLsizei* length;
+   char* counterString;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorCounterStringAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
+
+static void
+_evgl_api_thread_glGetPerfMonitorCounterStringAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterStringAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorCounterStringAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorCounterStringAMD(thread_param->group,
+                                                  thread_param->counter,
+                                                  thread_param->bufSize,
+                                                  thread_param->length,
+                                                  thread_param->counterString);
+
+}
+
+EAPI void
+glGetPerfMonitorCounterStringAMD_evgl_api_thread_cmd(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterStringAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterStringAMD *thread_param = &thread_param_local;
+
+   thread_param->group = group;
+   thread_param->counter = counter;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->counterString = counterString;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorCounterStringAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, void* data);
+ */
+
+typedef struct
+{
+   GLuint group;
+   GLuint counter;
+   GLenum pname;
+   void* data;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorCounterInfoAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, void* data);
+
+static void
+_evgl_api_thread_glGetPerfMonitorCounterInfoAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterInfoAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorCounterInfoAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorCounterInfoAMD(thread_param->group,
+                                                thread_param->counter,
+                                                thread_param->pname,
+                                                thread_param->data);
+
+}
+
+EAPI void
+glGetPerfMonitorCounterInfoAMD_evgl_api_thread_cmd(GLuint group, GLuint counter, GLenum pname, void* data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorCounterInfoAMD(group, counter, pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterInfoAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterInfoAMD *thread_param = &thread_param_local;
+
+   thread_param->group = group;
+   thread_param->counter = counter;
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorCounterInfoAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* monitors;
+
+} EVGL_API_Thread_Command_glGenPerfMonitorsAMD;
+
+void (*orig_evgl_api_glGenPerfMonitorsAMD)(GLsizei n, GLuint* monitors);
+
+static void
+_evgl_api_thread_glGenPerfMonitorsAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGenPerfMonitorsAMD *thread_param =
+      (EVGL_API_Thread_Command_glGenPerfMonitorsAMD *)data;
+
+   orig_evgl_api_glGenPerfMonitorsAMD(thread_param->n,
+                                      thread_param->monitors);
+
+}
+
+EAPI void
+glGenPerfMonitorsAMD_evgl_api_thread_cmd(GLsizei n, GLuint* monitors)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenPerfMonitorsAMD(n, monitors);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenPerfMonitorsAMD thread_param_local;
+   EVGL_API_Thread_Command_glGenPerfMonitorsAMD *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->monitors = monitors;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenPerfMonitorsAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* monitors;
+
+} EVGL_API_Thread_Command_glDeletePerfMonitorsAMD;
+
+void (*orig_evgl_api_glDeletePerfMonitorsAMD)(GLsizei n, GLuint* monitors);
+
+static void
+_evgl_api_thread_glDeletePerfMonitorsAMD(void *data)
+{
+   EVGL_API_Thread_Command_glDeletePerfMonitorsAMD *thread_param =
+      (EVGL_API_Thread_Command_glDeletePerfMonitorsAMD *)data;
+
+   orig_evgl_api_glDeletePerfMonitorsAMD(thread_param->n,
+                                         thread_param->monitors);
+
+}
+
+EAPI void
+glDeletePerfMonitorsAMD_evgl_api_thread_cmd(GLsizei n, GLuint* monitors)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeletePerfMonitorsAMD(n, monitors);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeletePerfMonitorsAMD thread_param_local;
+   EVGL_API_Thread_Command_glDeletePerfMonitorsAMD *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->monitors = monitors;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeletePerfMonitorsAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
+ */
+
+typedef struct
+{
+   GLuint monitor;
+   GLboolean enable;
+   GLuint group;
+   GLint numCounters;
+   GLuint* countersList;
+
+} EVGL_API_Thread_Command_glSelectPerfMonitorCountersAMD;
+
+void (*orig_evgl_api_glSelectPerfMonitorCountersAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
+
+static void
+_evgl_api_thread_glSelectPerfMonitorCountersAMD(void *data)
+{
+   EVGL_API_Thread_Command_glSelectPerfMonitorCountersAMD *thread_param =
+      (EVGL_API_Thread_Command_glSelectPerfMonitorCountersAMD *)data;
+
+   orig_evgl_api_glSelectPerfMonitorCountersAMD(thread_param->monitor,
+                                                thread_param->enable,
+                                                thread_param->group,
+                                                thread_param->numCounters,
+                                                thread_param->countersList);
+
+}
+
+EAPI void
+glSelectPerfMonitorCountersAMD_evgl_api_thread_cmd(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, countersList);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSelectPerfMonitorCountersAMD thread_param_local;
+   EVGL_API_Thread_Command_glSelectPerfMonitorCountersAMD *thread_param = &thread_param_local;
+
+   thread_param->monitor = monitor;
+   thread_param->enable = enable;
+   thread_param->group = group;
+   thread_param->numCounters = numCounters;
+   thread_param->countersList = countersList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSelectPerfMonitorCountersAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBeginPerfMonitorAMD(GLuint monitor);
+ */
+
+typedef struct
+{
+   GLuint monitor;
+
+} EVGL_API_Thread_Command_glBeginPerfMonitorAMD;
+
+void (*orig_evgl_api_glBeginPerfMonitorAMD)(GLuint monitor);
+
+static void
+_evgl_api_thread_glBeginPerfMonitorAMD(void *data)
+{
+   EVGL_API_Thread_Command_glBeginPerfMonitorAMD *thread_param =
+      (EVGL_API_Thread_Command_glBeginPerfMonitorAMD *)data;
+
+   orig_evgl_api_glBeginPerfMonitorAMD(thread_param->monitor);
+
+}
+
+EAPI void
+glBeginPerfMonitorAMD_evgl_api_thread_cmd(GLuint monitor)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBeginPerfMonitorAMD(monitor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBeginPerfMonitorAMD thread_param_local;
+   EVGL_API_Thread_Command_glBeginPerfMonitorAMD *thread_param = &thread_param_local;
+
+   thread_param->monitor = monitor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBeginPerfMonitorAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEndPerfMonitorAMD(GLuint monitor);
+ */
+
+typedef struct
+{
+   GLuint monitor;
+
+} EVGL_API_Thread_Command_glEndPerfMonitorAMD;
+
+void (*orig_evgl_api_glEndPerfMonitorAMD)(GLuint monitor);
+
+static void
+_evgl_api_thread_glEndPerfMonitorAMD(void *data)
+{
+   EVGL_API_Thread_Command_glEndPerfMonitorAMD *thread_param =
+      (EVGL_API_Thread_Command_glEndPerfMonitorAMD *)data;
+
+   orig_evgl_api_glEndPerfMonitorAMD(thread_param->monitor);
+
+}
+
+EAPI void
+glEndPerfMonitorAMD_evgl_api_thread_cmd(GLuint monitor)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEndPerfMonitorAMD(monitor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEndPerfMonitorAMD thread_param_local;
+   EVGL_API_Thread_Command_glEndPerfMonitorAMD *thread_param = &thread_param_local;
+
+   thread_param->monitor = monitor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEndPerfMonitorAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
+ */
+
+typedef struct
+{
+   GLuint monitor;
+   GLenum pname;
+   GLsizei dataSize;
+   GLuint* data;
+   GLint* bytesWritten;
+
+} EVGL_API_Thread_Command_glGetPerfMonitorCounterDataAMD;
+
+void (*orig_evgl_api_glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
+
+static void
+_evgl_api_thread_glGetPerfMonitorCounterDataAMD(void *data)
+{
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterDataAMD *thread_param =
+      (EVGL_API_Thread_Command_glGetPerfMonitorCounterDataAMD *)data;
+
+   orig_evgl_api_glGetPerfMonitorCounterDataAMD(thread_param->monitor,
+                                                thread_param->pname,
+                                                thread_param->dataSize,
+                                                thread_param->data,
+                                                thread_param->bytesWritten);
+
+}
+
+EAPI void
+glGetPerfMonitorCounterDataAMD_evgl_api_thread_cmd(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterDataAMD thread_param_local;
+   EVGL_API_Thread_Command_glGetPerfMonitorCounterDataAMD *thread_param = &thread_param_local;
+
+   thread_param->monitor = monitor;
+   thread_param->pname = pname;
+   thread_param->dataSize = dataSize;
+   thread_param->data = data;
+   thread_param->bytesWritten = bytesWritten;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPerfMonitorCounterDataAMD,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDiscardFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei numAttachments;
+   const GLenum* attachments;
+
+} EVGL_API_Thread_Command_glDiscardFramebuffer;
+
+void (*orig_evgl_api_glDiscardFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+static void
+_evgl_api_thread_glDiscardFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glDiscardFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glDiscardFramebuffer *)data;
+
+   orig_evgl_api_glDiscardFramebuffer(thread_param->target,
+                                      thread_param->numAttachments,
+                                      thread_param->attachments);
+
+}
+
+EAPI void
+glDiscardFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDiscardFramebuffer(target, numAttachments, attachments);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDiscardFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glDiscardFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->numAttachments = numAttachments;
+   thread_param->attachments = attachments;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDiscardFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei numAttachments;
+   const GLenum* attachments;
+
+} EVGL_API_Thread_Command_glDiscardFramebufferEXT;
+
+void (*orig_evgl_api_glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+static void
+_evgl_api_thread_glDiscardFramebufferEXT(void *data)
+{
+   EVGL_API_Thread_Command_glDiscardFramebufferEXT *thread_param =
+      (EVGL_API_Thread_Command_glDiscardFramebufferEXT *)data;
+
+   orig_evgl_api_glDiscardFramebufferEXT(thread_param->target,
+                                         thread_param->numAttachments,
+                                         thread_param->attachments);
+
+}
+
+EAPI void
+glDiscardFramebufferEXT_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDiscardFramebufferEXT(target, numAttachments, attachments);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDiscardFramebufferEXT thread_param_local;
+   EVGL_API_Thread_Command_glDiscardFramebufferEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->numAttachments = numAttachments;
+   thread_param->attachments = attachments;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDiscardFramebufferEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiDrawArrays(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint* first;
+   GLsizei* count;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glMultiDrawArrays;
+
+void (*orig_evgl_api_glMultiDrawArrays)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+
+static void
+_evgl_api_thread_glMultiDrawArrays(void *data)
+{
+   EVGL_API_Thread_Command_glMultiDrawArrays *thread_param =
+      (EVGL_API_Thread_Command_glMultiDrawArrays *)data;
+
+   orig_evgl_api_glMultiDrawArrays(thread_param->mode,
+                                   thread_param->first,
+                                   thread_param->count,
+                                   thread_param->primcount);
+
+}
+
+EAPI void
+glMultiDrawArrays_evgl_api_thread_cmd(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiDrawArrays(mode, first, count, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiDrawArrays thread_param_local;
+   EVGL_API_Thread_Command_glMultiDrawArrays *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiDrawArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiDrawArraysEXT(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint* first;
+   GLsizei* count;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glMultiDrawArraysEXT;
+
+void (*orig_evgl_api_glMultiDrawArraysEXT)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+
+static void
+_evgl_api_thread_glMultiDrawArraysEXT(void *data)
+{
+   EVGL_API_Thread_Command_glMultiDrawArraysEXT *thread_param =
+      (EVGL_API_Thread_Command_glMultiDrawArraysEXT *)data;
+
+   orig_evgl_api_glMultiDrawArraysEXT(thread_param->mode,
+                                      thread_param->first,
+                                      thread_param->count,
+                                      thread_param->primcount);
+
+}
+
+EAPI void
+glMultiDrawArraysEXT_evgl_api_thread_cmd(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiDrawArraysEXT(mode, first, count, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiDrawArraysEXT thread_param_local;
+   EVGL_API_Thread_Command_glMultiDrawArraysEXT *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiDrawArraysEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiDrawElements(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   const GLsizei* count;
+   GLenum type;
+   const GLvoid** indices;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glMultiDrawElements;
+
+void (*orig_evgl_api_glMultiDrawElements)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+
+static void
+_evgl_api_thread_glMultiDrawElements(void *data)
+{
+   EVGL_API_Thread_Command_glMultiDrawElements *thread_param =
+      (EVGL_API_Thread_Command_glMultiDrawElements *)data;
+
+   orig_evgl_api_glMultiDrawElements(thread_param->mode,
+                                     thread_param->count,
+                                     thread_param->type,
+                                     thread_param->indices,
+                                     thread_param->primcount);
+
+}
+
+EAPI void
+glMultiDrawElements_evgl_api_thread_cmd(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiDrawElements(mode, count, type, indices, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiDrawElements thread_param_local;
+   EVGL_API_Thread_Command_glMultiDrawElements *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiDrawElements,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   const GLsizei* count;
+   GLenum type;
+   const GLvoid** indices;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glMultiDrawElementsEXT;
+
+void (*orig_evgl_api_glMultiDrawElementsEXT)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+
+static void
+_evgl_api_thread_glMultiDrawElementsEXT(void *data)
+{
+   EVGL_API_Thread_Command_glMultiDrawElementsEXT *thread_param =
+      (EVGL_API_Thread_Command_glMultiDrawElementsEXT *)data;
+
+   orig_evgl_api_glMultiDrawElementsEXT(thread_param->mode,
+                                        thread_param->count,
+                                        thread_param->type,
+                                        thread_param->indices,
+                                        thread_param->primcount);
+
+}
+
+EAPI void
+glMultiDrawElementsEXT_evgl_api_thread_cmd(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiDrawElementsEXT(mode, count, type, indices, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiDrawElementsEXT thread_param_local;
+   EVGL_API_Thread_Command_glMultiDrawElementsEXT *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiDrawElementsEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteFencesNV(GLsizei n, const GLuint* fences);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* fences;
+
+} EVGL_API_Thread_Command_glDeleteFencesNV;
+
+void (*orig_evgl_api_glDeleteFencesNV)(GLsizei n, const GLuint* fences);
+
+static void
+_evgl_api_thread_glDeleteFencesNV(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteFencesNV *thread_param =
+      (EVGL_API_Thread_Command_glDeleteFencesNV *)data;
+
+   orig_evgl_api_glDeleteFencesNV(thread_param->n,
+                                  thread_param->fences);
+
+}
+
+EAPI void
+glDeleteFencesNV_evgl_api_thread_cmd(GLsizei n, const GLuint* fences)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteFencesNV(n, fences);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteFencesNV thread_param_local;
+   EVGL_API_Thread_Command_glDeleteFencesNV *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->fences = fences;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteFencesNV,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenFencesNV(GLsizei n, GLuint* fences);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* fences;
+
+} EVGL_API_Thread_Command_glGenFencesNV;
+
+void (*orig_evgl_api_glGenFencesNV)(GLsizei n, GLuint* fences);
+
+static void
+_evgl_api_thread_glGenFencesNV(void *data)
+{
+   EVGL_API_Thread_Command_glGenFencesNV *thread_param =
+      (EVGL_API_Thread_Command_glGenFencesNV *)data;
+
+   orig_evgl_api_glGenFencesNV(thread_param->n,
+                               thread_param->fences);
+
+}
+
+EAPI void
+glGenFencesNV_evgl_api_thread_cmd(GLsizei n, GLuint* fences)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenFencesNV(n, fences);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenFencesNV thread_param_local;
+   EVGL_API_Thread_Command_glGenFencesNV *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->fences = fences;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenFencesNV,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsFenceNV(GLuint fence);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint fence;
+
+} EVGL_API_Thread_Command_glIsFenceNV;
+
+GLboolean (*orig_evgl_api_glIsFenceNV)(GLuint fence);
+
+static void
+_evgl_api_thread_glIsFenceNV(void *data)
+{
+   EVGL_API_Thread_Command_glIsFenceNV *thread_param =
+      (EVGL_API_Thread_Command_glIsFenceNV *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsFenceNV(thread_param->fence);
+
+}
+
+EAPI GLboolean
+glIsFenceNV_evgl_api_thread_cmd(GLuint fence)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsFenceNV(fence);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsFenceNV thread_param_local;
+   EVGL_API_Thread_Command_glIsFenceNV *thread_param = &thread_param_local;
+
+   thread_param->fence = fence;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsFenceNV,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glTestFenceNV(GLuint fence);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint fence;
+
+} EVGL_API_Thread_Command_glTestFenceNV;
+
+GLboolean (*orig_evgl_api_glTestFenceNV)(GLuint fence);
+
+static void
+_evgl_api_thread_glTestFenceNV(void *data)
+{
+   EVGL_API_Thread_Command_glTestFenceNV *thread_param =
+      (EVGL_API_Thread_Command_glTestFenceNV *)data;
+
+   thread_param->return_value = orig_evgl_api_glTestFenceNV(thread_param->fence);
+
+}
+
+EAPI GLboolean
+glTestFenceNV_evgl_api_thread_cmd(GLuint fence)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glTestFenceNV(fence);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTestFenceNV thread_param_local;
+   EVGL_API_Thread_Command_glTestFenceNV *thread_param = &thread_param_local;
+
+   thread_param->fence = fence;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTestFenceNV,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint fence;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetFenceivNV;
+
+void (*orig_evgl_api_glGetFenceivNV)(GLuint fence, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetFenceivNV(void *data)
+{
+   EVGL_API_Thread_Command_glGetFenceivNV *thread_param =
+      (EVGL_API_Thread_Command_glGetFenceivNV *)data;
+
+   orig_evgl_api_glGetFenceivNV(thread_param->fence,
+                                thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetFenceivNV_evgl_api_thread_cmd(GLuint fence, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFenceivNV(fence, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFenceivNV thread_param_local;
+   EVGL_API_Thread_Command_glGetFenceivNV *thread_param = &thread_param_local;
+
+   thread_param->fence = fence;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFenceivNV,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFinishFenceNV(GLuint fence);
+ */
+
+typedef struct
+{
+   GLuint fence;
+
+} EVGL_API_Thread_Command_glFinishFenceNV;
+
+void (*orig_evgl_api_glFinishFenceNV)(GLuint fence);
+
+static void
+_evgl_api_thread_glFinishFenceNV(void *data)
+{
+   EVGL_API_Thread_Command_glFinishFenceNV *thread_param =
+      (EVGL_API_Thread_Command_glFinishFenceNV *)data;
+
+   orig_evgl_api_glFinishFenceNV(thread_param->fence);
+
+}
+
+EAPI void
+glFinishFenceNV_evgl_api_thread_cmd(GLuint fence)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFinishFenceNV(fence);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFinishFenceNV thread_param_local;
+   EVGL_API_Thread_Command_glFinishFenceNV *thread_param = &thread_param_local;
+
+   thread_param->fence = fence;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFinishFenceNV,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSetFenceNV(GLuint a, GLenum b);
+ */
+
+typedef struct
+{
+   GLuint a;
+   GLenum b;
+
+} EVGL_API_Thread_Command_glSetFenceNV;
+
+void (*orig_evgl_api_glSetFenceNV)(GLuint a, GLenum b);
+
+static void
+_evgl_api_thread_glSetFenceNV(void *data)
+{
+   EVGL_API_Thread_Command_glSetFenceNV *thread_param =
+      (EVGL_API_Thread_Command_glSetFenceNV *)data;
+
+   orig_evgl_api_glSetFenceNV(thread_param->a,
+                              thread_param->b);
+
+}
+
+EAPI void
+glSetFenceNV_evgl_api_thread_cmd(GLuint a, GLenum b)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSetFenceNV(a, b);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSetFenceNV thread_param_local;
+   EVGL_API_Thread_Command_glSetFenceNV *thread_param = &thread_param_local;
+
+   thread_param->a = a;
+   thread_param->b = b;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSetFenceNV,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
+ */
+
+typedef struct
+{
+   GLint* num;
+   GLsizei size;
+   GLuint* driverControls;
+
+} EVGL_API_Thread_Command_glGetDriverControlsQCOM;
+
+void (*orig_evgl_api_glGetDriverControlsQCOM)(GLint* num, GLsizei size, GLuint* driverControls);
+
+static void
+_evgl_api_thread_glGetDriverControlsQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glGetDriverControlsQCOM *thread_param =
+      (EVGL_API_Thread_Command_glGetDriverControlsQCOM *)data;
+
+   orig_evgl_api_glGetDriverControlsQCOM(thread_param->num,
+                                         thread_param->size,
+                                         thread_param->driverControls);
+
+}
+
+EAPI void
+glGetDriverControlsQCOM_evgl_api_thread_cmd(GLint* num, GLsizei size, GLuint* driverControls)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetDriverControlsQCOM(num, size, driverControls);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetDriverControlsQCOM thread_param_local;
+   EVGL_API_Thread_Command_glGetDriverControlsQCOM *thread_param = &thread_param_local;
+
+   thread_param->num = num;
+   thread_param->size = size;
+   thread_param->driverControls = driverControls;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetDriverControlsQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
+ */
+
+typedef struct
+{
+   GLuint driverControl;
+   GLsizei bufSize;
+   GLsizei* length;
+   char* driverControlString;
+
+} EVGL_API_Thread_Command_glGetDriverControlStringQCOM;
+
+void (*orig_evgl_api_glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
+
+static void
+_evgl_api_thread_glGetDriverControlStringQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glGetDriverControlStringQCOM *thread_param =
+      (EVGL_API_Thread_Command_glGetDriverControlStringQCOM *)data;
+
+   orig_evgl_api_glGetDriverControlStringQCOM(thread_param->driverControl,
+                                              thread_param->bufSize,
+                                              thread_param->length,
+                                              thread_param->driverControlString);
+
+}
+
+EAPI void
+glGetDriverControlStringQCOM_evgl_api_thread_cmd(GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetDriverControlStringQCOM thread_param_local;
+   EVGL_API_Thread_Command_glGetDriverControlStringQCOM *thread_param = &thread_param_local;
+
+   thread_param->driverControl = driverControl;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->driverControlString = driverControlString;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetDriverControlStringQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnableDriverControlQCOM(GLuint driverControl);
+ */
+
+typedef struct
+{
+   GLuint driverControl;
+
+} EVGL_API_Thread_Command_glEnableDriverControlQCOM;
+
+void (*orig_evgl_api_glEnableDriverControlQCOM)(GLuint driverControl);
+
+static void
+_evgl_api_thread_glEnableDriverControlQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glEnableDriverControlQCOM *thread_param =
+      (EVGL_API_Thread_Command_glEnableDriverControlQCOM *)data;
+
+   orig_evgl_api_glEnableDriverControlQCOM(thread_param->driverControl);
+
+}
+
+EAPI void
+glEnableDriverControlQCOM_evgl_api_thread_cmd(GLuint driverControl)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEnableDriverControlQCOM(driverControl);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEnableDriverControlQCOM thread_param_local;
+   EVGL_API_Thread_Command_glEnableDriverControlQCOM *thread_param = &thread_param_local;
+
+   thread_param->driverControl = driverControl;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEnableDriverControlQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisableDriverControlQCOM(GLuint driverControl);
+ */
+
+typedef struct
+{
+   GLuint driverControl;
+
+} EVGL_API_Thread_Command_glDisableDriverControlQCOM;
+
+void (*orig_evgl_api_glDisableDriverControlQCOM)(GLuint driverControl);
+
+static void
+_evgl_api_thread_glDisableDriverControlQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glDisableDriverControlQCOM *thread_param =
+      (EVGL_API_Thread_Command_glDisableDriverControlQCOM *)data;
+
+   orig_evgl_api_glDisableDriverControlQCOM(thread_param->driverControl);
+
+}
+
+EAPI void
+glDisableDriverControlQCOM_evgl_api_thread_cmd(GLuint driverControl)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDisableDriverControlQCOM(driverControl);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDisableDriverControlQCOM thread_param_local;
+   EVGL_API_Thread_Command_glDisableDriverControlQCOM *thread_param = &thread_param_local;
+
+   thread_param->driverControl = driverControl;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDisableDriverControlQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
+ */
+
+typedef struct
+{
+   GLuint* textures;
+   GLint maxTextures;
+   GLint* numTextures;
+
+} EVGL_API_Thread_Command_glExtGetTexturesQCOM;
+
+void (*orig_evgl_api_glExtGetTexturesQCOM)(GLuint* textures, GLint maxTextures, GLint* numTextures);
+
+static void
+_evgl_api_thread_glExtGetTexturesQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetTexturesQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetTexturesQCOM *)data;
+
+   orig_evgl_api_glExtGetTexturesQCOM(thread_param->textures,
+                                      thread_param->maxTextures,
+                                      thread_param->numTextures);
+
+}
+
+EAPI void
+glExtGetTexturesQCOM_evgl_api_thread_cmd(GLuint* textures, GLint maxTextures, GLint* numTextures)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetTexturesQCOM(textures, maxTextures, numTextures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetTexturesQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetTexturesQCOM *thread_param = &thread_param_local;
+
+   thread_param->textures = textures;
+   thread_param->maxTextures = maxTextures;
+   thread_param->numTextures = numTextures;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetTexturesQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+ */
+
+typedef struct
+{
+   GLuint* buffers;
+   GLint maxBuffers;
+   GLint* numBuffers;
+
+} EVGL_API_Thread_Command_glExtGetBuffersQCOM;
+
+void (*orig_evgl_api_glExtGetBuffersQCOM)(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+
+static void
+_evgl_api_thread_glExtGetBuffersQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetBuffersQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetBuffersQCOM *)data;
+
+   orig_evgl_api_glExtGetBuffersQCOM(thread_param->buffers,
+                                     thread_param->maxBuffers,
+                                     thread_param->numBuffers);
+
+}
+
+EAPI void
+glExtGetBuffersQCOM_evgl_api_thread_cmd(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetBuffersQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetBuffersQCOM *thread_param = &thread_param_local;
+
+   thread_param->buffers = buffers;
+   thread_param->maxBuffers = maxBuffers;
+   thread_param->numBuffers = numBuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetBuffersQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+ */
+
+typedef struct
+{
+   GLuint* renderbuffers;
+   GLint maxRenderbuffers;
+   GLint* numRenderbuffers;
+
+} EVGL_API_Thread_Command_glExtGetRenderbuffersQCOM;
+
+void (*orig_evgl_api_glExtGetRenderbuffersQCOM)(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+
+static void
+_evgl_api_thread_glExtGetRenderbuffersQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetRenderbuffersQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetRenderbuffersQCOM *)data;
+
+   orig_evgl_api_glExtGetRenderbuffersQCOM(thread_param->renderbuffers,
+                                           thread_param->maxRenderbuffers,
+                                           thread_param->numRenderbuffers);
+
+}
+
+EAPI void
+glExtGetRenderbuffersQCOM_evgl_api_thread_cmd(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetRenderbuffersQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetRenderbuffersQCOM *thread_param = &thread_param_local;
+
+   thread_param->renderbuffers = renderbuffers;
+   thread_param->maxRenderbuffers = maxRenderbuffers;
+   thread_param->numRenderbuffers = numRenderbuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetRenderbuffersQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+ */
+
+typedef struct
+{
+   GLuint* framebuffers;
+   GLint maxFramebuffers;
+   GLint* numFramebuffers;
+
+} EVGL_API_Thread_Command_glExtGetFramebuffersQCOM;
+
+void (*orig_evgl_api_glExtGetFramebuffersQCOM)(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+
+static void
+_evgl_api_thread_glExtGetFramebuffersQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetFramebuffersQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetFramebuffersQCOM *)data;
+
+   orig_evgl_api_glExtGetFramebuffersQCOM(thread_param->framebuffers,
+                                          thread_param->maxFramebuffers,
+                                          thread_param->numFramebuffers);
+
+}
+
+EAPI void
+glExtGetFramebuffersQCOM_evgl_api_thread_cmd(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetFramebuffersQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetFramebuffersQCOM *thread_param = &thread_param_local;
+
+   thread_param->framebuffers = framebuffers;
+   thread_param->maxFramebuffers = maxFramebuffers;
+   thread_param->numFramebuffers = numFramebuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetFramebuffersQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLuint texture;
+   GLenum face;
+   GLint level;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glExtGetTexLevelParameterivQCOM;
+
+void (*orig_evgl_api_glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glExtGetTexLevelParameterivQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetTexLevelParameterivQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetTexLevelParameterivQCOM *)data;
+
+   orig_evgl_api_glExtGetTexLevelParameterivQCOM(thread_param->texture,
+                                                 thread_param->face,
+                                                 thread_param->level,
+                                                 thread_param->pname,
+                                                 thread_param->params);
+
+}
+
+EAPI void
+glExtGetTexLevelParameterivQCOM_evgl_api_thread_cmd(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetTexLevelParameterivQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetTexLevelParameterivQCOM *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+   thread_param->face = face;
+   thread_param->level = level;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetTexLevelParameterivQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+
+} EVGL_API_Thread_Command_glExtTexObjectStateOverrideiQCOM;
+
+void (*orig_evgl_api_glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glExtTexObjectStateOverrideiQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtTexObjectStateOverrideiQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtTexObjectStateOverrideiQCOM *)data;
+
+   orig_evgl_api_glExtTexObjectStateOverrideiQCOM(thread_param->target,
+                                                  thread_param->pname,
+                                                  thread_param->param);
+
+}
+
+EAPI void
+glExtTexObjectStateOverrideiQCOM_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtTexObjectStateOverrideiQCOM(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtTexObjectStateOverrideiQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtTexObjectStateOverrideiQCOM *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtTexObjectStateOverrideiQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLenum format;
+   GLenum type;
+   void* texels;
+
+} EVGL_API_Thread_Command_glExtGetTexSubImageQCOM;
+
+void (*orig_evgl_api_glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
+
+static void
+_evgl_api_thread_glExtGetTexSubImageQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetTexSubImageQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetTexSubImageQCOM *)data;
+
+   orig_evgl_api_glExtGetTexSubImageQCOM(thread_param->target,
+                                         thread_param->level,
+                                         thread_param->xoffset,
+                                         thread_param->yoffset,
+                                         thread_param->zoffset,
+                                         thread_param->width,
+                                         thread_param->height,
+                                         thread_param->depth,
+                                         thread_param->format,
+                                         thread_param->type,
+                                         thread_param->texels);
+
+}
+
+EAPI void
+glExtGetTexSubImageQCOM_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetTexSubImageQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetTexSubImageQCOM *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->texels = texels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetTexSubImageQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetBufferPointervQCOM(GLenum target, void** params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   void** params;
+
+} EVGL_API_Thread_Command_glExtGetBufferPointervQCOM;
+
+void (*orig_evgl_api_glExtGetBufferPointervQCOM)(GLenum target, void** params);
+
+static void
+_evgl_api_thread_glExtGetBufferPointervQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetBufferPointervQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetBufferPointervQCOM *)data;
+
+   orig_evgl_api_glExtGetBufferPointervQCOM(thread_param->target,
+                                            thread_param->params);
+
+}
+
+EAPI void
+glExtGetBufferPointervQCOM_evgl_api_thread_cmd(GLenum target, void** params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetBufferPointervQCOM(target, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetBufferPointervQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetBufferPointervQCOM *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetBufferPointervQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+ */
+
+typedef struct
+{
+   GLuint* shaders;
+   GLint maxShaders;
+   GLint* numShaders;
+
+} EVGL_API_Thread_Command_glExtGetShadersQCOM;
+
+void (*orig_evgl_api_glExtGetShadersQCOM)(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+
+static void
+_evgl_api_thread_glExtGetShadersQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetShadersQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetShadersQCOM *)data;
+
+   orig_evgl_api_glExtGetShadersQCOM(thread_param->shaders,
+                                     thread_param->maxShaders,
+                                     thread_param->numShaders);
+
+}
+
+EAPI void
+glExtGetShadersQCOM_evgl_api_thread_cmd(GLuint* shaders, GLint maxShaders, GLint* numShaders)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetShadersQCOM(shaders, maxShaders, numShaders);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetShadersQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetShadersQCOM *thread_param = &thread_param_local;
+
+   thread_param->shaders = shaders;
+   thread_param->maxShaders = maxShaders;
+   thread_param->numShaders = numShaders;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetShadersQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+ */
+
+typedef struct
+{
+   GLuint* programs;
+   GLint maxPrograms;
+   GLint* numPrograms;
+
+} EVGL_API_Thread_Command_glExtGetProgramsQCOM;
+
+void (*orig_evgl_api_glExtGetProgramsQCOM)(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+
+static void
+_evgl_api_thread_glExtGetProgramsQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetProgramsQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetProgramsQCOM *)data;
+
+   orig_evgl_api_glExtGetProgramsQCOM(thread_param->programs,
+                                      thread_param->maxPrograms,
+                                      thread_param->numPrograms);
+
+}
+
+EAPI void
+glExtGetProgramsQCOM_evgl_api_thread_cmd(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetProgramsQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetProgramsQCOM *thread_param = &thread_param_local;
+
+   thread_param->programs = programs;
+   thread_param->maxPrograms = maxPrograms;
+   thread_param->numPrograms = numPrograms;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetProgramsQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glExtIsProgramBinaryQCOM(GLuint program);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint program;
+
+} EVGL_API_Thread_Command_glExtIsProgramBinaryQCOM;
+
+GLboolean (*orig_evgl_api_glExtIsProgramBinaryQCOM)(GLuint program);
+
+static void
+_evgl_api_thread_glExtIsProgramBinaryQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtIsProgramBinaryQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtIsProgramBinaryQCOM *)data;
+
+   thread_param->return_value = orig_evgl_api_glExtIsProgramBinaryQCOM(thread_param->program);
+
+}
+
+EAPI GLboolean
+glExtIsProgramBinaryQCOM_evgl_api_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glExtIsProgramBinaryQCOM(program);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtIsProgramBinaryQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtIsProgramBinaryQCOM *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtIsProgramBinaryQCOM,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, char* source, GLint* length);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum shadertype;
+   char* source;
+   GLint* length;
+
+} EVGL_API_Thread_Command_glExtGetProgramBinarySourceQCOM;
+
+void (*orig_evgl_api_glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, char* source, GLint* length);
+
+static void
+_evgl_api_thread_glExtGetProgramBinarySourceQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glExtGetProgramBinarySourceQCOM *thread_param =
+      (EVGL_API_Thread_Command_glExtGetProgramBinarySourceQCOM *)data;
+
+   orig_evgl_api_glExtGetProgramBinarySourceQCOM(thread_param->program,
+                                                 thread_param->shadertype,
+                                                 thread_param->source,
+                                                 thread_param->length);
+
+}
+
+EAPI void
+glExtGetProgramBinarySourceQCOM_evgl_api_thread_cmd(GLuint program, GLenum shadertype, char* source, GLint* length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glExtGetProgramBinarySourceQCOM thread_param_local;
+   EVGL_API_Thread_Command_glExtGetProgramBinarySourceQCOM *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->shadertype = shadertype;
+   thread_param->source = source;
+   thread_param->length = length;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glExtGetProgramBinarySourceQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glAlphaFunc(GLenum func, GLclampf ref);
+ */
+
+typedef struct
+{
+   GLenum func;
+   GLclampf ref;
+
+} EVGL_API_Thread_Command_glAlphaFunc;
+
+void (*orig_evgl_api_glAlphaFunc)(GLenum func, GLclampf ref);
+
+static void
+_evgl_api_thread_glAlphaFunc(void *data)
+{
+   EVGL_API_Thread_Command_glAlphaFunc *thread_param =
+      (EVGL_API_Thread_Command_glAlphaFunc *)data;
+
+   orig_evgl_api_glAlphaFunc(thread_param->func,
+                             thread_param->ref);
+
+}
+
+EAPI void
+glAlphaFunc_evgl_api_thread_cmd(GLenum func, GLclampf ref)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glAlphaFunc(func, ref);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glAlphaFunc thread_param_local;
+   EVGL_API_Thread_Command_glAlphaFunc *thread_param = &thread_param_local;
+
+   thread_param->func = func;
+   thread_param->ref = ref;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glAlphaFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanef(GLenum plane, const GLfloat *equation);
+ */
+
+typedef struct
+{
+   GLenum plane;
+   const GLfloat *equation;
+
+} EVGL_API_Thread_Command_glClipPlanef;
+
+void (*orig_evgl_api_glClipPlanef)(GLenum plane, const GLfloat *equation);
+
+static void
+_evgl_api_thread_glClipPlanef(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanef *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanef *)data;
+
+   orig_evgl_api_glClipPlanef(thread_param->plane,
+                              thread_param->equation);
+
+}
+
+EAPI void
+glClipPlanef_evgl_api_thread_cmd(GLenum plane, const GLfloat *equation)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanef(plane, equation);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanef thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanef *thread_param = &thread_param_local;
+
+   thread_param->plane = plane;
+   thread_param->equation = equation;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+ */
+
+typedef struct
+{
+   GLfloat red;
+   GLfloat green;
+   GLfloat blue;
+   GLfloat alpha;
+
+} EVGL_API_Thread_Command_glColor4f;
+
+void (*orig_evgl_api_glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+
+static void
+_evgl_api_thread_glColor4f(void *data)
+{
+   EVGL_API_Thread_Command_glColor4f *thread_param =
+      (EVGL_API_Thread_Command_glColor4f *)data;
+
+   orig_evgl_api_glColor4f(thread_param->red,
+                           thread_param->green,
+                           thread_param->blue,
+                           thread_param->alpha);
+
+}
+
+EAPI void
+glColor4f_evgl_api_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColor4f(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColor4f thread_param_local;
+   EVGL_API_Thread_Command_glColor4f *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColor4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogf(GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glFogf;
+
+void (*orig_evgl_api_glFogf)(GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glFogf(void *data)
+{
+   EVGL_API_Thread_Command_glFogf *thread_param =
+      (EVGL_API_Thread_Command_glFogf *)data;
+
+   orig_evgl_api_glFogf(thread_param->pname,
+                        thread_param->param);
+
+}
+
+EAPI void
+glFogf_evgl_api_thread_cmd(GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogf(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogf thread_param_local;
+   EVGL_API_Thread_Command_glFogf *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogfv(GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glFogfv;
+
+void (*orig_evgl_api_glFogfv)(GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glFogfv(void *data)
+{
+   EVGL_API_Thread_Command_glFogfv *thread_param =
+      (EVGL_API_Thread_Command_glFogfv *)data;
+
+   orig_evgl_api_glFogfv(thread_param->pname,
+                         thread_param->params);
+
+}
+
+EAPI void
+glFogfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogfv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogfv thread_param_local;
+   EVGL_API_Thread_Command_glFogfv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+ */
+
+typedef struct
+{
+   GLfloat left;
+   GLfloat right;
+   GLfloat bottom;
+   GLfloat top;
+   GLfloat zNear;
+   GLfloat zFar;
+
+} EVGL_API_Thread_Command_glFrustumf;
+
+void (*orig_evgl_api_glFrustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+static void
+_evgl_api_thread_glFrustumf(void *data)
+{
+   EVGL_API_Thread_Command_glFrustumf *thread_param =
+      (EVGL_API_Thread_Command_glFrustumf *)data;
+
+   orig_evgl_api_glFrustumf(thread_param->left,
+                            thread_param->right,
+                            thread_param->bottom,
+                            thread_param->top,
+                            thread_param->zNear,
+                            thread_param->zFar);
+
+}
+
+EAPI void
+glFrustumf_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFrustumf(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFrustumf thread_param_local;
+   EVGL_API_Thread_Command_glFrustumf *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFrustumf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat eqn[4];
+
+} EVGL_API_Thread_Command_glGetClipPlanef;
+
+void (*orig_evgl_api_glGetClipPlanef)(GLenum pname, GLfloat eqn[4]);
+
+static void
+_evgl_api_thread_glGetClipPlanef(void *data)
+{
+   EVGL_API_Thread_Command_glGetClipPlanef *thread_param =
+      (EVGL_API_Thread_Command_glGetClipPlanef *)data;
+
+   orig_evgl_api_glGetClipPlanef(thread_param->pname,
+                                 thread_param->eqn);
+
+}
+
+EAPI void
+glGetClipPlanef_evgl_api_thread_cmd(GLenum pname, GLfloat eqn[4])
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetClipPlanef(pname, eqn);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetClipPlanef thread_param_local;
+   EVGL_API_Thread_Command_glGetClipPlanef *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   memcpy(thread_param->eqn, &eqn, sizeof(eqn));
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetClipPlanef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetLightfv(GLenum light, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_API_Thread_Command_glGetLightfv;
+
+void (*orig_evgl_api_glGetLightfv)(GLenum light, GLenum pname, GLfloat *params);
+
+static void
+_evgl_api_thread_glGetLightfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetLightfv *thread_param =
+      (EVGL_API_Thread_Command_glGetLightfv *)data;
+
+   orig_evgl_api_glGetLightfv(thread_param->light,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glGetLightfv_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetLightfv(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetLightfv thread_param_local;
+   EVGL_API_Thread_Command_glGetLightfv *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetLightfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_API_Thread_Command_glGetMaterialfv;
+
+void (*orig_evgl_api_glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
+
+static void
+_evgl_api_thread_glGetMaterialfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetMaterialfv *thread_param =
+      (EVGL_API_Thread_Command_glGetMaterialfv *)data;
+
+   orig_evgl_api_glGetMaterialfv(thread_param->face,
+                                 thread_param->pname,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetMaterialfv_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetMaterialfv(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetMaterialfv thread_param_local;
+   EVGL_API_Thread_Command_glGetMaterialfv *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetMaterialfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum env;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_API_Thread_Command_glGetTexEnvfv;
+
+void (*orig_evgl_api_glGetTexEnvfv)(GLenum env, GLenum pname, GLfloat *params);
+
+static void
+_evgl_api_thread_glGetTexEnvfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexEnvfv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexEnvfv *)data;
+
+   orig_evgl_api_glGetTexEnvfv(thread_param->env,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetTexEnvfv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexEnvfv(env, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexEnvfv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexEnvfv *thread_param = &thread_param_local;
+
+   thread_param->env = env;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexEnvfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelf(GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glLightModelf;
+
+void (*orig_evgl_api_glLightModelf)(GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glLightModelf(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelf *thread_param =
+      (EVGL_API_Thread_Command_glLightModelf *)data;
+
+   orig_evgl_api_glLightModelf(thread_param->pname,
+                               thread_param->param);
+
+}
+
+EAPI void
+glLightModelf_evgl_api_thread_cmd(GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelf(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelf thread_param_local;
+   EVGL_API_Thread_Command_glLightModelf *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelfv(GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glLightModelfv;
+
+void (*orig_evgl_api_glLightModelfv)(GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glLightModelfv(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelfv *thread_param =
+      (EVGL_API_Thread_Command_glLightModelfv *)data;
+
+   orig_evgl_api_glLightModelfv(thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glLightModelfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelfv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelfv thread_param_local;
+   EVGL_API_Thread_Command_glLightModelfv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightf(GLenum light, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glLightf;
+
+void (*orig_evgl_api_glLightf)(GLenum light, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glLightf(void *data)
+{
+   EVGL_API_Thread_Command_glLightf *thread_param =
+      (EVGL_API_Thread_Command_glLightf *)data;
+
+   orig_evgl_api_glLightf(thread_param->light,
+                          thread_param->pname,
+                          thread_param->param);
+
+}
+
+EAPI void
+glLightf_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightf(light, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightf thread_param_local;
+   EVGL_API_Thread_Command_glLightf *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightfv(GLenum light, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glLightfv;
+
+void (*orig_evgl_api_glLightfv)(GLenum light, GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glLightfv(void *data)
+{
+   EVGL_API_Thread_Command_glLightfv *thread_param =
+      (EVGL_API_Thread_Command_glLightfv *)data;
+
+   orig_evgl_api_glLightfv(thread_param->light,
+                           thread_param->pname,
+                           thread_param->params);
+
+}
+
+EAPI void
+glLightfv_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightfv(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightfv thread_param_local;
+   EVGL_API_Thread_Command_glLightfv *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLoadMatrixf(const GLfloat *m);
+ */
+
+typedef struct
+{
+   const GLfloat *m;
+
+} EVGL_API_Thread_Command_glLoadMatrixf;
+
+void (*orig_evgl_api_glLoadMatrixf)(const GLfloat *m);
+
+static void
+_evgl_api_thread_glLoadMatrixf(void *data)
+{
+   EVGL_API_Thread_Command_glLoadMatrixf *thread_param =
+      (EVGL_API_Thread_Command_glLoadMatrixf *)data;
+
+   orig_evgl_api_glLoadMatrixf(thread_param->m);
+
+}
+
+EAPI void
+glLoadMatrixf_evgl_api_thread_cmd(const GLfloat *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLoadMatrixf(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLoadMatrixf thread_param_local;
+   EVGL_API_Thread_Command_glLoadMatrixf *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLoadMatrixf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialf(GLenum face, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glMaterialf;
+
+void (*orig_evgl_api_glMaterialf)(GLenum face, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glMaterialf(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialf *thread_param =
+      (EVGL_API_Thread_Command_glMaterialf *)data;
+
+   orig_evgl_api_glMaterialf(thread_param->face,
+                             thread_param->pname,
+                             thread_param->param);
+
+}
+
+EAPI void
+glMaterialf_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialf(face, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialf thread_param_local;
+   EVGL_API_Thread_Command_glMaterialf *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glMaterialfv;
+
+void (*orig_evgl_api_glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glMaterialfv(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialfv *thread_param =
+      (EVGL_API_Thread_Command_glMaterialfv *)data;
+
+   orig_evgl_api_glMaterialfv(thread_param->face,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glMaterialfv_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialfv(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialfv thread_param_local;
+   EVGL_API_Thread_Command_glMaterialfv *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultMatrixf(const GLfloat *m);
+ */
+
+typedef struct
+{
+   const GLfloat *m;
+
+} EVGL_API_Thread_Command_glMultMatrixf;
+
+void (*orig_evgl_api_glMultMatrixf)(const GLfloat *m);
+
+static void
+_evgl_api_thread_glMultMatrixf(void *data)
+{
+   EVGL_API_Thread_Command_glMultMatrixf *thread_param =
+      (EVGL_API_Thread_Command_glMultMatrixf *)data;
+
+   orig_evgl_api_glMultMatrixf(thread_param->m);
+
+}
+
+EAPI void
+glMultMatrixf_evgl_api_thread_cmd(const GLfloat *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultMatrixf(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultMatrixf thread_param_local;
+   EVGL_API_Thread_Command_glMultMatrixf *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultMatrixf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLfloat s;
+   GLfloat t;
+   GLfloat r;
+   GLfloat q;
+
+} EVGL_API_Thread_Command_glMultiTexCoord4f;
+
+void (*orig_evgl_api_glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+static void
+_evgl_api_thread_glMultiTexCoord4f(void *data)
+{
+   EVGL_API_Thread_Command_glMultiTexCoord4f *thread_param =
+      (EVGL_API_Thread_Command_glMultiTexCoord4f *)data;
+
+   orig_evgl_api_glMultiTexCoord4f(thread_param->target,
+                                   thread_param->s,
+                                   thread_param->t,
+                                   thread_param->r,
+                                   thread_param->q);
+
+}
+
+EAPI void
+glMultiTexCoord4f_evgl_api_thread_cmd(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiTexCoord4f(target, s, t, r, q);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiTexCoord4f thread_param_local;
+   EVGL_API_Thread_Command_glMultiTexCoord4f *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->s = s;
+   thread_param->t = t;
+   thread_param->r = r;
+   thread_param->q = q;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiTexCoord4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
+ */
+
+typedef struct
+{
+   GLfloat nx;
+   GLfloat ny;
+   GLfloat nz;
+
+} EVGL_API_Thread_Command_glNormal3f;
+
+void (*orig_evgl_api_glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
+
+static void
+_evgl_api_thread_glNormal3f(void *data)
+{
+   EVGL_API_Thread_Command_glNormal3f *thread_param =
+      (EVGL_API_Thread_Command_glNormal3f *)data;
+
+   orig_evgl_api_glNormal3f(thread_param->nx,
+                            thread_param->ny,
+                            thread_param->nz);
+
+}
+
+EAPI void
+glNormal3f_evgl_api_thread_cmd(GLfloat nx, GLfloat ny, GLfloat nz)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glNormal3f(nx, ny, nz);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glNormal3f thread_param_local;
+   EVGL_API_Thread_Command_glNormal3f *thread_param = &thread_param_local;
+
+   thread_param->nx = nx;
+   thread_param->ny = ny;
+   thread_param->nz = nz;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glNormal3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+ */
+
+typedef struct
+{
+   GLfloat left;
+   GLfloat right;
+   GLfloat bottom;
+   GLfloat top;
+   GLfloat zNear;
+   GLfloat zFar;
+
+} EVGL_API_Thread_Command_glOrthof;
+
+void (*orig_evgl_api_glOrthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+static void
+_evgl_api_thread_glOrthof(void *data)
+{
+   EVGL_API_Thread_Command_glOrthof *thread_param =
+      (EVGL_API_Thread_Command_glOrthof *)data;
+
+   orig_evgl_api_glOrthof(thread_param->left,
+                          thread_param->right,
+                          thread_param->bottom,
+                          thread_param->top,
+                          thread_param->zNear,
+                          thread_param->zFar);
+
+}
+
+EAPI void
+glOrthof_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glOrthof(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glOrthof thread_param_local;
+   EVGL_API_Thread_Command_glOrthof *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glOrthof,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterf(GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glPointParameterf;
+
+void (*orig_evgl_api_glPointParameterf)(GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glPointParameterf(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterf *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterf *)data;
+
+   orig_evgl_api_glPointParameterf(thread_param->pname,
+                                   thread_param->param);
+
+}
+
+EAPI void
+glPointParameterf_evgl_api_thread_cmd(GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterf(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterf thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterf *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterfv(GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glPointParameterfv;
+
+void (*orig_evgl_api_glPointParameterfv)(GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glPointParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterfv *)data;
+
+   orig_evgl_api_glPointParameterfv(thread_param->pname,
+                                    thread_param->params);
+
+}
+
+EAPI void
+glPointParameterfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterfv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterfv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointSize(GLfloat size);
+ */
+
+typedef struct
+{
+   GLfloat size;
+
+} EVGL_API_Thread_Command_glPointSize;
+
+void (*orig_evgl_api_glPointSize)(GLfloat size);
+
+static void
+_evgl_api_thread_glPointSize(void *data)
+{
+   EVGL_API_Thread_Command_glPointSize *thread_param =
+      (EVGL_API_Thread_Command_glPointSize *)data;
+
+   orig_evgl_api_glPointSize(thread_param->size);
+
+}
+
+EAPI void
+glPointSize_evgl_api_thread_cmd(GLfloat size)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointSize(size);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointSize thread_param_local;
+   EVGL_API_Thread_Command_glPointSize *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointSize,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid * pointer);
+ */
+
+typedef struct
+{
+   GLenum type;
+   GLsizei stride;
+   const GLvoid * pointer;
+
+} EVGL_API_Thread_Command_glPointSizePointerOES;
+
+void (*orig_evgl_api_glPointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid * pointer);
+
+static void
+_evgl_api_thread_glPointSizePointerOES(void *data)
+{
+   EVGL_API_Thread_Command_glPointSizePointerOES *thread_param =
+      (EVGL_API_Thread_Command_glPointSizePointerOES *)data;
+
+   orig_evgl_api_glPointSizePointerOES(thread_param->type,
+                                       thread_param->stride,
+                                       thread_param->pointer);
+
+}
+
+EAPI void
+glPointSizePointerOES_evgl_api_thread_cmd(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointSizePointerOES(type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointSizePointerOES thread_param_local;
+   EVGL_API_Thread_Command_glPointSizePointerOES *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointSizePointerOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+ */
+
+typedef struct
+{
+   GLfloat angle;
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+
+} EVGL_API_Thread_Command_glRotatef;
+
+void (*orig_evgl_api_glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+
+static void
+_evgl_api_thread_glRotatef(void *data)
+{
+   EVGL_API_Thread_Command_glRotatef *thread_param =
+      (EVGL_API_Thread_Command_glRotatef *)data;
+
+   orig_evgl_api_glRotatef(thread_param->angle,
+                           thread_param->x,
+                           thread_param->y,
+                           thread_param->z);
+
+}
+
+EAPI void
+glRotatef_evgl_api_thread_cmd(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRotatef(angle, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRotatef thread_param_local;
+   EVGL_API_Thread_Command_glRotatef *thread_param = &thread_param_local;
+
+   thread_param->angle = angle;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRotatef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScalef(GLfloat x, GLfloat y, GLfloat z);
+ */
+
+typedef struct
+{
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+
+} EVGL_API_Thread_Command_glScalef;
+
+void (*orig_evgl_api_glScalef)(GLfloat x, GLfloat y, GLfloat z);
+
+static void
+_evgl_api_thread_glScalef(void *data)
+{
+   EVGL_API_Thread_Command_glScalef *thread_param =
+      (EVGL_API_Thread_Command_glScalef *)data;
+
+   orig_evgl_api_glScalef(thread_param->x,
+                          thread_param->y,
+                          thread_param->z);
+
+}
+
+EAPI void
+glScalef_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glScalef(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glScalef thread_param_local;
+   EVGL_API_Thread_Command_glScalef *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glScalef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvf(GLenum target, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glTexEnvf;
+
+void (*orig_evgl_api_glTexEnvf)(GLenum target, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glTexEnvf(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvf *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvf *)data;
+
+   orig_evgl_api_glTexEnvf(thread_param->target,
+                           thread_param->pname,
+                           thread_param->param);
+
+}
+
+EAPI void
+glTexEnvf_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvf(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvf thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvf *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glTexEnvfv;
+
+void (*orig_evgl_api_glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glTexEnvfv(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvfv *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvfv *)data;
+
+   orig_evgl_api_glTexEnvfv(thread_param->target,
+                            thread_param->pname,
+                            thread_param->params);
+
+}
+
+EAPI void
+glTexEnvfv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvfv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvfv thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvfv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTranslatef(GLfloat x, GLfloat y, GLfloat z);
+ */
+
+typedef struct
+{
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+
+} EVGL_API_Thread_Command_glTranslatef;
+
+void (*orig_evgl_api_glTranslatef)(GLfloat x, GLfloat y, GLfloat z);
+
+static void
+_evgl_api_thread_glTranslatef(void *data)
+{
+   EVGL_API_Thread_Command_glTranslatef *thread_param =
+      (EVGL_API_Thread_Command_glTranslatef *)data;
+
+   orig_evgl_api_glTranslatef(thread_param->x,
+                              thread_param->y,
+                              thread_param->z);
+
+}
+
+EAPI void
+glTranslatef_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTranslatef(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTranslatef thread_param_local;
+   EVGL_API_Thread_Command_glTranslatef *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTranslatef,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glAlphaFuncx(GLenum func, GLclampx ref);
+ */
+
+typedef struct
+{
+   GLenum func;
+   GLclampx ref;
+
+} EVGL_API_Thread_Command_glAlphaFuncx;
+
+void (*orig_evgl_api_glAlphaFuncx)(GLenum func, GLclampx ref);
+
+static void
+_evgl_api_thread_glAlphaFuncx(void *data)
+{
+   EVGL_API_Thread_Command_glAlphaFuncx *thread_param =
+      (EVGL_API_Thread_Command_glAlphaFuncx *)data;
+
+   orig_evgl_api_glAlphaFuncx(thread_param->func,
+                              thread_param->ref);
+
+}
+
+EAPI void
+glAlphaFuncx_evgl_api_thread_cmd(GLenum func, GLclampx ref)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glAlphaFuncx(func, ref);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glAlphaFuncx thread_param_local;
+   EVGL_API_Thread_Command_glAlphaFuncx *thread_param = &thread_param_local;
+
+   thread_param->func = func;
+   thread_param->ref = ref;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glAlphaFuncx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+ */
+
+typedef struct
+{
+   GLclampx red;
+   GLclampx green;
+   GLclampx blue;
+   GLclampx alpha;
+
+} EVGL_API_Thread_Command_glClearColorx;
+
+void (*orig_evgl_api_glClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+
+static void
+_evgl_api_thread_glClearColorx(void *data)
+{
+   EVGL_API_Thread_Command_glClearColorx *thread_param =
+      (EVGL_API_Thread_Command_glClearColorx *)data;
+
+   orig_evgl_api_glClearColorx(thread_param->red,
+                               thread_param->green,
+                               thread_param->blue,
+                               thread_param->alpha);
+
+}
+
+EAPI void
+glClearColorx_evgl_api_thread_cmd(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearColorx(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearColorx thread_param_local;
+   EVGL_API_Thread_Command_glClearColorx *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearColorx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearDepthx(GLclampx depth);
+ */
+
+typedef struct
+{
+   GLclampx depth;
+
+} EVGL_API_Thread_Command_glClearDepthx;
+
+void (*orig_evgl_api_glClearDepthx)(GLclampx depth);
+
+static void
+_evgl_api_thread_glClearDepthx(void *data)
+{
+   EVGL_API_Thread_Command_glClearDepthx *thread_param =
+      (EVGL_API_Thread_Command_glClearDepthx *)data;
+
+   orig_evgl_api_glClearDepthx(thread_param->depth);
+
+}
+
+EAPI void
+glClearDepthx_evgl_api_thread_cmd(GLclampx depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearDepthx(depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearDepthx thread_param_local;
+   EVGL_API_Thread_Command_glClearDepthx *thread_param = &thread_param_local;
+
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearDepthx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClientActiveTexture(GLenum texture);
+ */
+
+typedef struct
+{
+   GLenum texture;
+
+} EVGL_API_Thread_Command_glClientActiveTexture;
+
+void (*orig_evgl_api_glClientActiveTexture)(GLenum texture);
+
+static void
+_evgl_api_thread_glClientActiveTexture(void *data)
+{
+   EVGL_API_Thread_Command_glClientActiveTexture *thread_param =
+      (EVGL_API_Thread_Command_glClientActiveTexture *)data;
+
+   orig_evgl_api_glClientActiveTexture(thread_param->texture);
+
+}
+
+EAPI void
+glClientActiveTexture_evgl_api_thread_cmd(GLenum texture)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClientActiveTexture(texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClientActiveTexture thread_param_local;
+   EVGL_API_Thread_Command_glClientActiveTexture *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClientActiveTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanex(GLenum plane, const GLfixed *equation);
+ */
+
+typedef struct
+{
+   GLenum plane;
+   const GLfixed *equation;
+
+} EVGL_API_Thread_Command_glClipPlanex;
+
+void (*orig_evgl_api_glClipPlanex)(GLenum plane, const GLfixed *equation);
+
+static void
+_evgl_api_thread_glClipPlanex(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanex *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanex *)data;
+
+   orig_evgl_api_glClipPlanex(thread_param->plane,
+                              thread_param->equation);
+
+}
+
+EAPI void
+glClipPlanex_evgl_api_thread_cmd(GLenum plane, const GLfixed *equation)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanex(plane, equation);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanex thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanex *thread_param = &thread_param_local;
+
+   thread_param->plane = plane;
+   thread_param->equation = equation;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+ */
+
+typedef struct
+{
+   GLubyte red;
+   GLubyte green;
+   GLubyte blue;
+   GLubyte alpha;
+
+} EVGL_API_Thread_Command_glColor4ub;
+
+void (*orig_evgl_api_glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+
+static void
+_evgl_api_thread_glColor4ub(void *data)
+{
+   EVGL_API_Thread_Command_glColor4ub *thread_param =
+      (EVGL_API_Thread_Command_glColor4ub *)data;
+
+   orig_evgl_api_glColor4ub(thread_param->red,
+                            thread_param->green,
+                            thread_param->blue,
+                            thread_param->alpha);
+
+}
+
+EAPI void
+glColor4ub_evgl_api_thread_cmd(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColor4ub(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColor4ub thread_param_local;
+   EVGL_API_Thread_Command_glColor4ub *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColor4ub,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColor4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+ */
+
+typedef struct
+{
+   GLfixed red;
+   GLfixed green;
+   GLfixed blue;
+   GLfixed alpha;
+
+} EVGL_API_Thread_Command_glColor4x;
+
+void (*orig_evgl_api_glColor4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+
+static void
+_evgl_api_thread_glColor4x(void *data)
+{
+   EVGL_API_Thread_Command_glColor4x *thread_param =
+      (EVGL_API_Thread_Command_glColor4x *)data;
+
+   orig_evgl_api_glColor4x(thread_param->red,
+                           thread_param->green,
+                           thread_param->blue,
+                           thread_param->alpha);
+
+}
+
+EAPI void
+glColor4x_evgl_api_thread_cmd(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColor4x(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColor4x thread_param_local;
+   EVGL_API_Thread_Command_glColor4x *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColor4x,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glColorPointer;
+
+void (*orig_evgl_api_glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glColorPointer(void *data)
+{
+   EVGL_API_Thread_Command_glColorPointer *thread_param =
+      (EVGL_API_Thread_Command_glColorPointer *)data;
+
+   orig_evgl_api_glColorPointer(thread_param->size,
+                                thread_param->type,
+                                thread_param->stride,
+                                thread_param->pointer);
+
+}
+
+EAPI void
+glColorPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColorPointer(size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColorPointer thread_param_local;
+   EVGL_API_Thread_Command_glColorPointer *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColorPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthRangex(GLclampx zNear, GLclampx zFar);
+ */
+
+typedef struct
+{
+   GLclampx zNear;
+   GLclampx zFar;
+
+} EVGL_API_Thread_Command_glDepthRangex;
+
+void (*orig_evgl_api_glDepthRangex)(GLclampx zNear, GLclampx zFar);
+
+static void
+_evgl_api_thread_glDepthRangex(void *data)
+{
+   EVGL_API_Thread_Command_glDepthRangex *thread_param =
+      (EVGL_API_Thread_Command_glDepthRangex *)data;
+
+   orig_evgl_api_glDepthRangex(thread_param->zNear,
+                               thread_param->zFar);
+
+}
+
+EAPI void
+glDepthRangex_evgl_api_thread_cmd(GLclampx zNear, GLclampx zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthRangex(zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthRangex thread_param_local;
+   EVGL_API_Thread_Command_glDepthRangex *thread_param = &thread_param_local;
+
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthRangex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisableClientState(GLenum array);
+ */
+
+typedef struct
+{
+   GLenum array;
+
+} EVGL_API_Thread_Command_glDisableClientState;
+
+void (*orig_evgl_api_glDisableClientState)(GLenum array);
+
+static void
+_evgl_api_thread_glDisableClientState(void *data)
+{
+   EVGL_API_Thread_Command_glDisableClientState *thread_param =
+      (EVGL_API_Thread_Command_glDisableClientState *)data;
+
+   orig_evgl_api_glDisableClientState(thread_param->array);
+
+}
+
+EAPI void
+glDisableClientState_evgl_api_thread_cmd(GLenum array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDisableClientState(array);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDisableClientState thread_param_local;
+   EVGL_API_Thread_Command_glDisableClientState *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDisableClientState,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnableClientState(GLenum array);
+ */
+
+typedef struct
+{
+   GLenum array;
+
+} EVGL_API_Thread_Command_glEnableClientState;
+
+void (*orig_evgl_api_glEnableClientState)(GLenum array);
+
+static void
+_evgl_api_thread_glEnableClientState(void *data)
+{
+   EVGL_API_Thread_Command_glEnableClientState *thread_param =
+      (EVGL_API_Thread_Command_glEnableClientState *)data;
+
+   orig_evgl_api_glEnableClientState(thread_param->array);
+
+}
+
+EAPI void
+glEnableClientState_evgl_api_thread_cmd(GLenum array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEnableClientState(array);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEnableClientState thread_param_local;
+   EVGL_API_Thread_Command_glEnableClientState *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEnableClientState,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogx(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glFogx;
+
+void (*orig_evgl_api_glFogx)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glFogx(void *data)
+{
+   EVGL_API_Thread_Command_glFogx *thread_param =
+      (EVGL_API_Thread_Command_glFogx *)data;
+
+   orig_evgl_api_glFogx(thread_param->pname,
+                        thread_param->param);
+
+}
+
+EAPI void
+glFogx_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogx(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogx thread_param_local;
+   EVGL_API_Thread_Command_glFogx *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogxv(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glFogxv;
+
+void (*orig_evgl_api_glFogxv)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glFogxv(void *data)
+{
+   EVGL_API_Thread_Command_glFogxv *thread_param =
+      (EVGL_API_Thread_Command_glFogxv *)data;
+
+   orig_evgl_api_glFogxv(thread_param->pname,
+                         thread_param->params);
+
+}
+
+EAPI void
+glFogxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogxv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogxv thread_param_local;
+   EVGL_API_Thread_Command_glFogxv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFrustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+ */
+
+typedef struct
+{
+   GLfixed left;
+   GLfixed right;
+   GLfixed bottom;
+   GLfixed top;
+   GLfixed zNear;
+   GLfixed zFar;
+
+} EVGL_API_Thread_Command_glFrustumx;
+
+void (*orig_evgl_api_glFrustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+static void
+_evgl_api_thread_glFrustumx(void *data)
+{
+   EVGL_API_Thread_Command_glFrustumx *thread_param =
+      (EVGL_API_Thread_Command_glFrustumx *)data;
+
+   orig_evgl_api_glFrustumx(thread_param->left,
+                            thread_param->right,
+                            thread_param->bottom,
+                            thread_param->top,
+                            thread_param->zNear,
+                            thread_param->zFar);
+
+}
+
+EAPI void
+glFrustumx_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFrustumx(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFrustumx thread_param_local;
+   EVGL_API_Thread_Command_glFrustumx *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFrustumx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed eqn[4];
+
+} EVGL_API_Thread_Command_glGetClipPlanex;
+
+void (*orig_evgl_api_glGetClipPlanex)(GLenum pname, GLfixed eqn[4]);
+
+static void
+_evgl_api_thread_glGetClipPlanex(void *data)
+{
+   EVGL_API_Thread_Command_glGetClipPlanex *thread_param =
+      (EVGL_API_Thread_Command_glGetClipPlanex *)data;
+
+   orig_evgl_api_glGetClipPlanex(thread_param->pname,
+                                 thread_param->eqn);
+
+}
+
+EAPI void
+glGetClipPlanex_evgl_api_thread_cmd(GLenum pname, GLfixed eqn[4])
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetClipPlanex(pname, eqn);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetClipPlanex thread_param_local;
+   EVGL_API_Thread_Command_glGetClipPlanex *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   memcpy(thread_param->eqn, &eqn, sizeof(eqn));
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetClipPlanex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFixedv(GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetFixedv;
+
+void (*orig_evgl_api_glGetFixedv)(GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetFixedv(void *data)
+{
+   EVGL_API_Thread_Command_glGetFixedv *thread_param =
+      (EVGL_API_Thread_Command_glGetFixedv *)data;
+
+   orig_evgl_api_glGetFixedv(thread_param->pname,
+                             thread_param->params);
+
+}
+
+EAPI void
+glGetFixedv_evgl_api_thread_cmd(GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFixedv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFixedv thread_param_local;
+   EVGL_API_Thread_Command_glGetFixedv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFixedv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetLightxv(GLenum light, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetLightxv;
+
+void (*orig_evgl_api_glGetLightxv)(GLenum light, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetLightxv(void *data)
+{
+   EVGL_API_Thread_Command_glGetLightxv *thread_param =
+      (EVGL_API_Thread_Command_glGetLightxv *)data;
+
+   orig_evgl_api_glGetLightxv(thread_param->light,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glGetLightxv_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetLightxv(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetLightxv thread_param_local;
+   EVGL_API_Thread_Command_glGetLightxv *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetLightxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetMaterialxv(GLenum face, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetMaterialxv;
+
+void (*orig_evgl_api_glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetMaterialxv(void *data)
+{
+   EVGL_API_Thread_Command_glGetMaterialxv *thread_param =
+      (EVGL_API_Thread_Command_glGetMaterialxv *)data;
+
+   orig_evgl_api_glGetMaterialxv(thread_param->face,
+                                 thread_param->pname,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetMaterialxv_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetMaterialxv(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetMaterialxv thread_param_local;
+   EVGL_API_Thread_Command_glGetMaterialxv *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetMaterialxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetPointerv(GLenum pname, GLvoid **params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLvoid **params;
+
+} EVGL_API_Thread_Command_glGetPointerv;
+
+void (*orig_evgl_api_glGetPointerv)(GLenum pname, GLvoid **params);
+
+static void
+_evgl_api_thread_glGetPointerv(void *data)
+{
+   EVGL_API_Thread_Command_glGetPointerv *thread_param =
+      (EVGL_API_Thread_Command_glGetPointerv *)data;
+
+   orig_evgl_api_glGetPointerv(thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetPointerv_evgl_api_thread_cmd(GLenum pname, GLvoid **params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetPointerv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetPointerv thread_param_local;
+   EVGL_API_Thread_Command_glGetPointerv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetPointerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexEnviv(GLenum env, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum env;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetTexEnviv;
+
+void (*orig_evgl_api_glGetTexEnviv)(GLenum env, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetTexEnviv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexEnviv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexEnviv *)data;
+
+   orig_evgl_api_glGetTexEnviv(thread_param->env,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetTexEnviv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexEnviv(env, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexEnviv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexEnviv *thread_param = &thread_param_local;
+
+   thread_param->env = env;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexEnviv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexEnvxv(GLenum env, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum env;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetTexEnvxv;
+
+void (*orig_evgl_api_glGetTexEnvxv)(GLenum env, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetTexEnvxv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexEnvxv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexEnvxv *)data;
+
+   orig_evgl_api_glGetTexEnvxv(thread_param->env,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glGetTexEnvxv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexEnvxv(env, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexEnvxv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexEnvxv *thread_param = &thread_param_local;
+
+   thread_param->env = env;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexEnvxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexParameterxv(GLenum target, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetTexParameterxv;
+
+void (*orig_evgl_api_glGetTexParameterxv)(GLenum target, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetTexParameterxv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexParameterxv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexParameterxv *)data;
+
+   orig_evgl_api_glGetTexParameterxv(thread_param->target,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetTexParameterxv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexParameterxv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexParameterxv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexParameterxv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexParameterxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelx(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glLightModelx;
+
+void (*orig_evgl_api_glLightModelx)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glLightModelx(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelx *thread_param =
+      (EVGL_API_Thread_Command_glLightModelx *)data;
+
+   orig_evgl_api_glLightModelx(thread_param->pname,
+                               thread_param->param);
+
+}
+
+EAPI void
+glLightModelx_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelx(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelx thread_param_local;
+   EVGL_API_Thread_Command_glLightModelx *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelxv(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glLightModelxv;
+
+void (*orig_evgl_api_glLightModelxv)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glLightModelxv(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelxv *thread_param =
+      (EVGL_API_Thread_Command_glLightModelxv *)data;
+
+   orig_evgl_api_glLightModelxv(thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glLightModelxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelxv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelxv thread_param_local;
+   EVGL_API_Thread_Command_glLightModelxv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightx(GLenum light, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glLightx;
+
+void (*orig_evgl_api_glLightx)(GLenum light, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glLightx(void *data)
+{
+   EVGL_API_Thread_Command_glLightx *thread_param =
+      (EVGL_API_Thread_Command_glLightx *)data;
+
+   orig_evgl_api_glLightx(thread_param->light,
+                          thread_param->pname,
+                          thread_param->param);
+
+}
+
+EAPI void
+glLightx_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightx(light, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightx thread_param_local;
+   EVGL_API_Thread_Command_glLightx *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightxv(GLenum light, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glLightxv;
+
+void (*orig_evgl_api_glLightxv)(GLenum light, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glLightxv(void *data)
+{
+   EVGL_API_Thread_Command_glLightxv *thread_param =
+      (EVGL_API_Thread_Command_glLightxv *)data;
+
+   orig_evgl_api_glLightxv(thread_param->light,
+                           thread_param->pname,
+                           thread_param->params);
+
+}
+
+EAPI void
+glLightxv_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightxv(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightxv thread_param_local;
+   EVGL_API_Thread_Command_glLightxv *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLineWidthx(GLfixed width);
+ */
+
+typedef struct
+{
+   GLfixed width;
+
+} EVGL_API_Thread_Command_glLineWidthx;
+
+void (*orig_evgl_api_glLineWidthx)(GLfixed width);
+
+static void
+_evgl_api_thread_glLineWidthx(void *data)
+{
+   EVGL_API_Thread_Command_glLineWidthx *thread_param =
+      (EVGL_API_Thread_Command_glLineWidthx *)data;
+
+   orig_evgl_api_glLineWidthx(thread_param->width);
+
+}
+
+EAPI void
+glLineWidthx_evgl_api_thread_cmd(GLfixed width)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLineWidthx(width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLineWidthx thread_param_local;
+   EVGL_API_Thread_Command_glLineWidthx *thread_param = &thread_param_local;
+
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLineWidthx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLoadIdentity(void);
+ */
+
+void (*orig_evgl_api_glLoadIdentity)(void);
+
+static void
+_evgl_api_thread_glLoadIdentity(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glLoadIdentity();
+
+}
+
+EAPI void
+glLoadIdentity_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLoadIdentity();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLoadIdentity,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glLoadMatrixx(const GLfixed *m);
+ */
+
+typedef struct
+{
+   const GLfixed *m;
+
+} EVGL_API_Thread_Command_glLoadMatrixx;
+
+void (*orig_evgl_api_glLoadMatrixx)(const GLfixed *m);
+
+static void
+_evgl_api_thread_glLoadMatrixx(void *data)
+{
+   EVGL_API_Thread_Command_glLoadMatrixx *thread_param =
+      (EVGL_API_Thread_Command_glLoadMatrixx *)data;
+
+   orig_evgl_api_glLoadMatrixx(thread_param->m);
+
+}
+
+EAPI void
+glLoadMatrixx_evgl_api_thread_cmd(const GLfixed *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLoadMatrixx(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLoadMatrixx thread_param_local;
+   EVGL_API_Thread_Command_glLoadMatrixx *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLoadMatrixx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLogicOp(GLenum opcode);
+ */
+
+typedef struct
+{
+   GLenum opcode;
+
+} EVGL_API_Thread_Command_glLogicOp;
+
+void (*orig_evgl_api_glLogicOp)(GLenum opcode);
+
+static void
+_evgl_api_thread_glLogicOp(void *data)
+{
+   EVGL_API_Thread_Command_glLogicOp *thread_param =
+      (EVGL_API_Thread_Command_glLogicOp *)data;
+
+   orig_evgl_api_glLogicOp(thread_param->opcode);
+
+}
+
+EAPI void
+glLogicOp_evgl_api_thread_cmd(GLenum opcode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLogicOp(opcode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLogicOp thread_param_local;
+   EVGL_API_Thread_Command_glLogicOp *thread_param = &thread_param_local;
+
+   thread_param->opcode = opcode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLogicOp,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialx(GLenum face, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glMaterialx;
+
+void (*orig_evgl_api_glMaterialx)(GLenum face, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glMaterialx(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialx *thread_param =
+      (EVGL_API_Thread_Command_glMaterialx *)data;
+
+   orig_evgl_api_glMaterialx(thread_param->face,
+                             thread_param->pname,
+                             thread_param->param);
+
+}
+
+EAPI void
+glMaterialx_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialx(face, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialx thread_param_local;
+   EVGL_API_Thread_Command_glMaterialx *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialxv(GLenum face, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glMaterialxv;
+
+void (*orig_evgl_api_glMaterialxv)(GLenum face, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glMaterialxv(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialxv *thread_param =
+      (EVGL_API_Thread_Command_glMaterialxv *)data;
+
+   orig_evgl_api_glMaterialxv(thread_param->face,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glMaterialxv_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialxv(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialxv thread_param_local;
+   EVGL_API_Thread_Command_glMaterialxv *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMatrixMode(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+
+} EVGL_API_Thread_Command_glMatrixMode;
+
+void (*orig_evgl_api_glMatrixMode)(GLenum mode);
+
+static void
+_evgl_api_thread_glMatrixMode(void *data)
+{
+   EVGL_API_Thread_Command_glMatrixMode *thread_param =
+      (EVGL_API_Thread_Command_glMatrixMode *)data;
+
+   orig_evgl_api_glMatrixMode(thread_param->mode);
+
+}
+
+EAPI void
+glMatrixMode_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMatrixMode(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMatrixMode thread_param_local;
+   EVGL_API_Thread_Command_glMatrixMode *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMatrixMode,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultMatrixx(const GLfixed *m);
+ */
+
+typedef struct
+{
+   const GLfixed *m;
+
+} EVGL_API_Thread_Command_glMultMatrixx;
+
+void (*orig_evgl_api_glMultMatrixx)(const GLfixed *m);
+
+static void
+_evgl_api_thread_glMultMatrixx(void *data)
+{
+   EVGL_API_Thread_Command_glMultMatrixx *thread_param =
+      (EVGL_API_Thread_Command_glMultMatrixx *)data;
+
+   orig_evgl_api_glMultMatrixx(thread_param->m);
+
+}
+
+EAPI void
+glMultMatrixx_evgl_api_thread_cmd(const GLfixed *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultMatrixx(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultMatrixx thread_param_local;
+   EVGL_API_Thread_Command_glMultMatrixx *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultMatrixx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLfixed s;
+   GLfixed t;
+   GLfixed r;
+   GLfixed q;
+
+} EVGL_API_Thread_Command_glMultiTexCoord4x;
+
+void (*orig_evgl_api_glMultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+
+static void
+_evgl_api_thread_glMultiTexCoord4x(void *data)
+{
+   EVGL_API_Thread_Command_glMultiTexCoord4x *thread_param =
+      (EVGL_API_Thread_Command_glMultiTexCoord4x *)data;
+
+   orig_evgl_api_glMultiTexCoord4x(thread_param->target,
+                                   thread_param->s,
+                                   thread_param->t,
+                                   thread_param->r,
+                                   thread_param->q);
+
+}
+
+EAPI void
+glMultiTexCoord4x_evgl_api_thread_cmd(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiTexCoord4x(target, s, t, r, q);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiTexCoord4x thread_param_local;
+   EVGL_API_Thread_Command_glMultiTexCoord4x *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->s = s;
+   thread_param->t = t;
+   thread_param->r = r;
+   thread_param->q = q;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiTexCoord4x,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
+ */
+
+typedef struct
+{
+   GLfixed nx;
+   GLfixed ny;
+   GLfixed nz;
+
+} EVGL_API_Thread_Command_glNormal3x;
+
+void (*orig_evgl_api_glNormal3x)(GLfixed nx, GLfixed ny, GLfixed nz);
+
+static void
+_evgl_api_thread_glNormal3x(void *data)
+{
+   EVGL_API_Thread_Command_glNormal3x *thread_param =
+      (EVGL_API_Thread_Command_glNormal3x *)data;
+
+   orig_evgl_api_glNormal3x(thread_param->nx,
+                            thread_param->ny,
+                            thread_param->nz);
+
+}
+
+EAPI void
+glNormal3x_evgl_api_thread_cmd(GLfixed nx, GLfixed ny, GLfixed nz)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glNormal3x(nx, ny, nz);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glNormal3x thread_param_local;
+   EVGL_API_Thread_Command_glNormal3x *thread_param = &thread_param_local;
+
+   thread_param->nx = nx;
+   thread_param->ny = ny;
+   thread_param->nz = nz;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glNormal3x,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glNormalPointer;
+
+void (*orig_evgl_api_glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glNormalPointer(void *data)
+{
+   EVGL_API_Thread_Command_glNormalPointer *thread_param =
+      (EVGL_API_Thread_Command_glNormalPointer *)data;
+
+   orig_evgl_api_glNormalPointer(thread_param->type,
+                                 thread_param->stride,
+                                 thread_param->pointer);
+
+}
+
+EAPI void
+glNormalPointer_evgl_api_thread_cmd(GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glNormalPointer(type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glNormalPointer thread_param_local;
+   EVGL_API_Thread_Command_glNormalPointer *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glNormalPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glOrthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+ */
+
+typedef struct
+{
+   GLfixed left;
+   GLfixed right;
+   GLfixed bottom;
+   GLfixed top;
+   GLfixed zNear;
+   GLfixed zFar;
+
+} EVGL_API_Thread_Command_glOrthox;
+
+void (*orig_evgl_api_glOrthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+static void
+_evgl_api_thread_glOrthox(void *data)
+{
+   EVGL_API_Thread_Command_glOrthox *thread_param =
+      (EVGL_API_Thread_Command_glOrthox *)data;
+
+   orig_evgl_api_glOrthox(thread_param->left,
+                          thread_param->right,
+                          thread_param->bottom,
+                          thread_param->top,
+                          thread_param->zNear,
+                          thread_param->zFar);
+
+}
+
+EAPI void
+glOrthox_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glOrthox(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glOrthox thread_param_local;
+   EVGL_API_Thread_Command_glOrthox *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glOrthox,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterx(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glPointParameterx;
+
+void (*orig_evgl_api_glPointParameterx)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glPointParameterx(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterx *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterx *)data;
+
+   orig_evgl_api_glPointParameterx(thread_param->pname,
+                                   thread_param->param);
+
+}
+
+EAPI void
+glPointParameterx_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterx(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterx thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterx *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterxv(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glPointParameterxv;
+
+void (*orig_evgl_api_glPointParameterxv)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glPointParameterxv(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterxv *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterxv *)data;
+
+   orig_evgl_api_glPointParameterxv(thread_param->pname,
+                                    thread_param->params);
+
+}
+
+EAPI void
+glPointParameterxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterxv(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterxv thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterxv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointSizex(GLfixed size);
+ */
+
+typedef struct
+{
+   GLfixed size;
+
+} EVGL_API_Thread_Command_glPointSizex;
+
+void (*orig_evgl_api_glPointSizex)(GLfixed size);
+
+static void
+_evgl_api_thread_glPointSizex(void *data)
+{
+   EVGL_API_Thread_Command_glPointSizex *thread_param =
+      (EVGL_API_Thread_Command_glPointSizex *)data;
+
+   orig_evgl_api_glPointSizex(thread_param->size);
+
+}
+
+EAPI void
+glPointSizex_evgl_api_thread_cmd(GLfixed size)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointSizex(size);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointSizex thread_param_local;
+   EVGL_API_Thread_Command_glPointSizex *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointSizex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPolygonOffsetx(GLfixed factor, GLfixed units);
+ */
+
+typedef struct
+{
+   GLfixed factor;
+   GLfixed units;
+
+} EVGL_API_Thread_Command_glPolygonOffsetx;
+
+void (*orig_evgl_api_glPolygonOffsetx)(GLfixed factor, GLfixed units);
+
+static void
+_evgl_api_thread_glPolygonOffsetx(void *data)
+{
+   EVGL_API_Thread_Command_glPolygonOffsetx *thread_param =
+      (EVGL_API_Thread_Command_glPolygonOffsetx *)data;
+
+   orig_evgl_api_glPolygonOffsetx(thread_param->factor,
+                                  thread_param->units);
+
+}
+
+EAPI void
+glPolygonOffsetx_evgl_api_thread_cmd(GLfixed factor, GLfixed units)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPolygonOffsetx(factor, units);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPolygonOffsetx thread_param_local;
+   EVGL_API_Thread_Command_glPolygonOffsetx *thread_param = &thread_param_local;
+
+   thread_param->factor = factor;
+   thread_param->units = units;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPolygonOffsetx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPopMatrix(void);
+ */
+
+void (*orig_evgl_api_glPopMatrix)(void);
+
+static void
+_evgl_api_thread_glPopMatrix(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glPopMatrix();
+
+}
+
+EAPI void
+glPopMatrix_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPopMatrix();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPopMatrix,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glPushMatrix(void);
+ */
+
+void (*orig_evgl_api_glPushMatrix)(void);
+
+static void
+_evgl_api_thread_glPushMatrix(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glPushMatrix();
+
+}
+
+EAPI void
+glPushMatrix_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPushMatrix();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPushMatrix,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glRotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed angle;
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glRotatex;
+
+void (*orig_evgl_api_glRotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glRotatex(void *data)
+{
+   EVGL_API_Thread_Command_glRotatex *thread_param =
+      (EVGL_API_Thread_Command_glRotatex *)data;
+
+   orig_evgl_api_glRotatex(thread_param->angle,
+                           thread_param->x,
+                           thread_param->y,
+                           thread_param->z);
+
+}
+
+EAPI void
+glRotatex_evgl_api_thread_cmd(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRotatex(angle, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRotatex thread_param_local;
+   EVGL_API_Thread_Command_glRotatex *thread_param = &thread_param_local;
+
+   thread_param->angle = angle;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRotatex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSampleCoveragex(GLclampx value, GLboolean invert);
+ */
+
+typedef struct
+{
+   GLclampx value;
+   GLboolean invert;
+
+} EVGL_API_Thread_Command_glSampleCoveragex;
+
+void (*orig_evgl_api_glSampleCoveragex)(GLclampx value, GLboolean invert);
+
+static void
+_evgl_api_thread_glSampleCoveragex(void *data)
+{
+   EVGL_API_Thread_Command_glSampleCoveragex *thread_param =
+      (EVGL_API_Thread_Command_glSampleCoveragex *)data;
+
+   orig_evgl_api_glSampleCoveragex(thread_param->value,
+                                   thread_param->invert);
+
+}
+
+EAPI void
+glSampleCoveragex_evgl_api_thread_cmd(GLclampx value, GLboolean invert)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSampleCoveragex(value, invert);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSampleCoveragex thread_param_local;
+   EVGL_API_Thread_Command_glSampleCoveragex *thread_param = &thread_param_local;
+
+   thread_param->value = value;
+   thread_param->invert = invert;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSampleCoveragex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScalex(GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glScalex;
+
+void (*orig_evgl_api_glScalex)(GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glScalex(void *data)
+{
+   EVGL_API_Thread_Command_glScalex *thread_param =
+      (EVGL_API_Thread_Command_glScalex *)data;
+
+   orig_evgl_api_glScalex(thread_param->x,
+                          thread_param->y,
+                          thread_param->z);
+
+}
+
+EAPI void
+glScalex_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glScalex(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glScalex thread_param_local;
+   EVGL_API_Thread_Command_glScalex *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glScalex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glShadeModel(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+
+} EVGL_API_Thread_Command_glShadeModel;
+
+void (*orig_evgl_api_glShadeModel)(GLenum mode);
+
+static void
+_evgl_api_thread_glShadeModel(void *data)
+{
+   EVGL_API_Thread_Command_glShadeModel *thread_param =
+      (EVGL_API_Thread_Command_glShadeModel *)data;
+
+   orig_evgl_api_glShadeModel(thread_param->mode);
+
+}
+
+EAPI void
+glShadeModel_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glShadeModel(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glShadeModel thread_param_local;
+   EVGL_API_Thread_Command_glShadeModel *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glShadeModel,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glTexCoordPointer;
+
+void (*orig_evgl_api_glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glTexCoordPointer(void *data)
+{
+   EVGL_API_Thread_Command_glTexCoordPointer *thread_param =
+      (EVGL_API_Thread_Command_glTexCoordPointer *)data;
+
+   orig_evgl_api_glTexCoordPointer(thread_param->size,
+                                   thread_param->type,
+                                   thread_param->stride,
+                                   thread_param->pointer);
+
+}
+
+EAPI void
+glTexCoordPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexCoordPointer(size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexCoordPointer thread_param_local;
+   EVGL_API_Thread_Command_glTexCoordPointer *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexCoordPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvi(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+
+} EVGL_API_Thread_Command_glTexEnvi;
+
+void (*orig_evgl_api_glTexEnvi)(GLenum target, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glTexEnvi(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvi *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvi *)data;
+
+   orig_evgl_api_glTexEnvi(thread_param->target,
+                           thread_param->pname,
+                           thread_param->param);
+
+}
+
+EAPI void
+glTexEnvi_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvi(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvi thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvi *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvi,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvx(GLenum target, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glTexEnvx;
+
+void (*orig_evgl_api_glTexEnvx)(GLenum target, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glTexEnvx(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvx *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvx *)data;
+
+   orig_evgl_api_glTexEnvx(thread_param->target,
+                           thread_param->pname,
+                           thread_param->param);
+
+}
+
+EAPI void
+glTexEnvx_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvx(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvx thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvx *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnviv(GLenum target, GLenum pname, const GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLint *params;
+
+} EVGL_API_Thread_Command_glTexEnviv;
+
+void (*orig_evgl_api_glTexEnviv)(GLenum target, GLenum pname, const GLint *params);
+
+static void
+_evgl_api_thread_glTexEnviv(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnviv *thread_param =
+      (EVGL_API_Thread_Command_glTexEnviv *)data;
+
+   orig_evgl_api_glTexEnviv(thread_param->target,
+                            thread_param->pname,
+                            thread_param->params);
+
+}
+
+EAPI void
+glTexEnviv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnviv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnviv thread_param_local;
+   EVGL_API_Thread_Command_glTexEnviv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnviv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvxv(GLenum target, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glTexEnvxv;
+
+void (*orig_evgl_api_glTexEnvxv)(GLenum target, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glTexEnvxv(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvxv *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvxv *)data;
+
+   orig_evgl_api_glTexEnvxv(thread_param->target,
+                            thread_param->pname,
+                            thread_param->params);
+
+}
+
+EAPI void
+glTexEnvxv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvxv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvxv thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvxv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterx(GLenum target, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glTexParameterx;
+
+void (*orig_evgl_api_glTexParameterx)(GLenum target, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glTexParameterx(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterx *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterx *)data;
+
+   orig_evgl_api_glTexParameterx(thread_param->target,
+                                 thread_param->pname,
+                                 thread_param->param);
+
+}
+
+EAPI void
+glTexParameterx_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterx(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterx thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterx *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterx,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterxv(GLenum target, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glTexParameterxv;
+
+void (*orig_evgl_api_glTexParameterxv)(GLenum target, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glTexParameterxv(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterxv *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterxv *)data;
+
+   orig_evgl_api_glTexParameterxv(thread_param->target,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+}
+
+EAPI void
+glTexParameterxv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterxv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterxv thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterxv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterxv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTranslatex(GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glTranslatex;
+
+void (*orig_evgl_api_glTranslatex)(GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glTranslatex(void *data)
+{
+   EVGL_API_Thread_Command_glTranslatex *thread_param =
+      (EVGL_API_Thread_Command_glTranslatex *)data;
+
+   orig_evgl_api_glTranslatex(thread_param->x,
+                              thread_param->y,
+                              thread_param->z);
+
+}
+
+EAPI void
+glTranslatex_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTranslatex(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTranslatex thread_param_local;
+   EVGL_API_Thread_Command_glTranslatex *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTranslatex,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glVertexPointer;
+
+void (*orig_evgl_api_glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glVertexPointer(void *data)
+{
+   EVGL_API_Thread_Command_glVertexPointer *thread_param =
+      (EVGL_API_Thread_Command_glVertexPointer *)data;
+
+   orig_evgl_api_glVertexPointer(thread_param->size,
+                                 thread_param->type,
+                                 thread_param->stride,
+                                 thread_param->pointer);
+
+}
+
+EAPI void
+glVertexPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexPointer(size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexPointer thread_param_local;
+   EVGL_API_Thread_Command_glVertexPointer *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha);
+ */
+
+typedef struct
+{
+   GLenum modeRGB;
+   GLenum modeAlpha;
+
+} EVGL_API_Thread_Command_glBlendEquationSeparateOES;
+
+void (*orig_evgl_api_glBlendEquationSeparateOES)(GLenum modeRGB, GLenum modeAlpha);
+
+static void
+_evgl_api_thread_glBlendEquationSeparateOES(void *data)
+{
+   EVGL_API_Thread_Command_glBlendEquationSeparateOES *thread_param =
+      (EVGL_API_Thread_Command_glBlendEquationSeparateOES *)data;
+
+   orig_evgl_api_glBlendEquationSeparateOES(thread_param->modeRGB,
+                                            thread_param->modeAlpha);
+
+}
+
+EAPI void
+glBlendEquationSeparateOES_evgl_api_thread_cmd(GLenum modeRGB, GLenum modeAlpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendEquationSeparateOES(modeRGB, modeAlpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendEquationSeparateOES thread_param_local;
+   EVGL_API_Thread_Command_glBlendEquationSeparateOES *thread_param = &thread_param_local;
+
+   thread_param->modeRGB = modeRGB;
+   thread_param->modeAlpha = modeAlpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendEquationSeparateOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+ */
+
+typedef struct
+{
+   GLenum srcRGB;
+   GLenum dstRGB;
+   GLenum srcAlpha;
+   GLenum dstAlpha;
+
+} EVGL_API_Thread_Command_glBlendFuncSeparateOES;
+
+void (*orig_evgl_api_glBlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+
+static void
+_evgl_api_thread_glBlendFuncSeparateOES(void *data)
+{
+   EVGL_API_Thread_Command_glBlendFuncSeparateOES *thread_param =
+      (EVGL_API_Thread_Command_glBlendFuncSeparateOES *)data;
+
+   orig_evgl_api_glBlendFuncSeparateOES(thread_param->srcRGB,
+                                        thread_param->dstRGB,
+                                        thread_param->srcAlpha,
+                                        thread_param->dstAlpha);
+
+}
+
+EAPI void
+glBlendFuncSeparateOES_evgl_api_thread_cmd(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendFuncSeparateOES thread_param_local;
+   EVGL_API_Thread_Command_glBlendFuncSeparateOES *thread_param = &thread_param_local;
+
+   thread_param->srcRGB = srcRGB;
+   thread_param->dstRGB = dstRGB;
+   thread_param->srcAlpha = srcAlpha;
+   thread_param->dstAlpha = dstAlpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendFuncSeparateOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendEquationOES(GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum mode;
+
+} EVGL_API_Thread_Command_glBlendEquationOES;
+
+void (*orig_evgl_api_glBlendEquationOES)(GLenum mode);
+
+static void
+_evgl_api_thread_glBlendEquationOES(void *data)
+{
+   EVGL_API_Thread_Command_glBlendEquationOES *thread_param =
+      (EVGL_API_Thread_Command_glBlendEquationOES *)data;
+
+   orig_evgl_api_glBlendEquationOES(thread_param->mode);
+
+}
+
+EAPI void
+glBlendEquationOES_evgl_api_thread_cmd(GLenum mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlendEquationOES(mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlendEquationOES thread_param_local;
+   EVGL_API_Thread_Command_glBlendEquationOES *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlendEquationOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+ */
+
+typedef struct
+{
+   GLshort x;
+   GLshort y;
+   GLshort z;
+   GLshort width;
+   GLshort height;
+
+} EVGL_API_Thread_Command_glDrawTexsOES;
+
+void (*orig_evgl_api_glDrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+
+static void
+_evgl_api_thread_glDrawTexsOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexsOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexsOES *)data;
+
+   orig_evgl_api_glDrawTexsOES(thread_param->x,
+                               thread_param->y,
+                               thread_param->z,
+                               thread_param->width,
+                               thread_param->height);
+
+}
+
+EAPI void
+glDrawTexsOES_evgl_api_thread_cmd(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexsOES(x, y, z, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexsOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexsOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexsOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLint z;
+   GLint width;
+   GLint height;
+
+} EVGL_API_Thread_Command_glDrawTexiOES;
+
+void (*orig_evgl_api_glDrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height);
+
+static void
+_evgl_api_thread_glDrawTexiOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexiOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexiOES *)data;
+
+   orig_evgl_api_glDrawTexiOES(thread_param->x,
+                               thread_param->y,
+                               thread_param->z,
+                               thread_param->width,
+                               thread_param->height);
+
+}
+
+EAPI void
+glDrawTexiOES_evgl_api_thread_cmd(GLint x, GLint y, GLint z, GLint width, GLint height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexiOES(x, y, z, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexiOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexiOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexiOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+ */
+
+typedef struct
+{
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+   GLfixed width;
+   GLfixed height;
+
+} EVGL_API_Thread_Command_glDrawTexxOES;
+
+void (*orig_evgl_api_glDrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+
+static void
+_evgl_api_thread_glDrawTexxOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexxOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexxOES *)data;
+
+   orig_evgl_api_glDrawTexxOES(thread_param->x,
+                               thread_param->y,
+                               thread_param->z,
+                               thread_param->width,
+                               thread_param->height);
+
+}
+
+EAPI void
+glDrawTexxOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexxOES(x, y, z, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexxOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexxOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexsvOES(const GLshort *coords);
+ */
+
+typedef struct
+{
+   const GLshort *coords;
+
+} EVGL_API_Thread_Command_glDrawTexsvOES;
+
+void (*orig_evgl_api_glDrawTexsvOES)(const GLshort *coords);
+
+static void
+_evgl_api_thread_glDrawTexsvOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexsvOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexsvOES *)data;
+
+   orig_evgl_api_glDrawTexsvOES(thread_param->coords);
+
+}
+
+EAPI void
+glDrawTexsvOES_evgl_api_thread_cmd(const GLshort *coords)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexsvOES(coords);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexsvOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexsvOES *thread_param = &thread_param_local;
+
+   thread_param->coords = coords;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexsvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexivOES(const GLint *coords);
+ */
+
+typedef struct
+{
+   const GLint *coords;
+
+} EVGL_API_Thread_Command_glDrawTexivOES;
+
+void (*orig_evgl_api_glDrawTexivOES)(const GLint *coords);
+
+static void
+_evgl_api_thread_glDrawTexivOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexivOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexivOES *)data;
+
+   orig_evgl_api_glDrawTexivOES(thread_param->coords);
+
+}
+
+EAPI void
+glDrawTexivOES_evgl_api_thread_cmd(const GLint *coords)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexivOES(coords);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexivOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexivOES *thread_param = &thread_param_local;
+
+   thread_param->coords = coords;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexivOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexxvOES(const GLfixed *coords);
+ */
+
+typedef struct
+{
+   const GLfixed *coords;
+
+} EVGL_API_Thread_Command_glDrawTexxvOES;
+
+void (*orig_evgl_api_glDrawTexxvOES)(const GLfixed *coords);
+
+static void
+_evgl_api_thread_glDrawTexxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexxvOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexxvOES *)data;
+
+   orig_evgl_api_glDrawTexxvOES(thread_param->coords);
+
+}
+
+EAPI void
+glDrawTexxvOES_evgl_api_thread_cmd(const GLfixed *coords)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexxvOES(coords);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexxvOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexxvOES *thread_param = &thread_param_local;
+
+   thread_param->coords = coords;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+ */
+
+typedef struct
+{
+   GLfloat x;
+   GLfloat y;
+   GLfloat z;
+   GLfloat width;
+   GLfloat height;
+
+} EVGL_API_Thread_Command_glDrawTexfOES;
+
+void (*orig_evgl_api_glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+
+static void
+_evgl_api_thread_glDrawTexfOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexfOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexfOES *)data;
+
+   orig_evgl_api_glDrawTexfOES(thread_param->x,
+                               thread_param->y,
+                               thread_param->z,
+                               thread_param->width,
+                               thread_param->height);
+
+}
+
+EAPI void
+glDrawTexfOES_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexfOES(x, y, z, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexfOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexfOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexfOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawTexfvOES(const GLfloat *coords);
+ */
+
+typedef struct
+{
+   const GLfloat *coords;
+
+} EVGL_API_Thread_Command_glDrawTexfvOES;
+
+void (*orig_evgl_api_glDrawTexfvOES)(const GLfloat *coords);
+
+static void
+_evgl_api_thread_glDrawTexfvOES(void *data)
+{
+   EVGL_API_Thread_Command_glDrawTexfvOES *thread_param =
+      (EVGL_API_Thread_Command_glDrawTexfvOES *)data;
+
+   orig_evgl_api_glDrawTexfvOES(thread_param->coords);
+
+}
+
+EAPI void
+glDrawTexfvOES_evgl_api_thread_cmd(const GLfloat *coords)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawTexfvOES(coords);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawTexfvOES thread_param_local;
+   EVGL_API_Thread_Command_glDrawTexfvOES *thread_param = &thread_param_local;
+
+   thread_param->coords = coords;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawTexfvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glAlphaFuncxOES(GLenum func, GLclampx ref);
+ */
+
+typedef struct
+{
+   GLenum func;
+   GLclampx ref;
+
+} EVGL_API_Thread_Command_glAlphaFuncxOES;
+
+void (*orig_evgl_api_glAlphaFuncxOES)(GLenum func, GLclampx ref);
+
+static void
+_evgl_api_thread_glAlphaFuncxOES(void *data)
+{
+   EVGL_API_Thread_Command_glAlphaFuncxOES *thread_param =
+      (EVGL_API_Thread_Command_glAlphaFuncxOES *)data;
+
+   orig_evgl_api_glAlphaFuncxOES(thread_param->func,
+                                 thread_param->ref);
+
+}
+
+EAPI void
+glAlphaFuncxOES_evgl_api_thread_cmd(GLenum func, GLclampx ref)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glAlphaFuncxOES(func, ref);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glAlphaFuncxOES thread_param_local;
+   EVGL_API_Thread_Command_glAlphaFuncxOES *thread_param = &thread_param_local;
+
+   thread_param->func = func;
+   thread_param->ref = ref;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glAlphaFuncxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+ */
+
+typedef struct
+{
+   GLclampx red;
+   GLclampx green;
+   GLclampx blue;
+   GLclampx alpha;
+
+} EVGL_API_Thread_Command_glClearColorxOES;
+
+void (*orig_evgl_api_glClearColorxOES)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+
+static void
+_evgl_api_thread_glClearColorxOES(void *data)
+{
+   EVGL_API_Thread_Command_glClearColorxOES *thread_param =
+      (EVGL_API_Thread_Command_glClearColorxOES *)data;
+
+   orig_evgl_api_glClearColorxOES(thread_param->red,
+                                  thread_param->green,
+                                  thread_param->blue,
+                                  thread_param->alpha);
+
+}
+
+EAPI void
+glClearColorxOES_evgl_api_thread_cmd(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearColorxOES(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearColorxOES thread_param_local;
+   EVGL_API_Thread_Command_glClearColorxOES *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearColorxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearDepthxOES(GLclampx depth);
+ */
+
+typedef struct
+{
+   GLclampx depth;
+
+} EVGL_API_Thread_Command_glClearDepthxOES;
+
+void (*orig_evgl_api_glClearDepthxOES)(GLclampx depth);
+
+static void
+_evgl_api_thread_glClearDepthxOES(void *data)
+{
+   EVGL_API_Thread_Command_glClearDepthxOES *thread_param =
+      (EVGL_API_Thread_Command_glClearDepthxOES *)data;
+
+   orig_evgl_api_glClearDepthxOES(thread_param->depth);
+
+}
+
+EAPI void
+glClearDepthxOES_evgl_api_thread_cmd(GLclampx depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearDepthxOES(depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearDepthxOES thread_param_local;
+   EVGL_API_Thread_Command_glClearDepthxOES *thread_param = &thread_param_local;
+
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearDepthxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanexOES(GLenum plane, const GLfixed *equation);
+ */
+
+typedef struct
+{
+   GLenum plane;
+   const GLfixed *equation;
+
+} EVGL_API_Thread_Command_glClipPlanexOES;
+
+void (*orig_evgl_api_glClipPlanexOES)(GLenum plane, const GLfixed *equation);
+
+static void
+_evgl_api_thread_glClipPlanexOES(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanexOES *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanexOES *)data;
+
+   orig_evgl_api_glClipPlanexOES(thread_param->plane,
+                                 thread_param->equation);
+
+}
+
+EAPI void
+glClipPlanexOES_evgl_api_thread_cmd(GLenum plane, const GLfixed *equation)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanexOES(plane, equation);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanexOES thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanexOES *thread_param = &thread_param_local;
+
+   thread_param->plane = plane;
+   thread_param->equation = equation;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+ */
+
+typedef struct
+{
+   GLfixed red;
+   GLfixed green;
+   GLfixed blue;
+   GLfixed alpha;
+
+} EVGL_API_Thread_Command_glColor4xOES;
+
+void (*orig_evgl_api_glColor4xOES)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+
+static void
+_evgl_api_thread_glColor4xOES(void *data)
+{
+   EVGL_API_Thread_Command_glColor4xOES *thread_param =
+      (EVGL_API_Thread_Command_glColor4xOES *)data;
+
+   orig_evgl_api_glColor4xOES(thread_param->red,
+                              thread_param->green,
+                              thread_param->blue,
+                              thread_param->alpha);
+
+}
+
+EAPI void
+glColor4xOES_evgl_api_thread_cmd(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glColor4xOES(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glColor4xOES thread_param_local;
+   EVGL_API_Thread_Command_glColor4xOES *thread_param = &thread_param_local;
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glColor4xOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthRangexOES(GLclampx zNear, GLclampx zFar);
+ */
+
+typedef struct
+{
+   GLclampx zNear;
+   GLclampx zFar;
+
+} EVGL_API_Thread_Command_glDepthRangexOES;
+
+void (*orig_evgl_api_glDepthRangexOES)(GLclampx zNear, GLclampx zFar);
+
+static void
+_evgl_api_thread_glDepthRangexOES(void *data)
+{
+   EVGL_API_Thread_Command_glDepthRangexOES *thread_param =
+      (EVGL_API_Thread_Command_glDepthRangexOES *)data;
+
+   orig_evgl_api_glDepthRangexOES(thread_param->zNear,
+                                  thread_param->zFar);
+
+}
+
+EAPI void
+glDepthRangexOES_evgl_api_thread_cmd(GLclampx zNear, GLclampx zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthRangexOES(zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthRangexOES thread_param_local;
+   EVGL_API_Thread_Command_glDepthRangexOES *thread_param = &thread_param_local;
+
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthRangexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogxOES(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glFogxOES;
+
+void (*orig_evgl_api_glFogxOES)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glFogxOES(void *data)
+{
+   EVGL_API_Thread_Command_glFogxOES *thread_param =
+      (EVGL_API_Thread_Command_glFogxOES *)data;
+
+   orig_evgl_api_glFogxOES(thread_param->pname,
+                           thread_param->param);
+
+}
+
+EAPI void
+glFogxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogxOES(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogxOES thread_param_local;
+   EVGL_API_Thread_Command_glFogxOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFogxvOES(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glFogxvOES;
+
+void (*orig_evgl_api_glFogxvOES)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glFogxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glFogxvOES *thread_param =
+      (EVGL_API_Thread_Command_glFogxvOES *)data;
+
+   orig_evgl_api_glFogxvOES(thread_param->pname,
+                            thread_param->params);
+
+}
+
+EAPI void
+glFogxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFogxvOES(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFogxvOES thread_param_local;
+   EVGL_API_Thread_Command_glFogxvOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFogxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+ */
+
+typedef struct
+{
+   GLfixed left;
+   GLfixed right;
+   GLfixed bottom;
+   GLfixed top;
+   GLfixed zNear;
+   GLfixed zFar;
+
+} EVGL_API_Thread_Command_glFrustumxOES;
+
+void (*orig_evgl_api_glFrustumxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+static void
+_evgl_api_thread_glFrustumxOES(void *data)
+{
+   EVGL_API_Thread_Command_glFrustumxOES *thread_param =
+      (EVGL_API_Thread_Command_glFrustumxOES *)data;
+
+   orig_evgl_api_glFrustumxOES(thread_param->left,
+                               thread_param->right,
+                               thread_param->bottom,
+                               thread_param->top,
+                               thread_param->zNear,
+                               thread_param->zFar);
+
+}
+
+EAPI void
+glFrustumxOES_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFrustumxOES(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFrustumxOES thread_param_local;
+   EVGL_API_Thread_Command_glFrustumxOES *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFrustumxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed eqn[4];
+
+} EVGL_API_Thread_Command_glGetClipPlanexOES;
+
+void (*orig_evgl_api_glGetClipPlanexOES)(GLenum pname, GLfixed eqn[4]);
+
+static void
+_evgl_api_thread_glGetClipPlanexOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetClipPlanexOES *thread_param =
+      (EVGL_API_Thread_Command_glGetClipPlanexOES *)data;
+
+   orig_evgl_api_glGetClipPlanexOES(thread_param->pname,
+                                    thread_param->eqn);
+
+}
+
+EAPI void
+glGetClipPlanexOES_evgl_api_thread_cmd(GLenum pname, GLfixed eqn[4])
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetClipPlanexOES(pname, eqn);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetClipPlanexOES thread_param_local;
+   EVGL_API_Thread_Command_glGetClipPlanexOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   memcpy(thread_param->eqn, &eqn, sizeof(eqn));
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetClipPlanexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFixedvOES(GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetFixedvOES;
+
+void (*orig_evgl_api_glGetFixedvOES)(GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetFixedvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetFixedvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetFixedvOES *)data;
+
+   orig_evgl_api_glGetFixedvOES(thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetFixedvOES_evgl_api_thread_cmd(GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFixedvOES(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFixedvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetFixedvOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFixedvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetLightxvOES;
+
+void (*orig_evgl_api_glGetLightxvOES)(GLenum light, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetLightxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetLightxvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetLightxvOES *)data;
+
+   orig_evgl_api_glGetLightxvOES(thread_param->light,
+                                 thread_param->pname,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetLightxvOES_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetLightxvOES(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetLightxvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetLightxvOES *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetLightxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetMaterialxvOES;
+
+void (*orig_evgl_api_glGetMaterialxvOES)(GLenum face, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetMaterialxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetMaterialxvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetMaterialxvOES *)data;
+
+   orig_evgl_api_glGetMaterialxvOES(thread_param->face,
+                                    thread_param->pname,
+                                    thread_param->params);
+
+}
+
+EAPI void
+glGetMaterialxvOES_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetMaterialxvOES(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetMaterialxvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetMaterialxvOES *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetMaterialxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum env;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetTexEnvxvOES;
+
+void (*orig_evgl_api_glGetTexEnvxvOES)(GLenum env, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetTexEnvxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexEnvxvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetTexEnvxvOES *)data;
+
+   orig_evgl_api_glGetTexEnvxvOES(thread_param->env,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+}
+
+EAPI void
+glGetTexEnvxvOES_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexEnvxvOES(env, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexEnvxvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetTexEnvxvOES *thread_param = &thread_param_local;
+
+   thread_param->env = env;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexEnvxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetTexParameterxvOES;
+
+void (*orig_evgl_api_glGetTexParameterxvOES)(GLenum target, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetTexParameterxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexParameterxvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetTexParameterxvOES *)data;
+
+   orig_evgl_api_glGetTexParameterxvOES(thread_param->target,
+                                        thread_param->pname,
+                                        thread_param->params);
+
+}
+
+EAPI void
+glGetTexParameterxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexParameterxvOES(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexParameterxvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetTexParameterxvOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexParameterxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelxOES(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glLightModelxOES;
+
+void (*orig_evgl_api_glLightModelxOES)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glLightModelxOES(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelxOES *thread_param =
+      (EVGL_API_Thread_Command_glLightModelxOES *)data;
+
+   orig_evgl_api_glLightModelxOES(thread_param->pname,
+                                  thread_param->param);
+
+}
+
+EAPI void
+glLightModelxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelxOES(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelxOES thread_param_local;
+   EVGL_API_Thread_Command_glLightModelxOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightModelxvOES(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glLightModelxvOES;
+
+void (*orig_evgl_api_glLightModelxvOES)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glLightModelxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glLightModelxvOES *thread_param =
+      (EVGL_API_Thread_Command_glLightModelxvOES *)data;
+
+   orig_evgl_api_glLightModelxvOES(thread_param->pname,
+                                   thread_param->params);
+
+}
+
+EAPI void
+glLightModelxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightModelxvOES(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightModelxvOES thread_param_local;
+   EVGL_API_Thread_Command_glLightModelxvOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightModelxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightxOES(GLenum light, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glLightxOES;
+
+void (*orig_evgl_api_glLightxOES)(GLenum light, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glLightxOES(void *data)
+{
+   EVGL_API_Thread_Command_glLightxOES *thread_param =
+      (EVGL_API_Thread_Command_glLightxOES *)data;
+
+   orig_evgl_api_glLightxOES(thread_param->light,
+                             thread_param->pname,
+                             thread_param->param);
+
+}
+
+EAPI void
+glLightxOES_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightxOES(light, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightxOES thread_param_local;
+   EVGL_API_Thread_Command_glLightxOES *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLightxvOES(GLenum light, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum light;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glLightxvOES;
+
+void (*orig_evgl_api_glLightxvOES)(GLenum light, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glLightxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glLightxvOES *thread_param =
+      (EVGL_API_Thread_Command_glLightxvOES *)data;
+
+   orig_evgl_api_glLightxvOES(thread_param->light,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glLightxvOES_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLightxvOES(light, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLightxvOES thread_param_local;
+   EVGL_API_Thread_Command_glLightxvOES *thread_param = &thread_param_local;
+
+   thread_param->light = light;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLightxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLineWidthxOES(GLfixed width);
+ */
+
+typedef struct
+{
+   GLfixed width;
+
+} EVGL_API_Thread_Command_glLineWidthxOES;
+
+void (*orig_evgl_api_glLineWidthxOES)(GLfixed width);
+
+static void
+_evgl_api_thread_glLineWidthxOES(void *data)
+{
+   EVGL_API_Thread_Command_glLineWidthxOES *thread_param =
+      (EVGL_API_Thread_Command_glLineWidthxOES *)data;
+
+   orig_evgl_api_glLineWidthxOES(thread_param->width);
+
+}
+
+EAPI void
+glLineWidthxOES_evgl_api_thread_cmd(GLfixed width)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLineWidthxOES(width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLineWidthxOES thread_param_local;
+   EVGL_API_Thread_Command_glLineWidthxOES *thread_param = &thread_param_local;
+
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLineWidthxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLoadMatrixxOES(const GLfixed *m);
+ */
+
+typedef struct
+{
+   const GLfixed *m;
+
+} EVGL_API_Thread_Command_glLoadMatrixxOES;
+
+void (*orig_evgl_api_glLoadMatrixxOES)(const GLfixed *m);
+
+static void
+_evgl_api_thread_glLoadMatrixxOES(void *data)
+{
+   EVGL_API_Thread_Command_glLoadMatrixxOES *thread_param =
+      (EVGL_API_Thread_Command_glLoadMatrixxOES *)data;
+
+   orig_evgl_api_glLoadMatrixxOES(thread_param->m);
+
+}
+
+EAPI void
+glLoadMatrixxOES_evgl_api_thread_cmd(const GLfixed *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLoadMatrixxOES(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glLoadMatrixxOES thread_param_local;
+   EVGL_API_Thread_Command_glLoadMatrixxOES *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLoadMatrixxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialxOES(GLenum face, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glMaterialxOES;
+
+void (*orig_evgl_api_glMaterialxOES)(GLenum face, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glMaterialxOES(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialxOES *thread_param =
+      (EVGL_API_Thread_Command_glMaterialxOES *)data;
+
+   orig_evgl_api_glMaterialxOES(thread_param->face,
+                                thread_param->pname,
+                                thread_param->param);
+
+}
+
+EAPI void
+glMaterialxOES_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialxOES(face, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialxOES thread_param_local;
+   EVGL_API_Thread_Command_glMaterialxOES *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMaterialxvOES(GLenum face, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum face;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glMaterialxvOES;
+
+void (*orig_evgl_api_glMaterialxvOES)(GLenum face, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glMaterialxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glMaterialxvOES *thread_param =
+      (EVGL_API_Thread_Command_glMaterialxvOES *)data;
+
+   orig_evgl_api_glMaterialxvOES(thread_param->face,
+                                 thread_param->pname,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glMaterialxvOES_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMaterialxvOES(face, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMaterialxvOES thread_param_local;
+   EVGL_API_Thread_Command_glMaterialxvOES *thread_param = &thread_param_local;
+
+   thread_param->face = face;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMaterialxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultMatrixxOES(const GLfixed *m);
+ */
+
+typedef struct
+{
+   const GLfixed *m;
+
+} EVGL_API_Thread_Command_glMultMatrixxOES;
+
+void (*orig_evgl_api_glMultMatrixxOES)(const GLfixed *m);
+
+static void
+_evgl_api_thread_glMultMatrixxOES(void *data)
+{
+   EVGL_API_Thread_Command_glMultMatrixxOES *thread_param =
+      (EVGL_API_Thread_Command_glMultMatrixxOES *)data;
+
+   orig_evgl_api_glMultMatrixxOES(thread_param->m);
+
+}
+
+EAPI void
+glMultMatrixxOES_evgl_api_thread_cmd(const GLfixed *m)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultMatrixxOES(m);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultMatrixxOES thread_param_local;
+   EVGL_API_Thread_Command_glMultMatrixxOES *thread_param = &thread_param_local;
+
+   thread_param->m = m;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultMatrixxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMultiTexCoord4xOES(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLfixed s;
+   GLfixed t;
+   GLfixed r;
+   GLfixed q;
+
+} EVGL_API_Thread_Command_glMultiTexCoord4xOES;
+
+void (*orig_evgl_api_glMultiTexCoord4xOES)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+
+static void
+_evgl_api_thread_glMultiTexCoord4xOES(void *data)
+{
+   EVGL_API_Thread_Command_glMultiTexCoord4xOES *thread_param =
+      (EVGL_API_Thread_Command_glMultiTexCoord4xOES *)data;
+
+   orig_evgl_api_glMultiTexCoord4xOES(thread_param->target,
+                                      thread_param->s,
+                                      thread_param->t,
+                                      thread_param->r,
+                                      thread_param->q);
+
+}
+
+EAPI void
+glMultiTexCoord4xOES_evgl_api_thread_cmd(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMultiTexCoord4xOES(target, s, t, r, q);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMultiTexCoord4xOES thread_param_local;
+   EVGL_API_Thread_Command_glMultiTexCoord4xOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->s = s;
+   thread_param->t = t;
+   thread_param->r = r;
+   thread_param->q = q;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMultiTexCoord4xOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glNormal3xOES(GLfixed nx, GLfixed ny, GLfixed nz);
+ */
+
+typedef struct
+{
+   GLfixed nx;
+   GLfixed ny;
+   GLfixed nz;
+
+} EVGL_API_Thread_Command_glNormal3xOES;
+
+void (*orig_evgl_api_glNormal3xOES)(GLfixed nx, GLfixed ny, GLfixed nz);
+
+static void
+_evgl_api_thread_glNormal3xOES(void *data)
+{
+   EVGL_API_Thread_Command_glNormal3xOES *thread_param =
+      (EVGL_API_Thread_Command_glNormal3xOES *)data;
+
+   orig_evgl_api_glNormal3xOES(thread_param->nx,
+                               thread_param->ny,
+                               thread_param->nz);
+
+}
+
+EAPI void
+glNormal3xOES_evgl_api_thread_cmd(GLfixed nx, GLfixed ny, GLfixed nz)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glNormal3xOES(nx, ny, nz);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glNormal3xOES thread_param_local;
+   EVGL_API_Thread_Command_glNormal3xOES *thread_param = &thread_param_local;
+
+   thread_param->nx = nx;
+   thread_param->ny = ny;
+   thread_param->nz = nz;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glNormal3xOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glOrthoxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+ */
+
+typedef struct
+{
+   GLfixed left;
+   GLfixed right;
+   GLfixed bottom;
+   GLfixed top;
+   GLfixed zNear;
+   GLfixed zFar;
+
+} EVGL_API_Thread_Command_glOrthoxOES;
+
+void (*orig_evgl_api_glOrthoxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+static void
+_evgl_api_thread_glOrthoxOES(void *data)
+{
+   EVGL_API_Thread_Command_glOrthoxOES *thread_param =
+      (EVGL_API_Thread_Command_glOrthoxOES *)data;
+
+   orig_evgl_api_glOrthoxOES(thread_param->left,
+                             thread_param->right,
+                             thread_param->bottom,
+                             thread_param->top,
+                             thread_param->zNear,
+                             thread_param->zFar);
+
+}
+
+EAPI void
+glOrthoxOES_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glOrthoxOES(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glOrthoxOES thread_param_local;
+   EVGL_API_Thread_Command_glOrthoxOES *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glOrthoxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterxOES(GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glPointParameterxOES;
+
+void (*orig_evgl_api_glPointParameterxOES)(GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glPointParameterxOES(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterxOES *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterxOES *)data;
+
+   orig_evgl_api_glPointParameterxOES(thread_param->pname,
+                                      thread_param->param);
+
+}
+
+EAPI void
+glPointParameterxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterxOES(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterxOES thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterxOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointParameterxvOES(GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glPointParameterxvOES;
+
+void (*orig_evgl_api_glPointParameterxvOES)(GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glPointParameterxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glPointParameterxvOES *thread_param =
+      (EVGL_API_Thread_Command_glPointParameterxvOES *)data;
+
+   orig_evgl_api_glPointParameterxvOES(thread_param->pname,
+                                       thread_param->params);
+
+}
+
+EAPI void
+glPointParameterxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointParameterxvOES(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointParameterxvOES thread_param_local;
+   EVGL_API_Thread_Command_glPointParameterxvOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointParameterxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPointSizexOES(GLfixed size);
+ */
+
+typedef struct
+{
+   GLfixed size;
+
+} EVGL_API_Thread_Command_glPointSizexOES;
+
+void (*orig_evgl_api_glPointSizexOES)(GLfixed size);
+
+static void
+_evgl_api_thread_glPointSizexOES(void *data)
+{
+   EVGL_API_Thread_Command_glPointSizexOES *thread_param =
+      (EVGL_API_Thread_Command_glPointSizexOES *)data;
+
+   orig_evgl_api_glPointSizexOES(thread_param->size);
+
+}
+
+EAPI void
+glPointSizexOES_evgl_api_thread_cmd(GLfixed size)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPointSizexOES(size);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPointSizexOES thread_param_local;
+   EVGL_API_Thread_Command_glPointSizexOES *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPointSizexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPolygonOffsetxOES(GLfixed factor, GLfixed units);
+ */
+
+typedef struct
+{
+   GLfixed factor;
+   GLfixed units;
+
+} EVGL_API_Thread_Command_glPolygonOffsetxOES;
+
+void (*orig_evgl_api_glPolygonOffsetxOES)(GLfixed factor, GLfixed units);
+
+static void
+_evgl_api_thread_glPolygonOffsetxOES(void *data)
+{
+   EVGL_API_Thread_Command_glPolygonOffsetxOES *thread_param =
+      (EVGL_API_Thread_Command_glPolygonOffsetxOES *)data;
+
+   orig_evgl_api_glPolygonOffsetxOES(thread_param->factor,
+                                     thread_param->units);
+
+}
+
+EAPI void
+glPolygonOffsetxOES_evgl_api_thread_cmd(GLfixed factor, GLfixed units)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPolygonOffsetxOES(factor, units);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glPolygonOffsetxOES thread_param_local;
+   EVGL_API_Thread_Command_glPolygonOffsetxOES *thread_param = &thread_param_local;
+
+   thread_param->factor = factor;
+   thread_param->units = units;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPolygonOffsetxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRotatexOES(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed angle;
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glRotatexOES;
+
+void (*orig_evgl_api_glRotatexOES)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glRotatexOES(void *data)
+{
+   EVGL_API_Thread_Command_glRotatexOES *thread_param =
+      (EVGL_API_Thread_Command_glRotatexOES *)data;
+
+   orig_evgl_api_glRotatexOES(thread_param->angle,
+                              thread_param->x,
+                              thread_param->y,
+                              thread_param->z);
+
+}
+
+EAPI void
+glRotatexOES_evgl_api_thread_cmd(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRotatexOES(angle, x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRotatexOES thread_param_local;
+   EVGL_API_Thread_Command_glRotatexOES *thread_param = &thread_param_local;
+
+   thread_param->angle = angle;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRotatexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSampleCoveragexOES(GLclampx value, GLboolean invert);
+ */
+
+typedef struct
+{
+   GLclampx value;
+   GLboolean invert;
+
+} EVGL_API_Thread_Command_glSampleCoveragexOES;
+
+void (*orig_evgl_api_glSampleCoveragexOES)(GLclampx value, GLboolean invert);
+
+static void
+_evgl_api_thread_glSampleCoveragexOES(void *data)
+{
+   EVGL_API_Thread_Command_glSampleCoveragexOES *thread_param =
+      (EVGL_API_Thread_Command_glSampleCoveragexOES *)data;
+
+   orig_evgl_api_glSampleCoveragexOES(thread_param->value,
+                                      thread_param->invert);
+
+}
+
+EAPI void
+glSampleCoveragexOES_evgl_api_thread_cmd(GLclampx value, GLboolean invert)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSampleCoveragexOES(value, invert);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSampleCoveragexOES thread_param_local;
+   EVGL_API_Thread_Command_glSampleCoveragexOES *thread_param = &thread_param_local;
+
+   thread_param->value = value;
+   thread_param->invert = invert;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSampleCoveragexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScalexOES(GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glScalexOES;
+
+void (*orig_evgl_api_glScalexOES)(GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glScalexOES(void *data)
+{
+   EVGL_API_Thread_Command_glScalexOES *thread_param =
+      (EVGL_API_Thread_Command_glScalexOES *)data;
+
+   orig_evgl_api_glScalexOES(thread_param->x,
+                             thread_param->y,
+                             thread_param->z);
+
+}
+
+EAPI void
+glScalexOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glScalexOES(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glScalexOES thread_param_local;
+   EVGL_API_Thread_Command_glScalexOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glScalexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvxOES(GLenum target, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glTexEnvxOES;
+
+void (*orig_evgl_api_glTexEnvxOES)(GLenum target, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glTexEnvxOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvxOES *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvxOES *)data;
+
+   orig_evgl_api_glTexEnvxOES(thread_param->target,
+                              thread_param->pname,
+                              thread_param->param);
+
+}
+
+EAPI void
+glTexEnvxOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvxOES(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvxOES thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvxOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexEnvxvOES(GLenum target, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glTexEnvxvOES;
+
+void (*orig_evgl_api_glTexEnvxvOES)(GLenum target, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glTexEnvxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexEnvxvOES *thread_param =
+      (EVGL_API_Thread_Command_glTexEnvxvOES *)data;
+
+   orig_evgl_api_glTexEnvxvOES(thread_param->target,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glTexEnvxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexEnvxvOES(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexEnvxvOES thread_param_local;
+   EVGL_API_Thread_Command_glTexEnvxvOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexEnvxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterxOES(GLenum target, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glTexParameterxOES;
+
+void (*orig_evgl_api_glTexParameterxOES)(GLenum target, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glTexParameterxOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterxOES *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterxOES *)data;
+
+   orig_evgl_api_glTexParameterxOES(thread_param->target,
+                                    thread_param->pname,
+                                    thread_param->param);
+
+}
+
+EAPI void
+glTexParameterxOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterxOES(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterxOES thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterxOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterxvOES(GLenum target, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glTexParameterxvOES;
+
+void (*orig_evgl_api_glTexParameterxvOES)(GLenum target, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glTexParameterxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexParameterxvOES *thread_param =
+      (EVGL_API_Thread_Command_glTexParameterxvOES *)data;
+
+   orig_evgl_api_glTexParameterxvOES(thread_param->target,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glTexParameterxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexParameterxvOES(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexParameterxvOES thread_param_local;
+   EVGL_API_Thread_Command_glTexParameterxvOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexParameterxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTranslatexOES(GLfixed x, GLfixed y, GLfixed z);
+ */
+
+typedef struct
+{
+   GLfixed x;
+   GLfixed y;
+   GLfixed z;
+
+} EVGL_API_Thread_Command_glTranslatexOES;
+
+void (*orig_evgl_api_glTranslatexOES)(GLfixed x, GLfixed y, GLfixed z);
+
+static void
+_evgl_api_thread_glTranslatexOES(void *data)
+{
+   EVGL_API_Thread_Command_glTranslatexOES *thread_param =
+      (EVGL_API_Thread_Command_glTranslatexOES *)data;
+
+   orig_evgl_api_glTranslatexOES(thread_param->x,
+                                 thread_param->y,
+                                 thread_param->z);
+
+}
+
+EAPI void
+glTranslatexOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTranslatexOES(x, y, z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTranslatexOES thread_param_local;
+   EVGL_API_Thread_Command_glTranslatexOES *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->z = z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTranslatexOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsRenderbufferOES(GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint renderbuffer;
+
+} EVGL_API_Thread_Command_glIsRenderbufferOES;
+
+GLboolean (*orig_evgl_api_glIsRenderbufferOES)(GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glIsRenderbufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glIsRenderbufferOES *thread_param =
+      (EVGL_API_Thread_Command_glIsRenderbufferOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsRenderbufferOES(thread_param->renderbuffer);
+
+}
+
+EAPI GLboolean
+glIsRenderbufferOES_evgl_api_thread_cmd(GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsRenderbufferOES(renderbuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsRenderbufferOES thread_param_local;
+   EVGL_API_Thread_Command_glIsRenderbufferOES *thread_param = &thread_param_local;
+
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsRenderbufferOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glBindRenderbufferOES(GLenum target, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindRenderbufferOES;
+
+void (*orig_evgl_api_glBindRenderbufferOES)(GLenum target, GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glBindRenderbufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glBindRenderbufferOES *thread_param =
+      (EVGL_API_Thread_Command_glBindRenderbufferOES *)data;
+
+   orig_evgl_api_glBindRenderbufferOES(thread_param->target,
+                                       thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindRenderbufferOES_evgl_api_thread_cmd(GLenum target, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindRenderbufferOES(target, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindRenderbufferOES thread_param_local;
+   EVGL_API_Thread_Command_glBindRenderbufferOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindRenderbufferOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindRenderbufferOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindRenderbufferOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* renderbuffers;
+   void *renderbuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteRenderbuffersOES;
+
+void (*orig_evgl_api_glDeleteRenderbuffersOES)(GLsizei n, const GLuint* renderbuffers);
+
+static void
+_evgl_api_thread_glDeleteRenderbuffersOES(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteRenderbuffersOES *thread_param =
+      (EVGL_API_Thread_Command_glDeleteRenderbuffersOES *)data;
+
+   orig_evgl_api_glDeleteRenderbuffersOES(thread_param->n,
+                                          thread_param->renderbuffers);
+
+
+   if (thread_param->renderbuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->renderbuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteRenderbuffersOES_evgl_api_thread_cmd(GLsizei n, const GLuint* renderbuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteRenderbuffersOES(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteRenderbuffersOES thread_param_local;
+   EVGL_API_Thread_Command_glDeleteRenderbuffersOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteRenderbuffersOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteRenderbuffersOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   thread_param->renderbuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (renderbuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->renderbuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->renderbuffers_copied)
+          {
+             memcpy(thread_param->renderbuffers_copied, renderbuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->renderbuffers = (const GLuint *)thread_param->renderbuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteRenderbuffersOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* renderbuffers;
+
+} EVGL_API_Thread_Command_glGenRenderbuffersOES;
+
+void (*orig_evgl_api_glGenRenderbuffersOES)(GLsizei n, GLuint* renderbuffers);
+
+static void
+_evgl_api_thread_glGenRenderbuffersOES(void *data)
+{
+   EVGL_API_Thread_Command_glGenRenderbuffersOES *thread_param =
+      (EVGL_API_Thread_Command_glGenRenderbuffersOES *)data;
+
+   orig_evgl_api_glGenRenderbuffersOES(thread_param->n,
+                                       thread_param->renderbuffers);
+
+}
+
+EAPI void
+glGenRenderbuffersOES_evgl_api_thread_cmd(GLsizei n, GLuint* renderbuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenRenderbuffersOES(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenRenderbuffersOES thread_param_local;
+   EVGL_API_Thread_Command_glGenRenderbuffersOES *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenRenderbuffersOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorageOES(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glRenderbufferStorageOES;
+
+void (*orig_evgl_api_glRenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glRenderbufferStorageOES(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorageOES *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorageOES *)data;
+
+   orig_evgl_api_glRenderbufferStorageOES(thread_param->target,
+                                          thread_param->internalformat,
+                                          thread_param->width,
+                                          thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorageOES(target, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorageOES thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorageOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glRenderbufferStorageOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glRenderbufferStorageOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorageOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetRenderbufferParameterivOES;
+
+void (*orig_evgl_api_glGetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetRenderbufferParameterivOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetRenderbufferParameterivOES *thread_param =
+      (EVGL_API_Thread_Command_glGetRenderbufferParameterivOES *)data;
+
+   orig_evgl_api_glGetRenderbufferParameterivOES(thread_param->target,
+                                                 thread_param->pname,
+                                                 thread_param->params);
+
+}
+
+EAPI void
+glGetRenderbufferParameterivOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetRenderbufferParameterivOES(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetRenderbufferParameterivOES thread_param_local;
+   EVGL_API_Thread_Command_glGetRenderbufferParameterivOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetRenderbufferParameterivOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsFramebufferOES(GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint framebuffer;
+
+} EVGL_API_Thread_Command_glIsFramebufferOES;
+
+GLboolean (*orig_evgl_api_glIsFramebufferOES)(GLuint framebuffer);
+
+static void
+_evgl_api_thread_glIsFramebufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glIsFramebufferOES *thread_param =
+      (EVGL_API_Thread_Command_glIsFramebufferOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsFramebufferOES(thread_param->framebuffer);
+
+}
+
+EAPI GLboolean
+glIsFramebufferOES_evgl_api_thread_cmd(GLuint framebuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsFramebufferOES(framebuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsFramebufferOES thread_param_local;
+   EVGL_API_Thread_Command_glIsFramebufferOES *thread_param = &thread_param_local;
+
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsFramebufferOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glBindFramebufferOES(GLenum target, GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint framebuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glBindFramebufferOES;
+
+void (*orig_evgl_api_glBindFramebufferOES)(GLenum target, GLuint framebuffer);
+
+static void
+_evgl_api_thread_glBindFramebufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glBindFramebufferOES *thread_param =
+      (EVGL_API_Thread_Command_glBindFramebufferOES *)data;
+
+   orig_evgl_api_glBindFramebufferOES(thread_param->target,
+                                      thread_param->framebuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindFramebufferOES_evgl_api_thread_cmd(GLenum target, GLuint framebuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindFramebufferOES(target, framebuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindFramebufferOES thread_param_local;
+   EVGL_API_Thread_Command_glBindFramebufferOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glBindFramebufferOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glBindFramebufferOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindFramebufferOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint* framebuffers;
+   void *framebuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glDeleteFramebuffersOES;
+
+void (*orig_evgl_api_glDeleteFramebuffersOES)(GLsizei n, const GLuint* framebuffers);
+
+static void
+_evgl_api_thread_glDeleteFramebuffersOES(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteFramebuffersOES *thread_param =
+      (EVGL_API_Thread_Command_glDeleteFramebuffersOES *)data;
+
+   orig_evgl_api_glDeleteFramebuffersOES(thread_param->n,
+                                         thread_param->framebuffers);
+
+
+   if (thread_param->framebuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->framebuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteFramebuffersOES_evgl_api_thread_cmd(GLsizei n, const GLuint* framebuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteFramebuffersOES(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteFramebuffersOES thread_param_local;
+   EVGL_API_Thread_Command_glDeleteFramebuffersOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glDeleteFramebuffersOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glDeleteFramebuffersOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   thread_param->framebuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (framebuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->framebuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->framebuffers_copied)
+          {
+             memcpy(thread_param->framebuffers_copied, framebuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->framebuffers = (const GLuint *)thread_param->framebuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteFramebuffersOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenFramebuffersOES(GLsizei n, GLuint* framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint* framebuffers;
+
+} EVGL_API_Thread_Command_glGenFramebuffersOES;
+
+void (*orig_evgl_api_glGenFramebuffersOES)(GLsizei n, GLuint* framebuffers);
+
+static void
+_evgl_api_thread_glGenFramebuffersOES(void *data)
+{
+   EVGL_API_Thread_Command_glGenFramebuffersOES *thread_param =
+      (EVGL_API_Thread_Command_glGenFramebuffersOES *)data;
+
+   orig_evgl_api_glGenFramebuffersOES(thread_param->n,
+                                      thread_param->framebuffers);
+
+}
+
+EAPI void
+glGenFramebuffersOES_evgl_api_thread_cmd(GLsizei n, GLuint* framebuffers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenFramebuffersOES(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenFramebuffersOES thread_param_local;
+   EVGL_API_Thread_Command_glGenFramebuffersOES *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenFramebuffersOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glCheckFramebufferStatusOES(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLenum target;
+
+} EVGL_API_Thread_Command_glCheckFramebufferStatusOES;
+
+GLenum (*orig_evgl_api_glCheckFramebufferStatusOES)(GLenum target);
+
+static void
+_evgl_api_thread_glCheckFramebufferStatusOES(void *data)
+{
+   EVGL_API_Thread_Command_glCheckFramebufferStatusOES *thread_param =
+      (EVGL_API_Thread_Command_glCheckFramebufferStatusOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glCheckFramebufferStatusOES(thread_param->target);
+
+}
+
+EAPI GLenum
+glCheckFramebufferStatusOES_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glCheckFramebufferStatusOES(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCheckFramebufferStatusOES thread_param_local;
+   EVGL_API_Thread_Command_glCheckFramebufferStatusOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCheckFramebufferStatusOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum renderbuffertarget;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferRenderbufferOES;
+
+void (*orig_evgl_api_glFramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+static void
+_evgl_api_thread_glFramebufferRenderbufferOES(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferRenderbufferOES *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferRenderbufferOES *)data;
+
+   orig_evgl_api_glFramebufferRenderbufferOES(thread_param->target,
+                                              thread_param->attachment,
+                                              thread_param->renderbuffertarget,
+                                              thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferRenderbufferOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferRenderbufferOES thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferRenderbufferOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferRenderbufferOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferRenderbufferOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->renderbuffertarget = renderbuffertarget;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferRenderbufferOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferTexture2DOES;
+
+void (*orig_evgl_api_glFramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+static void
+_evgl_api_thread_glFramebufferTexture2DOES(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture2DOES *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture2DOES *)data;
+
+   orig_evgl_api_glFramebufferTexture2DOES(thread_param->target,
+                                           thread_param->attachment,
+                                           thread_param->textarget,
+                                           thread_param->texture,
+                                           thread_param->level);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2DOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture2DOES thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture2DOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferTexture2DOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferTexture2DOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture2DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum pname;
+   GLint* params;
+
+} EVGL_API_Thread_Command_glGetFramebufferAttachmentParameterivOES;
+
+void (*orig_evgl_api_glGetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+
+static void
+_evgl_api_thread_glGetFramebufferAttachmentParameterivOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameterivOES *thread_param =
+      (EVGL_API_Thread_Command_glGetFramebufferAttachmentParameterivOES *)data;
+
+   orig_evgl_api_glGetFramebufferAttachmentParameterivOES(thread_param->target,
+                                                          thread_param->attachment,
+                                                          thread_param->pname,
+                                                          thread_param->params);
+
+}
+
+EAPI void
+glGetFramebufferAttachmentParameterivOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum pname, GLint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameterivOES thread_param_local;
+   EVGL_API_Thread_Command_glGetFramebufferAttachmentParameterivOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFramebufferAttachmentParameterivOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenerateMipmapOES(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum target;
+
+} EVGL_API_Thread_Command_glGenerateMipmapOES;
+
+void (*orig_evgl_api_glGenerateMipmapOES)(GLenum target);
+
+static void
+_evgl_api_thread_glGenerateMipmapOES(void *data)
+{
+   EVGL_API_Thread_Command_glGenerateMipmapOES *thread_param =
+      (EVGL_API_Thread_Command_glGenerateMipmapOES *)data;
+
+   orig_evgl_api_glGenerateMipmapOES(thread_param->target);
+
+}
+
+EAPI void
+glGenerateMipmapOES_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenerateMipmapOES(target);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenerateMipmapOES thread_param_local;
+   EVGL_API_Thread_Command_glGenerateMipmapOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenerateMipmapOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCurrentPaletteMatrixOES(GLuint matrixpaletteindex);
+ */
+
+typedef struct
+{
+   GLuint matrixpaletteindex;
+
+} EVGL_API_Thread_Command_glCurrentPaletteMatrixOES;
+
+void (*orig_evgl_api_glCurrentPaletteMatrixOES)(GLuint matrixpaletteindex);
+
+static void
+_evgl_api_thread_glCurrentPaletteMatrixOES(void *data)
+{
+   EVGL_API_Thread_Command_glCurrentPaletteMatrixOES *thread_param =
+      (EVGL_API_Thread_Command_glCurrentPaletteMatrixOES *)data;
+
+   orig_evgl_api_glCurrentPaletteMatrixOES(thread_param->matrixpaletteindex);
+
+}
+
+EAPI void
+glCurrentPaletteMatrixOES_evgl_api_thread_cmd(GLuint matrixpaletteindex)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCurrentPaletteMatrixOES(matrixpaletteindex);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCurrentPaletteMatrixOES thread_param_local;
+   EVGL_API_Thread_Command_glCurrentPaletteMatrixOES *thread_param = &thread_param_local;
+
+   thread_param->matrixpaletteindex = matrixpaletteindex;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCurrentPaletteMatrixOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLoadPaletteFromModelViewMatrixOES(void);
+ */
+
+void (*orig_evgl_api_glLoadPaletteFromModelViewMatrixOES)(void);
+
+static void
+_evgl_api_thread_glLoadPaletteFromModelViewMatrixOES(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glLoadPaletteFromModelViewMatrixOES();
+
+}
+
+EAPI void
+glLoadPaletteFromModelViewMatrixOES_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glLoadPaletteFromModelViewMatrixOES();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glLoadPaletteFromModelViewMatrixOES,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glMatrixIndexPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glMatrixIndexPointerOES;
+
+void (*orig_evgl_api_glMatrixIndexPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glMatrixIndexPointerOES(void *data)
+{
+   EVGL_API_Thread_Command_glMatrixIndexPointerOES *thread_param =
+      (EVGL_API_Thread_Command_glMatrixIndexPointerOES *)data;
+
+   orig_evgl_api_glMatrixIndexPointerOES(thread_param->size,
+                                         thread_param->type,
+                                         thread_param->stride,
+                                         thread_param->pointer);
+
+}
+
+EAPI void
+glMatrixIndexPointerOES_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMatrixIndexPointerOES(size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMatrixIndexPointerOES thread_param_local;
+   EVGL_API_Thread_Command_glMatrixIndexPointerOES *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMatrixIndexPointerOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glWeightPointerOES(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glWeightPointerOES;
+
+void (*orig_evgl_api_glWeightPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glWeightPointerOES(void *data)
+{
+   EVGL_API_Thread_Command_glWeightPointerOES *thread_param =
+      (EVGL_API_Thread_Command_glWeightPointerOES *)data;
+
+   orig_evgl_api_glWeightPointerOES(thread_param->size,
+                                    thread_param->type,
+                                    thread_param->stride,
+                                    thread_param->pointer);
+
+}
+
+EAPI void
+glWeightPointerOES_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glWeightPointerOES(size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glWeightPointerOES thread_param_local;
+   EVGL_API_Thread_Command_glWeightPointerOES *thread_param = &thread_param_local;
+
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glWeightPointerOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLbitfield
+   glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]);
+ */
+
+typedef struct
+{
+   GLbitfield return_value;
+   GLfixed mantissa[16];
+   GLint exponent[16];
+
+} EVGL_API_Thread_Command_glQueryMatrixxOES;
+
+GLbitfield (*orig_evgl_api_glQueryMatrixxOES)(GLfixed mantissa[16], GLint exponent[16]);
+
+static void
+_evgl_api_thread_glQueryMatrixxOES(void *data)
+{
+   EVGL_API_Thread_Command_glQueryMatrixxOES *thread_param =
+      (EVGL_API_Thread_Command_glQueryMatrixxOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glQueryMatrixxOES(thread_param->mantissa,
+                                                                thread_param->exponent);
+
+}
+
+EAPI GLbitfield
+glQueryMatrixxOES_evgl_api_thread_cmd(GLfixed mantissa[16], GLint exponent[16])
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glQueryMatrixxOES(mantissa, exponent);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glQueryMatrixxOES thread_param_local;
+   EVGL_API_Thread_Command_glQueryMatrixxOES *thread_param = &thread_param_local;
+
+   memcpy(thread_param->mantissa, &mantissa, sizeof(mantissa));
+   memcpy(thread_param->exponent, &exponent, sizeof(exponent));
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glQueryMatrixxOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glDepthRangefOES(GLclampf zNear, GLclampf zFar);
+ */
+
+typedef struct
+{
+   GLclampf zNear;
+   GLclampf zFar;
+
+} EVGL_API_Thread_Command_glDepthRangefOES;
+
+void (*orig_evgl_api_glDepthRangefOES)(GLclampf zNear, GLclampf zFar);
+
+static void
+_evgl_api_thread_glDepthRangefOES(void *data)
+{
+   EVGL_API_Thread_Command_glDepthRangefOES *thread_param =
+      (EVGL_API_Thread_Command_glDepthRangefOES *)data;
+
+   orig_evgl_api_glDepthRangefOES(thread_param->zNear,
+                                  thread_param->zFar);
+
+}
+
+EAPI void
+glDepthRangefOES_evgl_api_thread_cmd(GLclampf zNear, GLclampf zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDepthRangefOES(zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDepthRangefOES thread_param_local;
+   EVGL_API_Thread_Command_glDepthRangefOES *thread_param = &thread_param_local;
+
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDepthRangefOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+ */
+
+typedef struct
+{
+   GLfloat left;
+   GLfloat right;
+   GLfloat bottom;
+   GLfloat top;
+   GLfloat zNear;
+   GLfloat zFar;
+
+} EVGL_API_Thread_Command_glFrustumfOES;
+
+void (*orig_evgl_api_glFrustumfOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+static void
+_evgl_api_thread_glFrustumfOES(void *data)
+{
+   EVGL_API_Thread_Command_glFrustumfOES *thread_param =
+      (EVGL_API_Thread_Command_glFrustumfOES *)data;
+
+   orig_evgl_api_glFrustumfOES(thread_param->left,
+                               thread_param->right,
+                               thread_param->bottom,
+                               thread_param->top,
+                               thread_param->zNear,
+                               thread_param->zFar);
+
+}
+
+EAPI void
+glFrustumfOES_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFrustumfOES(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFrustumfOES thread_param_local;
+   EVGL_API_Thread_Command_glFrustumfOES *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFrustumfOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+ */
+
+typedef struct
+{
+   GLfloat left;
+   GLfloat right;
+   GLfloat bottom;
+   GLfloat top;
+   GLfloat zNear;
+   GLfloat zFar;
+
+} EVGL_API_Thread_Command_glOrthofOES;
+
+void (*orig_evgl_api_glOrthofOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+static void
+_evgl_api_thread_glOrthofOES(void *data)
+{
+   EVGL_API_Thread_Command_glOrthofOES *thread_param =
+      (EVGL_API_Thread_Command_glOrthofOES *)data;
+
+   orig_evgl_api_glOrthofOES(thread_param->left,
+                             thread_param->right,
+                             thread_param->bottom,
+                             thread_param->top,
+                             thread_param->zNear,
+                             thread_param->zFar);
+
+}
+
+EAPI void
+glOrthofOES_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glOrthofOES(left, right, bottom, top, zNear, zFar);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glOrthofOES thread_param_local;
+   EVGL_API_Thread_Command_glOrthofOES *thread_param = &thread_param_local;
+
+   thread_param->left = left;
+   thread_param->right = right;
+   thread_param->bottom = bottom;
+   thread_param->top = top;
+   thread_param->zNear = zNear;
+   thread_param->zFar = zFar;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glOrthofOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanefOES(GLenum plane, const GLfloat *equation);
+ */
+
+typedef struct
+{
+   GLenum plane;
+   const GLfloat *equation;
+
+} EVGL_API_Thread_Command_glClipPlanefOES;
+
+void (*orig_evgl_api_glClipPlanefOES)(GLenum plane, const GLfloat *equation);
+
+static void
+_evgl_api_thread_glClipPlanefOES(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanefOES *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanefOES *)data;
+
+   orig_evgl_api_glClipPlanefOES(thread_param->plane,
+                                 thread_param->equation);
+
+}
+
+EAPI void
+glClipPlanefOES_evgl_api_thread_cmd(GLenum plane, const GLfloat *equation)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanefOES(plane, equation);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanefOES thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanefOES *thread_param = &thread_param_local;
+
+   thread_param->plane = plane;
+   thread_param->equation = equation;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanefOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat eqn[4];
+
+} EVGL_API_Thread_Command_glGetClipPlanefOES;
+
+void (*orig_evgl_api_glGetClipPlanefOES)(GLenum pname, GLfloat eqn[4]);
+
+static void
+_evgl_api_thread_glGetClipPlanefOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetClipPlanefOES *thread_param =
+      (EVGL_API_Thread_Command_glGetClipPlanefOES *)data;
+
+   orig_evgl_api_glGetClipPlanefOES(thread_param->pname,
+                                    thread_param->eqn);
+
+}
+
+EAPI void
+glGetClipPlanefOES_evgl_api_thread_cmd(GLenum pname, GLfloat eqn[4])
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetClipPlanefOES(pname, eqn);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetClipPlanefOES thread_param_local;
+   EVGL_API_Thread_Command_glGetClipPlanefOES *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   memcpy(thread_param->eqn, &eqn, sizeof(eqn));
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetClipPlanefOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearDepthfOES(GLclampf depth);
+ */
+
+typedef struct
+{
+   GLclampf depth;
+
+} EVGL_API_Thread_Command_glClearDepthfOES;
+
+void (*orig_evgl_api_glClearDepthfOES)(GLclampf depth);
+
+static void
+_evgl_api_thread_glClearDepthfOES(void *data)
+{
+   EVGL_API_Thread_Command_glClearDepthfOES *thread_param =
+      (EVGL_API_Thread_Command_glClearDepthfOES *)data;
+
+   orig_evgl_api_glClearDepthfOES(thread_param->depth);
+
+}
+
+EAPI void
+glClearDepthfOES_evgl_api_thread_cmd(GLclampf depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearDepthfOES(depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearDepthfOES thread_param_local;
+   EVGL_API_Thread_Command_glClearDepthfOES *thread_param = &thread_param_local;
+
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearDepthfOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGenfOES(GLenum coord, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glTexGenfOES;
+
+void (*orig_evgl_api_glTexGenfOES)(GLenum coord, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glTexGenfOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGenfOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGenfOES *)data;
+
+   orig_evgl_api_glTexGenfOES(thread_param->coord,
+                              thread_param->pname,
+                              thread_param->param);
+
+}
+
+EAPI void
+glTexGenfOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGenfOES(coord, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGenfOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGenfOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGenfOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   const GLfloat *params;
+
+} EVGL_API_Thread_Command_glTexGenfvOES;
+
+void (*orig_evgl_api_glTexGenfvOES)(GLenum coord, GLenum pname, const GLfloat *params);
+
+static void
+_evgl_api_thread_glTexGenfvOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGenfvOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGenfvOES *)data;
+
+   orig_evgl_api_glTexGenfvOES(thread_param->coord,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glTexGenfvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGenfvOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGenfvOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGenfvOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGenfvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGeniOES(GLenum coord, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLint param;
+
+} EVGL_API_Thread_Command_glTexGeniOES;
+
+void (*orig_evgl_api_glTexGeniOES)(GLenum coord, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glTexGeniOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGeniOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGeniOES *)data;
+
+   orig_evgl_api_glTexGeniOES(thread_param->coord,
+                              thread_param->pname,
+                              thread_param->param);
+
+}
+
+EAPI void
+glTexGeniOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGeniOES(coord, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGeniOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGeniOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGeniOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGenivOES(GLenum coord, GLenum pname, const GLint *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   const GLint *params;
+
+} EVGL_API_Thread_Command_glTexGenivOES;
+
+void (*orig_evgl_api_glTexGenivOES)(GLenum coord, GLenum pname, const GLint *params);
+
+static void
+_evgl_api_thread_glTexGenivOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGenivOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGenivOES *)data;
+
+   orig_evgl_api_glTexGenivOES(thread_param->coord,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glTexGenivOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGenivOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGenivOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGenivOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGenivOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGenxOES(GLenum coord, GLenum pname, GLfixed param);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLfixed param;
+
+} EVGL_API_Thread_Command_glTexGenxOES;
+
+void (*orig_evgl_api_glTexGenxOES)(GLenum coord, GLenum pname, GLfixed param);
+
+static void
+_evgl_api_thread_glTexGenxOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGenxOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGenxOES *)data;
+
+   orig_evgl_api_glTexGenxOES(thread_param->coord,
+                              thread_param->pname,
+                              thread_param->param);
+
+}
+
+EAPI void
+glTexGenxOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfixed param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGenxOES(coord, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGenxOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGenxOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGenxOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   const GLfixed *params;
+
+} EVGL_API_Thread_Command_glTexGenxvOES;
+
+void (*orig_evgl_api_glTexGenxvOES)(GLenum coord, GLenum pname, const GLfixed *params);
+
+static void
+_evgl_api_thread_glTexGenxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glTexGenxvOES *thread_param =
+      (EVGL_API_Thread_Command_glTexGenxvOES *)data;
+
+   orig_evgl_api_glTexGenxvOES(thread_param->coord,
+                               thread_param->pname,
+                               thread_param->params);
+
+}
+
+EAPI void
+glTexGenxvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexGenxvOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexGenxvOES thread_param_local;
+   EVGL_API_Thread_Command_glTexGenxvOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexGenxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_API_Thread_Command_glGetTexGenfvOES;
+
+void (*orig_evgl_api_glGetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat *params);
+
+static void
+_evgl_api_thread_glGetTexGenfvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexGenfvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetTexGenfvOES *)data;
+
+   orig_evgl_api_glGetTexGenfvOES(thread_param->coord,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+}
+
+EAPI void
+glGetTexGenfvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexGenfvOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexGenfvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetTexGenfvOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexGenfvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexGenivOES(GLenum coord, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetTexGenivOES;
+
+void (*orig_evgl_api_glGetTexGenivOES)(GLenum coord, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetTexGenivOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexGenivOES *thread_param =
+      (EVGL_API_Thread_Command_glGetTexGenivOES *)data;
+
+   orig_evgl_api_glGetTexGenivOES(thread_param->coord,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+}
+
+EAPI void
+glGetTexGenivOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexGenivOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexGenivOES thread_param_local;
+   EVGL_API_Thread_Command_glGetTexGenivOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexGenivOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params);
+ */
+
+typedef struct
+{
+   GLenum coord;
+   GLenum pname;
+   GLfixed *params;
+
+} EVGL_API_Thread_Command_glGetTexGenxvOES;
+
+void (*orig_evgl_api_glGetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params);
+
+static void
+_evgl_api_thread_glGetTexGenxvOES(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexGenxvOES *thread_param =
+      (EVGL_API_Thread_Command_glGetTexGenxvOES *)data;
+
+   orig_evgl_api_glGetTexGenxvOES(thread_param->coord,
+                                  thread_param->pname,
+                                  thread_param->params);
+
+}
+
+EAPI void
+glGetTexGenxvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfixed *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexGenxvOES(coord, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexGenxvOES thread_param_local;
+   EVGL_API_Thread_Command_glGetTexGenxvOES *thread_param = &thread_param_local;
+
+   thread_param->coord = coord;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexGenxvOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindVertexArrayOES(GLuint array);
+ */
+
+typedef struct
+{
+   GLuint array;
+
+} EVGL_API_Thread_Command_glBindVertexArrayOES;
+
+void (*orig_evgl_api_glBindVertexArrayOES)(GLuint array);
+
+static void
+_evgl_api_thread_glBindVertexArrayOES(void *data)
+{
+   EVGL_API_Thread_Command_glBindVertexArrayOES *thread_param =
+      (EVGL_API_Thread_Command_glBindVertexArrayOES *)data;
+
+   orig_evgl_api_glBindVertexArrayOES(thread_param->array);
+
+}
+
+EAPI void
+glBindVertexArrayOES_evgl_api_thread_cmd(GLuint array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindVertexArrayOES(array);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindVertexArrayOES thread_param_local;
+   EVGL_API_Thread_Command_glBindVertexArrayOES *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindVertexArrayOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *arrays;
+
+} EVGL_API_Thread_Command_glDeleteVertexArraysOES;
+
+void (*orig_evgl_api_glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays);
+
+static void
+_evgl_api_thread_glDeleteVertexArraysOES(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteVertexArraysOES *thread_param =
+      (EVGL_API_Thread_Command_glDeleteVertexArraysOES *)data;
+
+   orig_evgl_api_glDeleteVertexArraysOES(thread_param->n,
+                                         thread_param->arrays);
+
+}
+
+EAPI void
+glDeleteVertexArraysOES_evgl_api_thread_cmd(GLsizei n, const GLuint *arrays)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteVertexArraysOES(n, arrays);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteVertexArraysOES thread_param_local;
+   EVGL_API_Thread_Command_glDeleteVertexArraysOES *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->arrays = arrays;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteVertexArraysOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenVertexArraysOES(GLsizei n, GLuint *arrays);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *arrays;
+
+} EVGL_API_Thread_Command_glGenVertexArraysOES;
+
+void (*orig_evgl_api_glGenVertexArraysOES)(GLsizei n, GLuint *arrays);
+
+static void
+_evgl_api_thread_glGenVertexArraysOES(void *data)
+{
+   EVGL_API_Thread_Command_glGenVertexArraysOES *thread_param =
+      (EVGL_API_Thread_Command_glGenVertexArraysOES *)data;
+
+   orig_evgl_api_glGenVertexArraysOES(thread_param->n,
+                                      thread_param->arrays);
+
+}
+
+EAPI void
+glGenVertexArraysOES_evgl_api_thread_cmd(GLsizei n, GLuint *arrays)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenVertexArraysOES(n, arrays);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenVertexArraysOES thread_param_local;
+   EVGL_API_Thread_Command_glGenVertexArraysOES *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->arrays = arrays;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenVertexArraysOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsVertexArrayOES(GLuint array);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint array;
+
+} EVGL_API_Thread_Command_glIsVertexArrayOES;
+
+GLboolean (*orig_evgl_api_glIsVertexArrayOES)(GLuint array);
+
+static void
+_evgl_api_thread_glIsVertexArrayOES(void *data)
+{
+   EVGL_API_Thread_Command_glIsVertexArrayOES *thread_param =
+      (EVGL_API_Thread_Command_glIsVertexArrayOES *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsVertexArrayOES(thread_param->array);
+
+}
+
+EAPI GLboolean
+glIsVertexArrayOES_evgl_api_thread_cmd(GLuint array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsVertexArrayOES(array);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsVertexArrayOES thread_param_local;
+   EVGL_API_Thread_Command_glIsVertexArrayOES *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsVertexArrayOES,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glCopyTextureLevelsAPPLE(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+ */
+
+typedef struct
+{
+   GLuint destinationTexture;
+   GLuint sourceTexture;
+   GLint sourceBaseLevel;
+   GLsizei sourceLevelCount;
+
+} EVGL_API_Thread_Command_glCopyTextureLevelsAPPLE;
+
+void (*orig_evgl_api_glCopyTextureLevelsAPPLE)(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+
+static void
+_evgl_api_thread_glCopyTextureLevelsAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glCopyTextureLevelsAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glCopyTextureLevelsAPPLE *)data;
+
+   orig_evgl_api_glCopyTextureLevelsAPPLE(thread_param->destinationTexture,
+                                          thread_param->sourceTexture,
+                                          thread_param->sourceBaseLevel,
+                                          thread_param->sourceLevelCount);
+
+}
+
+EAPI void
+glCopyTextureLevelsAPPLE_evgl_api_thread_cmd(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyTextureLevelsAPPLE(destinationTexture, sourceTexture, sourceBaseLevel, sourceLevelCount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyTextureLevelsAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glCopyTextureLevelsAPPLE *thread_param = &thread_param_local;
+
+   thread_param->destinationTexture = destinationTexture;
+   thread_param->sourceTexture = sourceTexture;
+   thread_param->sourceBaseLevel = sourceBaseLevel;
+   thread_param->sourceLevelCount = sourceLevelCount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyTextureLevelsAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorageMultisampleAPPLE(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLsizei b;
+   GLenum c;
+   GLsizei d;
+   GLsizei e;
+
+} EVGL_API_Thread_Command_glRenderbufferStorageMultisampleAPPLE;
+
+void (*orig_evgl_api_glRenderbufferStorageMultisampleAPPLE)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+static void
+_evgl_api_thread_glRenderbufferStorageMultisampleAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorageMultisampleAPPLE *)data;
+
+   orig_evgl_api_glRenderbufferStorageMultisampleAPPLE(thread_param->a,
+                                                       thread_param->b,
+                                                       thread_param->c,
+                                                       thread_param->d,
+                                                       thread_param->e);
+
+}
+
+EAPI void
+glRenderbufferStorageMultisampleAPPLE_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorageMultisampleAPPLE(a, b, c, d, e);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleAPPLE *thread_param = &thread_param_local;
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorageMultisampleAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glResolveMultisampleFramebufferAPPLE(void);
+ */
+
+void (*orig_evgl_api_glResolveMultisampleFramebufferAPPLE)(void);
+
+static void
+_evgl_api_thread_glResolveMultisampleFramebufferAPPLE(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glResolveMultisampleFramebufferAPPLE();
+
+}
+
+EAPI void
+glResolveMultisampleFramebufferAPPLE_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glResolveMultisampleFramebufferAPPLE();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glResolveMultisampleFramebufferAPPLE,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   GLsync
+   glFenceSyncAPPLE(GLenum condition, GLbitfield flags);
+ */
+
+typedef struct
+{
+   GLsync return_value;
+   GLenum condition;
+   GLbitfield flags;
+
+} EVGL_API_Thread_Command_glFenceSyncAPPLE;
+
+GLsync (*orig_evgl_api_glFenceSyncAPPLE)(GLenum condition, GLbitfield flags);
+
+static void
+_evgl_api_thread_glFenceSyncAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glFenceSyncAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glFenceSyncAPPLE *)data;
+
+   thread_param->return_value = orig_evgl_api_glFenceSyncAPPLE(thread_param->condition,
+                                                               thread_param->flags);
+
+}
+
+EAPI GLsync
+glFenceSyncAPPLE_evgl_api_thread_cmd(GLenum condition, GLbitfield flags)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glFenceSyncAPPLE(condition, flags);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFenceSyncAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glFenceSyncAPPLE *thread_param = &thread_param_local;
+
+   thread_param->condition = condition;
+   thread_param->flags = flags;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFenceSyncAPPLE,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsSyncAPPLE(GLsync sync);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLsync sync;
+
+} EVGL_API_Thread_Command_glIsSyncAPPLE;
+
+GLboolean (*orig_evgl_api_glIsSyncAPPLE)(GLsync sync);
+
+static void
+_evgl_api_thread_glIsSyncAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glIsSyncAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glIsSyncAPPLE *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsSyncAPPLE(thread_param->sync);
+
+}
+
+EAPI GLboolean
+glIsSyncAPPLE_evgl_api_thread_cmd(GLsync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsSyncAPPLE(sync);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsSyncAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glIsSyncAPPLE *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsSyncAPPLE,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glDeleteSyncAPPLE(GLsync sync);
+ */
+
+typedef struct
+{
+   GLsync sync;
+
+} EVGL_API_Thread_Command_glDeleteSyncAPPLE;
+
+void (*orig_evgl_api_glDeleteSyncAPPLE)(GLsync sync);
+
+static void
+_evgl_api_thread_glDeleteSyncAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteSyncAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glDeleteSyncAPPLE *)data;
+
+   orig_evgl_api_glDeleteSyncAPPLE(thread_param->sync);
+
+}
+
+EAPI void
+glDeleteSyncAPPLE_evgl_api_thread_cmd(GLsync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteSyncAPPLE(sync);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteSyncAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glDeleteSyncAPPLE *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteSyncAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glClientWaitSyncAPPLE(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLsync sync;
+   GLbitfield flags;
+   EvasGLuint64 timeout;
+
+} EVGL_API_Thread_Command_glClientWaitSyncAPPLE;
+
+GLenum (*orig_evgl_api_glClientWaitSyncAPPLE)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+static void
+_evgl_api_thread_glClientWaitSyncAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glClientWaitSyncAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glClientWaitSyncAPPLE *)data;
+
+   thread_param->return_value = orig_evgl_api_glClientWaitSyncAPPLE(thread_param->sync,
+                                                                    thread_param->flags,
+                                                                    thread_param->timeout);
+
+}
+
+EAPI GLenum
+glClientWaitSyncAPPLE_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glClientWaitSyncAPPLE(sync, flags, timeout);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClientWaitSyncAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glClientWaitSyncAPPLE *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->flags = flags;
+   thread_param->timeout = timeout;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClientWaitSyncAPPLE,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glWaitSyncAPPLE(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+ */
+
+typedef struct
+{
+   GLsync sync;
+   GLbitfield flags;
+   EvasGLuint64 timeout;
+
+} EVGL_API_Thread_Command_glWaitSyncAPPLE;
+
+void (*orig_evgl_api_glWaitSyncAPPLE)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+static void
+_evgl_api_thread_glWaitSyncAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glWaitSyncAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glWaitSyncAPPLE *)data;
+
+   orig_evgl_api_glWaitSyncAPPLE(thread_param->sync,
+                                 thread_param->flags,
+                                 thread_param->timeout);
+
+}
+
+EAPI void
+glWaitSyncAPPLE_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glWaitSyncAPPLE(sync, flags, timeout);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glWaitSyncAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glWaitSyncAPPLE *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->flags = flags;
+   thread_param->timeout = timeout;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glWaitSyncAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetInteger64vAPPLE(GLenum pname, EvasGLint64 *params);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   EvasGLint64 *params;
+
+} EVGL_API_Thread_Command_glGetInteger64vAPPLE;
+
+void (*orig_evgl_api_glGetInteger64vAPPLE)(GLenum pname, EvasGLint64 *params);
+
+static void
+_evgl_api_thread_glGetInteger64vAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glGetInteger64vAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glGetInteger64vAPPLE *)data;
+
+   orig_evgl_api_glGetInteger64vAPPLE(thread_param->pname,
+                                      thread_param->params);
+
+}
+
+EAPI void
+glGetInteger64vAPPLE_evgl_api_thread_cmd(GLenum pname, EvasGLint64 *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetInteger64vAPPLE(pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetInteger64vAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glGetInteger64vAPPLE *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetInteger64vAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetSyncivAPPLE(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+ */
+
+typedef struct
+{
+   GLsync sync;
+   GLenum pname;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLint *values;
+
+} EVGL_API_Thread_Command_glGetSyncivAPPLE;
+
+void (*orig_evgl_api_glGetSyncivAPPLE)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
+static void
+_evgl_api_thread_glGetSyncivAPPLE(void *data)
+{
+   EVGL_API_Thread_Command_glGetSyncivAPPLE *thread_param =
+      (EVGL_API_Thread_Command_glGetSyncivAPPLE *)data;
+
+   orig_evgl_api_glGetSyncivAPPLE(thread_param->sync,
+                                  thread_param->pname,
+                                  thread_param->bufSize,
+                                  thread_param->length,
+                                  thread_param->values);
+
+}
+
+EAPI void
+glGetSyncivAPPLE_evgl_api_thread_cmd(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetSyncivAPPLE(sync, pname, bufSize, length, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetSyncivAPPLE thread_param_local;
+   EVGL_API_Thread_Command_glGetSyncivAPPLE *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->pname = pname;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetSyncivAPPLE,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void *
+   glMapBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+ */
+
+typedef struct
+{
+   void * return_value;
+   GLenum target;
+   GLintptr offset;
+   GLsizeiptr length;
+   GLbitfield access;
+
+} EVGL_API_Thread_Command_glMapBufferRangeEXT;
+
+void * (*orig_evgl_api_glMapBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+
+static void
+_evgl_api_thread_glMapBufferRangeEXT(void *data)
+{
+   EVGL_API_Thread_Command_glMapBufferRangeEXT *thread_param =
+      (EVGL_API_Thread_Command_glMapBufferRangeEXT *)data;
+
+   thread_param->return_value = orig_evgl_api_glMapBufferRangeEXT(thread_param->target,
+                                                                  thread_param->offset,
+                                                                  thread_param->length,
+                                                                  thread_param->access);
+
+}
+
+EAPI void *
+glMapBufferRangeEXT_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glMapBufferRangeEXT(target, offset, length, access);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMapBufferRangeEXT thread_param_local;
+   EVGL_API_Thread_Command_glMapBufferRangeEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->offset = offset;
+   thread_param->length = length;
+   thread_param->access = access;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMapBufferRangeEXT,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glFlushMappedBufferRangeEXT(GLenum target, GLintptr offset, GLsizeiptr length);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLintptr offset;
+   GLsizeiptr length;
+
+} EVGL_API_Thread_Command_glFlushMappedBufferRangeEXT;
+
+void (*orig_evgl_api_glFlushMappedBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length);
+
+static void
+_evgl_api_thread_glFlushMappedBufferRangeEXT(void *data)
+{
+   EVGL_API_Thread_Command_glFlushMappedBufferRangeEXT *thread_param =
+      (EVGL_API_Thread_Command_glFlushMappedBufferRangeEXT *)data;
+
+   orig_evgl_api_glFlushMappedBufferRangeEXT(thread_param->target,
+                                             thread_param->offset,
+                                             thread_param->length);
+
+}
+
+EAPI void
+glFlushMappedBufferRangeEXT_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFlushMappedBufferRangeEXT(target, offset, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFlushMappedBufferRangeEXT thread_param_local;
+   EVGL_API_Thread_Command_glFlushMappedBufferRangeEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->offset = offset;
+   thread_param->length = length;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFlushMappedBufferRangeEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorageMultisampleEXT(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLsizei b;
+   GLenum c;
+   GLsizei d;
+   GLsizei e;
+
+} EVGL_API_Thread_Command_glRenderbufferStorageMultisampleEXT;
+
+void (*orig_evgl_api_glRenderbufferStorageMultisampleEXT)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+static void
+_evgl_api_thread_glRenderbufferStorageMultisampleEXT(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleEXT *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorageMultisampleEXT *)data;
+
+   orig_evgl_api_glRenderbufferStorageMultisampleEXT(thread_param->a,
+                                                     thread_param->b,
+                                                     thread_param->c,
+                                                     thread_param->d,
+                                                     thread_param->e);
+
+}
+
+EAPI void
+glRenderbufferStorageMultisampleEXT_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorageMultisampleEXT(a, b, c, d, e);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleEXT thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleEXT *thread_param = &thread_param_local;
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorageMultisampleEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2DMultisample(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLenum b;
+   GLenum c;
+   GLuint d;
+   GLint e;
+   GLsizei f;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferTexture2DMultisample;
+
+void (*orig_evgl_api_glFramebufferTexture2DMultisample)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+static void
+_evgl_api_thread_glFramebufferTexture2DMultisample(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisample *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture2DMultisample *)data;
+
+   orig_evgl_api_glFramebufferTexture2DMultisample(thread_param->a,
+                                                   thread_param->b,
+                                                   thread_param->c,
+                                                   thread_param->d,
+                                                   thread_param->e,
+                                                   thread_param->f);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2DMultisample_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture2DMultisample(a, b, c, d, e, f);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisample thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisample *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferTexture2DMultisample *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferTexture2DMultisample));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+   thread_param->f = f;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture2DMultisample,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2DMultisampleEXT(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLenum b;
+   GLenum c;
+   GLuint d;
+   GLint e;
+   GLsizei f;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT;
+
+void (*orig_evgl_api_glFramebufferTexture2DMultisampleEXT)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+static void
+_evgl_api_thread_glFramebufferTexture2DMultisampleEXT(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT *)data;
+
+   orig_evgl_api_glFramebufferTexture2DMultisampleEXT(thread_param->a,
+                                                      thread_param->b,
+                                                      thread_param->c,
+                                                      thread_param->d,
+                                                      thread_param->e,
+                                                      thread_param->f);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2DMultisampleEXT_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture2DMultisampleEXT(a, b, c, d, e, f);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleEXT));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+   thread_param->f = f;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture2DMultisampleEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glGetGraphicsResetStatus(void);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+
+} EVGL_API_Thread_Command_glGetGraphicsResetStatus;
+
+GLenum (*orig_evgl_api_glGetGraphicsResetStatus)(void);
+
+static void
+_evgl_api_thread_glGetGraphicsResetStatus(void *data)
+{
+   EVGL_API_Thread_Command_glGetGraphicsResetStatus *thread_param =
+      (EVGL_API_Thread_Command_glGetGraphicsResetStatus *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetGraphicsResetStatus();
+
+}
+
+EAPI GLenum
+glGetGraphicsResetStatus_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetGraphicsResetStatus();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetGraphicsResetStatus thread_param_local;
+   EVGL_API_Thread_Command_glGetGraphicsResetStatus *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetGraphicsResetStatus,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLenum
+   glGetGraphicsResetStatusEXT(void);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+
+} EVGL_API_Thread_Command_glGetGraphicsResetStatusEXT;
+
+GLenum (*orig_evgl_api_glGetGraphicsResetStatusEXT)(void);
+
+static void
+_evgl_api_thread_glGetGraphicsResetStatusEXT(void *data)
+{
+   EVGL_API_Thread_Command_glGetGraphicsResetStatusEXT *thread_param =
+      (EVGL_API_Thread_Command_glGetGraphicsResetStatusEXT *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetGraphicsResetStatusEXT();
+
+}
+
+EAPI GLenum
+glGetGraphicsResetStatusEXT_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetGraphicsResetStatusEXT();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetGraphicsResetStatusEXT thread_param_local;
+   EVGL_API_Thread_Command_glGetGraphicsResetStatusEXT *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetGraphicsResetStatusEXT,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glReadnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   GLsizei bufSize;
+   void *data;
+
+} EVGL_API_Thread_Command_glReadnPixels;
+
+void (*orig_evgl_api_glReadnPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+
+static void
+_evgl_api_thread_glReadnPixels(void *data)
+{
+   EVGL_API_Thread_Command_glReadnPixels *thread_param =
+      (EVGL_API_Thread_Command_glReadnPixels *)data;
+
+   orig_evgl_api_glReadnPixels(thread_param->x,
+                               thread_param->y,
+                               thread_param->width,
+                               thread_param->height,
+                               thread_param->format,
+                               thread_param->type,
+                               thread_param->bufSize,
+                               thread_param->data);
+
+}
+
+EAPI void
+glReadnPixels_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glReadnPixels(x, y, width, height, format, type, bufSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glReadnPixels thread_param_local;
+   EVGL_API_Thread_Command_glReadnPixels *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->bufSize = bufSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glReadnPixels,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   GLsizei bufSize;
+   void *data;
+
+} EVGL_API_Thread_Command_glReadnPixelsEXT;
+
+void (*orig_evgl_api_glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+
+static void
+_evgl_api_thread_glReadnPixelsEXT(void *data)
+{
+   EVGL_API_Thread_Command_glReadnPixelsEXT *thread_param =
+      (EVGL_API_Thread_Command_glReadnPixelsEXT *)data;
+
+   orig_evgl_api_glReadnPixelsEXT(thread_param->x,
+                                  thread_param->y,
+                                  thread_param->width,
+                                  thread_param->height,
+                                  thread_param->format,
+                                  thread_param->type,
+                                  thread_param->bufSize,
+                                  thread_param->data);
+
+}
+
+EAPI void
+glReadnPixelsEXT_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glReadnPixelsEXT thread_param_local;
+   EVGL_API_Thread_Command_glReadnPixelsEXT *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->bufSize = bufSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glReadnPixelsEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetnUniformfv(GLuint program, GLint location, GLsizei bufSize, float *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei bufSize;
+   float *params;
+
+} EVGL_API_Thread_Command_glGetnUniformfv;
+
+void (*orig_evgl_api_glGetnUniformfv)(GLuint program, GLint location, GLsizei bufSize, float *params);
+
+static void
+_evgl_api_thread_glGetnUniformfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetnUniformfv *thread_param =
+      (EVGL_API_Thread_Command_glGetnUniformfv *)data;
+
+   orig_evgl_api_glGetnUniformfv(thread_param->program,
+                                 thread_param->location,
+                                 thread_param->bufSize,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetnUniformfv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, float *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetnUniformfv(program, location, bufSize, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetnUniformfv thread_param_local;
+   EVGL_API_Thread_Command_glGetnUniformfv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->bufSize = bufSize;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetnUniformfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei bufSize;
+   float *params;
+
+} EVGL_API_Thread_Command_glGetnUniformfvEXT;
+
+void (*orig_evgl_api_glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params);
+
+static void
+_evgl_api_thread_glGetnUniformfvEXT(void *data)
+{
+   EVGL_API_Thread_Command_glGetnUniformfvEXT *thread_param =
+      (EVGL_API_Thread_Command_glGetnUniformfvEXT *)data;
+
+   orig_evgl_api_glGetnUniformfvEXT(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->bufSize,
+                                    thread_param->params);
+
+}
+
+EAPI void
+glGetnUniformfvEXT_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, float *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetnUniformfvEXT(program, location, bufSize, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetnUniformfvEXT thread_param_local;
+   EVGL_API_Thread_Command_glGetnUniformfvEXT *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->bufSize = bufSize;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetnUniformfvEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetnUniformiv(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei bufSize;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetnUniformiv;
+
+void (*orig_evgl_api_glGetnUniformiv)(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+
+static void
+_evgl_api_thread_glGetnUniformiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetnUniformiv *thread_param =
+      (EVGL_API_Thread_Command_glGetnUniformiv *)data;
+
+   orig_evgl_api_glGetnUniformiv(thread_param->program,
+                                 thread_param->location,
+                                 thread_param->bufSize,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetnUniformiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetnUniformiv(program, location, bufSize, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetnUniformiv thread_param_local;
+   EVGL_API_Thread_Command_glGetnUniformiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->bufSize = bufSize;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetnUniformiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei bufSize;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetnUniformivEXT;
+
+void (*orig_evgl_api_glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+
+static void
+_evgl_api_thread_glGetnUniformivEXT(void *data)
+{
+   EVGL_API_Thread_Command_glGetnUniformivEXT *thread_param =
+      (EVGL_API_Thread_Command_glGetnUniformivEXT *)data;
+
+   orig_evgl_api_glGetnUniformivEXT(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->bufSize,
+                                    thread_param->params);
+
+}
+
+EAPI void
+glGetnUniformivEXT_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetnUniformivEXT(program, location, bufSize, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetnUniformivEXT thread_param_local;
+   EVGL_API_Thread_Command_glGetnUniformivEXT *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->bufSize = bufSize;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetnUniformivEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+
+} EVGL_API_Thread_Command_glTexStorage1DEXT;
+
+void (*orig_evgl_api_glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+
+static void
+_evgl_api_thread_glTexStorage1DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage1DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage1DEXT *)data;
+
+   orig_evgl_api_glTexStorage1DEXT(thread_param->target,
+                                   thread_param->levels,
+                                   thread_param->internalformat,
+                                   thread_param->width);
+
+}
+
+EAPI void
+glTexStorage1DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage1DEXT(target, levels, internalformat, width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage1DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage1DEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage1DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glTexStorage2DEXT;
+
+void (*orig_evgl_api_glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glTexStorage2DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage2DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage2DEXT *)data;
+
+   orig_evgl_api_glTexStorage2DEXT(thread_param->target,
+                                   thread_param->levels,
+                                   thread_param->internalformat,
+                                   thread_param->width,
+                                   thread_param->height);
+
+}
+
+EAPI void
+glTexStorage2DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage2DEXT(target, levels, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage2DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage2DEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage2DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+
+} EVGL_API_Thread_Command_glTexStorage3DEXT;
+
+void (*orig_evgl_api_glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+static void
+_evgl_api_thread_glTexStorage3DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage3DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage3DEXT *)data;
+
+   orig_evgl_api_glTexStorage3DEXT(thread_param->target,
+                                   thread_param->levels,
+                                   thread_param->internalformat,
+                                   thread_param->width,
+                                   thread_param->height,
+                                   thread_param->depth);
+
+}
+
+EAPI void
+glTexStorage3DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage3DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage3DEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage3DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ */
+
+typedef struct
+{
+   GLuint texture;
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+
+} EVGL_API_Thread_Command_glTextureStorage1DEXT;
+
+void (*orig_evgl_api_glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+
+static void
+_evgl_api_thread_glTextureStorage1DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTextureStorage1DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTextureStorage1DEXT *)data;
+
+   orig_evgl_api_glTextureStorage1DEXT(thread_param->texture,
+                                       thread_param->target,
+                                       thread_param->levels,
+                                       thread_param->internalformat,
+                                       thread_param->width);
+
+}
+
+EAPI void
+glTextureStorage1DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTextureStorage1DEXT(texture, target, levels, internalformat, width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTextureStorage1DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTextureStorage1DEXT *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTextureStorage1DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLuint texture;
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glTextureStorage2DEXT;
+
+void (*orig_evgl_api_glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glTextureStorage2DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTextureStorage2DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTextureStorage2DEXT *)data;
+
+   orig_evgl_api_glTextureStorage2DEXT(thread_param->texture,
+                                       thread_param->target,
+                                       thread_param->levels,
+                                       thread_param->internalformat,
+                                       thread_param->width,
+                                       thread_param->height);
+
+}
+
+EAPI void
+glTextureStorage2DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTextureStorage2DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTextureStorage2DEXT *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTextureStorage2DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ */
+
+typedef struct
+{
+   GLuint texture;
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+
+} EVGL_API_Thread_Command_glTextureStorage3DEXT;
+
+void (*orig_evgl_api_glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+static void
+_evgl_api_thread_glTextureStorage3DEXT(void *data)
+{
+   EVGL_API_Thread_Command_glTextureStorage3DEXT *thread_param =
+      (EVGL_API_Thread_Command_glTextureStorage3DEXT *)data;
+
+   orig_evgl_api_glTextureStorage3DEXT(thread_param->texture,
+                                       thread_param->target,
+                                       thread_param->levels,
+                                       thread_param->internalformat,
+                                       thread_param->width,
+                                       thread_param->height,
+                                       thread_param->depth);
+
+}
+
+EAPI void
+glTextureStorage3DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTextureStorage3DEXT thread_param_local;
+   EVGL_API_Thread_Command_glTextureStorage3DEXT *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTextureStorage3DEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanefIMG(GLenum a, const GLfloat * b);
+ */
+
+typedef struct
+{
+   GLenum a;
+   const GLfloat * b;
+
+} EVGL_API_Thread_Command_glClipPlanefIMG;
+
+void (*orig_evgl_api_glClipPlanefIMG)(GLenum a, const GLfloat * b);
+
+static void
+_evgl_api_thread_glClipPlanefIMG(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanefIMG *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanefIMG *)data;
+
+   orig_evgl_api_glClipPlanefIMG(thread_param->a,
+                                 thread_param->b);
+
+}
+
+EAPI void
+glClipPlanefIMG_evgl_api_thread_cmd(GLenum a, const GLfloat * b)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanefIMG(a, b);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanefIMG thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanefIMG *thread_param = &thread_param_local;
+
+   thread_param->a = a;
+   thread_param->b = b;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanefIMG,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClipPlanexIMG(GLenum a, const GLfixed * b);
+ */
+
+typedef struct
+{
+   GLenum a;
+   const GLfixed * b;
+
+} EVGL_API_Thread_Command_glClipPlanexIMG;
+
+void (*orig_evgl_api_glClipPlanexIMG)(GLenum a, const GLfixed * b);
+
+static void
+_evgl_api_thread_glClipPlanexIMG(void *data)
+{
+   EVGL_API_Thread_Command_glClipPlanexIMG *thread_param =
+      (EVGL_API_Thread_Command_glClipPlanexIMG *)data;
+
+   orig_evgl_api_glClipPlanexIMG(thread_param->a,
+                                 thread_param->b);
+
+}
+
+EAPI void
+glClipPlanexIMG_evgl_api_thread_cmd(GLenum a, const GLfixed * b)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClipPlanexIMG(a, b);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClipPlanexIMG thread_param_local;
+   EVGL_API_Thread_Command_glClipPlanexIMG *thread_param = &thread_param_local;
+
+   thread_param->a = a;
+   thread_param->b = b;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClipPlanexIMG,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorageMultisampleIMG(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLsizei b;
+   GLenum c;
+   GLsizei d;
+   GLsizei e;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG;
+
+void (*orig_evgl_api_glRenderbufferStorageMultisampleIMG)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+static void
+_evgl_api_thread_glRenderbufferStorageMultisampleIMG(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG *)data;
+
+   orig_evgl_api_glRenderbufferStorageMultisampleIMG(thread_param->a,
+                                                     thread_param->b,
+                                                     thread_param->c,
+                                                     thread_param->d,
+                                                     thread_param->e);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glRenderbufferStorageMultisampleIMG_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorageMultisampleIMG(a, b, c, d, e);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glRenderbufferStorageMultisampleIMG));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorageMultisampleIMG,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2DMultisampleIMG(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+ */
+
+typedef struct
+{
+   GLenum a;
+   GLenum b;
+   GLenum c;
+   GLuint d;
+   GLint e;
+   GLsizei f;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG;
+
+void (*orig_evgl_api_glFramebufferTexture2DMultisampleIMG)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+static void
+_evgl_api_thread_glFramebufferTexture2DMultisampleIMG(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG *)data;
+
+   orig_evgl_api_glFramebufferTexture2DMultisampleIMG(thread_param->a,
+                                                      thread_param->b,
+                                                      thread_param->c,
+                                                      thread_param->d,
+                                                      thread_param->e,
+                                                      thread_param->f);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2DMultisampleIMG_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTexture2DMultisampleIMG(a, b, c, d, e, f);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glFramebufferTexture2DMultisampleIMG));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+   thread_param->f = f;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTexture2DMultisampleIMG,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+ */
+
+typedef struct
+{
+   GLuint x;
+   GLuint y;
+   GLuint width;
+   GLuint height;
+   GLbitfield preserveMask;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glStartTilingQCOM;
+
+void (*orig_evgl_api_glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+
+static void
+_evgl_api_thread_glStartTilingQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glStartTilingQCOM *thread_param =
+      (EVGL_API_Thread_Command_glStartTilingQCOM *)data;
+
+   orig_evgl_api_glStartTilingQCOM(thread_param->x,
+                                   thread_param->y,
+                                   thread_param->width,
+                                   thread_param->height,
+                                   thread_param->preserveMask);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glStartTilingQCOM_evgl_api_thread_cmd(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glStartTilingQCOM(x, y, width, height, preserveMask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glStartTilingQCOM thread_param_local;
+   EVGL_API_Thread_Command_glStartTilingQCOM *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glStartTilingQCOM *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glStartTilingQCOM));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->preserveMask = preserveMask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glStartTilingQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEndTilingQCOM(GLbitfield preserveMask);
+ */
+
+typedef struct
+{
+   GLbitfield preserveMask;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glEndTilingQCOM;
+
+void (*orig_evgl_api_glEndTilingQCOM)(GLbitfield preserveMask);
+
+static void
+_evgl_api_thread_glEndTilingQCOM(void *data)
+{
+   EVGL_API_Thread_Command_glEndTilingQCOM *thread_param =
+      (EVGL_API_Thread_Command_glEndTilingQCOM *)data;
+
+   orig_evgl_api_glEndTilingQCOM(thread_param->preserveMask);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEndTilingQCOM_evgl_api_thread_cmd(GLbitfield preserveMask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEndTilingQCOM(preserveMask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEndTilingQCOM thread_param_local;
+   EVGL_API_Thread_Command_glEndTilingQCOM *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glEndTilingQCOM *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glEndTilingQCOM));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->preserveMask = preserveMask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEndTilingQCOM,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBeginQuery(GLenum target, GLuint id);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint id;
+
+} EVGL_API_Thread_Command_glBeginQuery;
+
+void (*orig_evgl_api_glBeginQuery)(GLenum target, GLuint id);
+
+static void
+_evgl_api_thread_glBeginQuery(void *data)
+{
+   EVGL_API_Thread_Command_glBeginQuery *thread_param =
+      (EVGL_API_Thread_Command_glBeginQuery *)data;
+
+   orig_evgl_api_glBeginQuery(thread_param->target,
+                              thread_param->id);
+
+}
+
+EAPI void
+glBeginQuery_evgl_api_thread_cmd(GLenum target, GLuint id)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBeginQuery(target, id);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBeginQuery thread_param_local;
+   EVGL_API_Thread_Command_glBeginQuery *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->id = id;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBeginQuery,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBeginTransformFeedback(GLenum primitiveMode);
+ */
+
+typedef struct
+{
+   GLenum primitiveMode;
+
+} EVGL_API_Thread_Command_glBeginTransformFeedback;
+
+void (*orig_evgl_api_glBeginTransformFeedback)(GLenum primitiveMode);
+
+static void
+_evgl_api_thread_glBeginTransformFeedback(void *data)
+{
+   EVGL_API_Thread_Command_glBeginTransformFeedback *thread_param =
+      (EVGL_API_Thread_Command_glBeginTransformFeedback *)data;
+
+   orig_evgl_api_glBeginTransformFeedback(thread_param->primitiveMode);
+
+}
+
+EAPI void
+glBeginTransformFeedback_evgl_api_thread_cmd(GLenum primitiveMode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBeginTransformFeedback(primitiveMode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBeginTransformFeedback thread_param_local;
+   EVGL_API_Thread_Command_glBeginTransformFeedback *thread_param = &thread_param_local;
+
+   thread_param->primitiveMode = primitiveMode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBeginTransformFeedback,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint index;
+   GLuint buffer;
+
+} EVGL_API_Thread_Command_glBindBufferBase;
+
+void (*orig_evgl_api_glBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
+
+static void
+_evgl_api_thread_glBindBufferBase(void *data)
+{
+   EVGL_API_Thread_Command_glBindBufferBase *thread_param =
+      (EVGL_API_Thread_Command_glBindBufferBase *)data;
+
+   orig_evgl_api_glBindBufferBase(thread_param->target,
+                                  thread_param->index,
+                                  thread_param->buffer);
+
+}
+
+EAPI void
+glBindBufferBase_evgl_api_thread_cmd(GLenum target, GLuint index, GLuint buffer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindBufferBase(target, index, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindBufferBase thread_param_local;
+   EVGL_API_Thread_Command_glBindBufferBase *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->index = index;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindBufferBase,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint index;
+   GLuint buffer;
+   GLintptr offset;
+   GLsizeiptr size;
+
+} EVGL_API_Thread_Command_glBindBufferRange;
+
+void (*orig_evgl_api_glBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+static void
+_evgl_api_thread_glBindBufferRange(void *data)
+{
+   EVGL_API_Thread_Command_glBindBufferRange *thread_param =
+      (EVGL_API_Thread_Command_glBindBufferRange *)data;
+
+   orig_evgl_api_glBindBufferRange(thread_param->target,
+                                   thread_param->index,
+                                   thread_param->buffer,
+                                   thread_param->offset,
+                                   thread_param->size);
+
+}
+
+EAPI void
+glBindBufferRange_evgl_api_thread_cmd(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindBufferRange(target, index, buffer, offset, size);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindBufferRange thread_param_local;
+   EVGL_API_Thread_Command_glBindBufferRange *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->index = index;
+   thread_param->buffer = buffer;
+   thread_param->offset = offset;
+   thread_param->size = size;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindBufferRange,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindSampler(GLuint unit, GLuint sampler);
+ */
+
+typedef struct
+{
+   GLuint unit;
+   GLuint sampler;
+
+} EVGL_API_Thread_Command_glBindSampler;
+
+void (*orig_evgl_api_glBindSampler)(GLuint unit, GLuint sampler);
+
+static void
+_evgl_api_thread_glBindSampler(void *data)
+{
+   EVGL_API_Thread_Command_glBindSampler *thread_param =
+      (EVGL_API_Thread_Command_glBindSampler *)data;
+
+   orig_evgl_api_glBindSampler(thread_param->unit,
+                               thread_param->sampler);
+
+}
+
+EAPI void
+glBindSampler_evgl_api_thread_cmd(GLuint unit, GLuint sampler)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindSampler(unit, sampler);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindSampler thread_param_local;
+   EVGL_API_Thread_Command_glBindSampler *thread_param = &thread_param_local;
+
+   thread_param->unit = unit;
+   thread_param->sampler = sampler;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindSampler,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindTransformFeedback(GLenum target, GLuint id);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint id;
+
+} EVGL_API_Thread_Command_glBindTransformFeedback;
+
+void (*orig_evgl_api_glBindTransformFeedback)(GLenum target, GLuint id);
+
+static void
+_evgl_api_thread_glBindTransformFeedback(void *data)
+{
+   EVGL_API_Thread_Command_glBindTransformFeedback *thread_param =
+      (EVGL_API_Thread_Command_glBindTransformFeedback *)data;
+
+   orig_evgl_api_glBindTransformFeedback(thread_param->target,
+                                         thread_param->id);
+
+}
+
+EAPI void
+glBindTransformFeedback_evgl_api_thread_cmd(GLenum target, GLuint id)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindTransformFeedback(target, id);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindTransformFeedback thread_param_local;
+   EVGL_API_Thread_Command_glBindTransformFeedback *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->id = id;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindTransformFeedback,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindVertexArray(GLuint array);
+ */
+
+typedef struct
+{
+   GLuint array;
+
+} EVGL_API_Thread_Command_glBindVertexArray;
+
+void (*orig_evgl_api_glBindVertexArray)(GLuint array);
+
+static void
+_evgl_api_thread_glBindVertexArray(void *data)
+{
+   EVGL_API_Thread_Command_glBindVertexArray *thread_param =
+      (EVGL_API_Thread_Command_glBindVertexArray *)data;
+
+   orig_evgl_api_glBindVertexArray(thread_param->array);
+
+}
+
+EAPI void
+glBindVertexArray_evgl_api_thread_cmd(GLuint array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindVertexArray(array);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindVertexArray thread_param_local;
+   EVGL_API_Thread_Command_glBindVertexArray *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindVertexArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ */
+
+typedef struct
+{
+   GLint srcX0;
+   GLint srcY0;
+   GLint srcX1;
+   GLint srcY1;
+   GLint dstX0;
+   GLint dstY0;
+   GLint dstX1;
+   GLint dstY1;
+   GLbitfield mask;
+   GLenum filter;
+
+} EVGL_API_Thread_Command_glBlitFramebuffer;
+
+void (*orig_evgl_api_glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+static void
+_evgl_api_thread_glBlitFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glBlitFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glBlitFramebuffer *)data;
+
+   orig_evgl_api_glBlitFramebuffer(thread_param->srcX0,
+                                   thread_param->srcY0,
+                                   thread_param->srcX1,
+                                   thread_param->srcY1,
+                                   thread_param->dstX0,
+                                   thread_param->dstY0,
+                                   thread_param->dstX1,
+                                   thread_param->dstY1,
+                                   thread_param->mask,
+                                   thread_param->filter);
+
+}
+
+EAPI void
+glBlitFramebuffer_evgl_api_thread_cmd(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBlitFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glBlitFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->srcX0 = srcX0;
+   thread_param->srcY0 = srcY0;
+   thread_param->srcX1 = srcX1;
+   thread_param->srcY1 = srcY1;
+   thread_param->dstX0 = dstX0;
+   thread_param->dstY0 = dstY0;
+   thread_param->dstX1 = dstX1;
+   thread_param->dstY1 = dstY1;
+   thread_param->mask = mask;
+   thread_param->filter = filter;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBlitFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
+ */
+
+typedef struct
+{
+   GLenum buffer;
+   GLint drawBuffer;
+   GLfloat depth;
+   GLint stencil;
+
+} EVGL_API_Thread_Command_glClearBufferfi;
+
+void (*orig_evgl_api_glClearBufferfi)(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
+
+static void
+_evgl_api_thread_glClearBufferfi(void *data)
+{
+   EVGL_API_Thread_Command_glClearBufferfi *thread_param =
+      (EVGL_API_Thread_Command_glClearBufferfi *)data;
+
+   orig_evgl_api_glClearBufferfi(thread_param->buffer,
+                                 thread_param->drawBuffer,
+                                 thread_param->depth,
+                                 thread_param->stencil);
+
+}
+
+EAPI void
+glClearBufferfi_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearBufferfi(buffer, drawBuffer, depth, stencil);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearBufferfi thread_param_local;
+   EVGL_API_Thread_Command_glClearBufferfi *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+   thread_param->drawBuffer = drawBuffer;
+   thread_param->depth = depth;
+   thread_param->stencil = stencil;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearBufferfi,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat * value);
+ */
+
+typedef struct
+{
+   GLenum buffer;
+   GLint drawBuffer;
+   const GLfloat * value;
+
+} EVGL_API_Thread_Command_glClearBufferfv;
+
+void (*orig_evgl_api_glClearBufferfv)(GLenum buffer, GLint drawBuffer, const GLfloat * value);
+
+static void
+_evgl_api_thread_glClearBufferfv(void *data)
+{
+   EVGL_API_Thread_Command_glClearBufferfv *thread_param =
+      (EVGL_API_Thread_Command_glClearBufferfv *)data;
+
+   orig_evgl_api_glClearBufferfv(thread_param->buffer,
+                                 thread_param->drawBuffer,
+                                 thread_param->value);
+
+}
+
+EAPI void
+glClearBufferfv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLfloat * value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearBufferfv(buffer, drawBuffer, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearBufferfv thread_param_local;
+   EVGL_API_Thread_Command_glClearBufferfv *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+   thread_param->drawBuffer = drawBuffer;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearBufferfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint * value);
+ */
+
+typedef struct
+{
+   GLenum buffer;
+   GLint drawBuffer;
+   const GLint * value;
+
+} EVGL_API_Thread_Command_glClearBufferiv;
+
+void (*orig_evgl_api_glClearBufferiv)(GLenum buffer, GLint drawBuffer, const GLint * value);
+
+static void
+_evgl_api_thread_glClearBufferiv(void *data)
+{
+   EVGL_API_Thread_Command_glClearBufferiv *thread_param =
+      (EVGL_API_Thread_Command_glClearBufferiv *)data;
+
+   orig_evgl_api_glClearBufferiv(thread_param->buffer,
+                                 thread_param->drawBuffer,
+                                 thread_param->value);
+
+}
+
+EAPI void
+glClearBufferiv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLint * value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearBufferiv(buffer, drawBuffer, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearBufferiv thread_param_local;
+   EVGL_API_Thread_Command_glClearBufferiv *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+   thread_param->drawBuffer = drawBuffer;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearBufferiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint * value);
+ */
+
+typedef struct
+{
+   GLenum buffer;
+   GLint drawBuffer;
+   const GLuint * value;
+
+} EVGL_API_Thread_Command_glClearBufferuiv;
+
+void (*orig_evgl_api_glClearBufferuiv)(GLenum buffer, GLint drawBuffer, const GLuint * value);
+
+static void
+_evgl_api_thread_glClearBufferuiv(void *data)
+{
+   EVGL_API_Thread_Command_glClearBufferuiv *thread_param =
+      (EVGL_API_Thread_Command_glClearBufferuiv *)data;
+
+   orig_evgl_api_glClearBufferuiv(thread_param->buffer,
+                                  thread_param->drawBuffer,
+                                  thread_param->value);
+
+}
+
+EAPI void
+glClearBufferuiv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLuint * value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glClearBufferuiv(buffer, drawBuffer, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClearBufferuiv thread_param_local;
+   EVGL_API_Thread_Command_glClearBufferuiv *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+   thread_param->drawBuffer = drawBuffer;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClearBufferuiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glClientWaitSync(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLsync sync;
+   GLbitfield flags;
+   EvasGLuint64 timeout;
+
+} EVGL_API_Thread_Command_glClientWaitSync;
+
+GLenum (*orig_evgl_api_glClientWaitSync)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+static void
+_evgl_api_thread_glClientWaitSync(void *data)
+{
+   EVGL_API_Thread_Command_glClientWaitSync *thread_param =
+      (EVGL_API_Thread_Command_glClientWaitSync *)data;
+
+   thread_param->return_value = orig_evgl_api_glClientWaitSync(thread_param->sync,
+                                                               thread_param->flags,
+                                                               thread_param->timeout);
+
+}
+
+EAPI GLenum
+glClientWaitSync_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glClientWaitSync(sync, flags, timeout);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glClientWaitSync thread_param_local;
+   EVGL_API_Thread_Command_glClientWaitSync *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->flags = flags;
+   thread_param->timeout = timeout;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glClientWaitSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLint border;
+   GLsizei imageSize;
+   const GLvoid * data;
+
+} EVGL_API_Thread_Command_glCompressedTexImage3D;
+
+void (*orig_evgl_api_glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
+
+static void
+_evgl_api_thread_glCompressedTexImage3D(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexImage3D *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexImage3D *)data;
+
+   orig_evgl_api_glCompressedTexImage3D(thread_param->target,
+                                        thread_param->level,
+                                        thread_param->internalformat,
+                                        thread_param->width,
+                                        thread_param->height,
+                                        thread_param->depth,
+                                        thread_param->border,
+                                        thread_param->imageSize,
+                                        thread_param->data);
+
+}
+
+EAPI void
+glCompressedTexImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexImage3D thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexImage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->border = border;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexImage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLenum format;
+   GLsizei imageSize;
+   const GLvoid * data;
+
+} EVGL_API_Thread_Command_glCompressedTexSubImage3D;
+
+void (*orig_evgl_api_glCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
+
+static void
+_evgl_api_thread_glCompressedTexSubImage3D(void *data)
+{
+   EVGL_API_Thread_Command_glCompressedTexSubImage3D *thread_param =
+      (EVGL_API_Thread_Command_glCompressedTexSubImage3D *)data;
+
+   orig_evgl_api_glCompressedTexSubImage3D(thread_param->target,
+                                           thread_param->level,
+                                           thread_param->xoffset,
+                                           thread_param->yoffset,
+                                           thread_param->zoffset,
+                                           thread_param->width,
+                                           thread_param->height,
+                                           thread_param->depth,
+                                           thread_param->format,
+                                           thread_param->imageSize,
+                                           thread_param->data);
+
+}
+
+EAPI void
+glCompressedTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCompressedTexSubImage3D thread_param_local;
+   EVGL_API_Thread_Command_glCompressedTexSubImage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->format = format;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCompressedTexSubImage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+ */
+
+typedef struct
+{
+   GLenum readtarget;
+   GLenum writetarget;
+   GLintptr readoffset;
+   GLintptr writeoffset;
+   GLsizeiptr size;
+
+} EVGL_API_Thread_Command_glCopyBufferSubData;
+
+void (*orig_evgl_api_glCopyBufferSubData)(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+
+static void
+_evgl_api_thread_glCopyBufferSubData(void *data)
+{
+   EVGL_API_Thread_Command_glCopyBufferSubData *thread_param =
+      (EVGL_API_Thread_Command_glCopyBufferSubData *)data;
+
+   orig_evgl_api_glCopyBufferSubData(thread_param->readtarget,
+                                     thread_param->writetarget,
+                                     thread_param->readoffset,
+                                     thread_param->writeoffset,
+                                     thread_param->size);
+
+}
+
+EAPI void
+glCopyBufferSubData_evgl_api_thread_cmd(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyBufferSubData(readtarget, writetarget, readoffset, writeoffset, size);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyBufferSubData thread_param_local;
+   EVGL_API_Thread_Command_glCopyBufferSubData *thread_param = &thread_param_local;
+
+   thread_param->readtarget = readtarget;
+   thread_param->writetarget = writetarget;
+   thread_param->readoffset = readoffset;
+   thread_param->writeoffset = writeoffset;
+   thread_param->size = size;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyBufferSubData,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glCopyTexSubImage3D;
+
+void (*orig_evgl_api_glCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glCopyTexSubImage3D(void *data)
+{
+   EVGL_API_Thread_Command_glCopyTexSubImage3D *thread_param =
+      (EVGL_API_Thread_Command_glCopyTexSubImage3D *)data;
+
+   orig_evgl_api_glCopyTexSubImage3D(thread_param->target,
+                                     thread_param->level,
+                                     thread_param->xoffset,
+                                     thread_param->yoffset,
+                                     thread_param->zoffset,
+                                     thread_param->x,
+                                     thread_param->y,
+                                     thread_param->width,
+                                     thread_param->height);
+
+}
+
+EAPI void
+glCopyTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCopyTexSubImage3D thread_param_local;
+   EVGL_API_Thread_Command_glCopyTexSubImage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCopyTexSubImage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteQueries(GLsizei n, const GLuint * ids);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint * ids;
+
+} EVGL_API_Thread_Command_glDeleteQueries;
+
+void (*orig_evgl_api_glDeleteQueries)(GLsizei n, const GLuint * ids);
+
+static void
+_evgl_api_thread_glDeleteQueries(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteQueries *thread_param =
+      (EVGL_API_Thread_Command_glDeleteQueries *)data;
+
+   orig_evgl_api_glDeleteQueries(thread_param->n,
+                                 thread_param->ids);
+
+}
+
+EAPI void
+glDeleteQueries_evgl_api_thread_cmd(GLsizei n, const GLuint * ids)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteQueries(n, ids);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteQueries thread_param_local;
+   EVGL_API_Thread_Command_glDeleteQueries *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->ids = ids;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteQueries,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteSamplers(GLsizei n, const GLuint * samplers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint * samplers;
+
+} EVGL_API_Thread_Command_glDeleteSamplers;
+
+void (*orig_evgl_api_glDeleteSamplers)(GLsizei n, const GLuint * samplers);
+
+static void
+_evgl_api_thread_glDeleteSamplers(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteSamplers *thread_param =
+      (EVGL_API_Thread_Command_glDeleteSamplers *)data;
+
+   orig_evgl_api_glDeleteSamplers(thread_param->n,
+                                  thread_param->samplers);
+
+}
+
+EAPI void
+glDeleteSamplers_evgl_api_thread_cmd(GLsizei n, const GLuint * samplers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteSamplers(n, samplers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteSamplers thread_param_local;
+   EVGL_API_Thread_Command_glDeleteSamplers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->samplers = samplers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteSamplers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteSync(GLsync sync);
+ */
+
+typedef struct
+{
+   GLsync sync;
+
+} EVGL_API_Thread_Command_glDeleteSync;
+
+void (*orig_evgl_api_glDeleteSync)(GLsync sync);
+
+static void
+_evgl_api_thread_glDeleteSync(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteSync *thread_param =
+      (EVGL_API_Thread_Command_glDeleteSync *)data;
+
+   orig_evgl_api_glDeleteSync(thread_param->sync);
+
+}
+
+EAPI void
+glDeleteSync_evgl_api_thread_cmd(GLsync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteSync(sync);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteSync thread_param_local;
+   EVGL_API_Thread_Command_glDeleteSync *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteSync,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteTransformFeedbacks(GLsizei n, const GLuint *ids);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *ids;
+
+} EVGL_API_Thread_Command_glDeleteTransformFeedbacks;
+
+void (*orig_evgl_api_glDeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
+
+static void
+_evgl_api_thread_glDeleteTransformFeedbacks(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteTransformFeedbacks *thread_param =
+      (EVGL_API_Thread_Command_glDeleteTransformFeedbacks *)data;
+
+   orig_evgl_api_glDeleteTransformFeedbacks(thread_param->n,
+                                            thread_param->ids);
+
+}
+
+EAPI void
+glDeleteTransformFeedbacks_evgl_api_thread_cmd(GLsizei n, const GLuint *ids)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteTransformFeedbacks(n, ids);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteTransformFeedbacks thread_param_local;
+   EVGL_API_Thread_Command_glDeleteTransformFeedbacks *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->ids = ids;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteTransformFeedbacks,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *arrays;
+
+} EVGL_API_Thread_Command_glDeleteVertexArrays;
+
+void (*orig_evgl_api_glDeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+
+static void
+_evgl_api_thread_glDeleteVertexArrays(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteVertexArrays *thread_param =
+      (EVGL_API_Thread_Command_glDeleteVertexArrays *)data;
+
+   orig_evgl_api_glDeleteVertexArrays(thread_param->n,
+                                      thread_param->arrays);
+
+}
+
+EAPI void
+glDeleteVertexArrays_evgl_api_thread_cmd(GLsizei n, const GLuint *arrays)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteVertexArrays(n, arrays);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteVertexArrays thread_param_local;
+   EVGL_API_Thread_Command_glDeleteVertexArrays *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->arrays = arrays;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteVertexArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint first;
+   GLsizei count;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glDrawArraysInstanced;
+
+void (*orig_evgl_api_glDrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+
+static void
+_evgl_api_thread_glDrawArraysInstanced(void *data)
+{
+   EVGL_API_Thread_Command_glDrawArraysInstanced *thread_param =
+      (EVGL_API_Thread_Command_glDrawArraysInstanced *)data;
+
+   orig_evgl_api_glDrawArraysInstanced(thread_param->mode,
+                                       thread_param->first,
+                                       thread_param->count,
+                                       thread_param->primcount);
+
+}
+
+EAPI void
+glDrawArraysInstanced_evgl_api_thread_cmd(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawArraysInstanced(mode, first, count, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawArraysInstanced thread_param_local;
+   EVGL_API_Thread_Command_glDrawArraysInstanced *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawArraysInstanced,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawBuffers(GLsizei n, const GLenum *bufs);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLenum *bufs;
+
+} EVGL_API_Thread_Command_glDrawBuffers;
+
+void (*orig_evgl_api_glDrawBuffers)(GLsizei n, const GLenum *bufs);
+
+static void
+_evgl_api_thread_glDrawBuffers(void *data)
+{
+   EVGL_API_Thread_Command_glDrawBuffers *thread_param =
+      (EVGL_API_Thread_Command_glDrawBuffers *)data;
+
+   orig_evgl_api_glDrawBuffers(thread_param->n,
+                               thread_param->bufs);
+
+}
+
+EAPI void
+glDrawBuffers_evgl_api_thread_cmd(GLsizei n, const GLenum *bufs)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawBuffers(n, bufs);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawBuffers thread_param_local;
+   EVGL_API_Thread_Command_glDrawBuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->bufs = bufs;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLsizei count;
+   GLenum type;
+   const void * indices;
+   GLsizei primcount;
+
+} EVGL_API_Thread_Command_glDrawElementsInstanced;
+
+void (*orig_evgl_api_glDrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+
+static void
+_evgl_api_thread_glDrawElementsInstanced(void *data)
+{
+   EVGL_API_Thread_Command_glDrawElementsInstanced *thread_param =
+      (EVGL_API_Thread_Command_glDrawElementsInstanced *)data;
+
+   orig_evgl_api_glDrawElementsInstanced(thread_param->mode,
+                                         thread_param->count,
+                                         thread_param->type,
+                                         thread_param->indices,
+                                         thread_param->primcount);
+
+}
+
+EAPI void
+glDrawElementsInstanced_evgl_api_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawElementsInstanced(mode, count, type, indices, primcount);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawElementsInstanced thread_param_local;
+   EVGL_API_Thread_Command_glDrawElementsInstanced *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+   thread_param->primcount = primcount;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawElementsInstanced,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLuint start;
+   GLuint end;
+   GLsizei count;
+   GLenum type;
+   const GLvoid * indices;
+
+} EVGL_API_Thread_Command_glDrawRangeElements;
+
+void (*orig_evgl_api_glDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
+
+static void
+_evgl_api_thread_glDrawRangeElements(void *data)
+{
+   EVGL_API_Thread_Command_glDrawRangeElements *thread_param =
+      (EVGL_API_Thread_Command_glDrawRangeElements *)data;
+
+   orig_evgl_api_glDrawRangeElements(thread_param->mode,
+                                     thread_param->start,
+                                     thread_param->end,
+                                     thread_param->count,
+                                     thread_param->type,
+                                     thread_param->indices);
+
+}
+
+EAPI void
+glDrawRangeElements_evgl_api_thread_cmd(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawRangeElements(mode, start, end, count, type, indices);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawRangeElements thread_param_local;
+   EVGL_API_Thread_Command_glDrawRangeElements *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->start = start;
+   thread_param->end = end;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawRangeElements,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEndQuery(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum target;
+
+} EVGL_API_Thread_Command_glEndQuery;
+
+void (*orig_evgl_api_glEndQuery)(GLenum target);
+
+static void
+_evgl_api_thread_glEndQuery(void *data)
+{
+   EVGL_API_Thread_Command_glEndQuery *thread_param =
+      (EVGL_API_Thread_Command_glEndQuery *)data;
+
+   orig_evgl_api_glEndQuery(thread_param->target);
+
+}
+
+EAPI void
+glEndQuery_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEndQuery(target);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEndQuery thread_param_local;
+   EVGL_API_Thread_Command_glEndQuery *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEndQuery,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEndTransformFeedback(void);
+ */
+
+void (*orig_evgl_api_glEndTransformFeedback)(void);
+
+static void
+_evgl_api_thread_glEndTransformFeedback(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glEndTransformFeedback();
+
+}
+
+EAPI void
+glEndTransformFeedback_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEndTransformFeedback();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEndTransformFeedback,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   GLsync
+   glFenceSync(GLenum condition, GLbitfield flags);
+ */
+
+typedef struct
+{
+   GLsync return_value;
+   GLenum condition;
+   GLbitfield flags;
+
+} EVGL_API_Thread_Command_glFenceSync;
+
+GLsync (*orig_evgl_api_glFenceSync)(GLenum condition, GLbitfield flags);
+
+static void
+_evgl_api_thread_glFenceSync(void *data)
+{
+   EVGL_API_Thread_Command_glFenceSync *thread_param =
+      (EVGL_API_Thread_Command_glFenceSync *)data;
+
+   thread_param->return_value = orig_evgl_api_glFenceSync(thread_param->condition,
+                                                          thread_param->flags);
+
+}
+
+EAPI GLsync
+glFenceSync_evgl_api_thread_cmd(GLenum condition, GLbitfield flags)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glFenceSync(condition, flags);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFenceSync thread_param_local;
+   EVGL_API_Thread_Command_glFenceSync *thread_param = &thread_param_local;
+
+   thread_param->condition = condition;
+   thread_param->flags = flags;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFenceSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLsync
+   glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+ */
+
+typedef struct
+{
+   GLsync return_value;
+   GLenum target;
+   GLintptr offset;
+   GLsizeiptr length;
+
+} EVGL_API_Thread_Command_glFlushMappedBufferRange;
+
+GLsync (*orig_evgl_api_glFlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
+
+static void
+_evgl_api_thread_glFlushMappedBufferRange(void *data)
+{
+   EVGL_API_Thread_Command_glFlushMappedBufferRange *thread_param =
+      (EVGL_API_Thread_Command_glFlushMappedBufferRange *)data;
+
+   thread_param->return_value = orig_evgl_api_glFlushMappedBufferRange(thread_param->target,
+                                                                       thread_param->offset,
+                                                                       thread_param->length);
+
+}
+
+EAPI GLsync
+glFlushMappedBufferRange_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glFlushMappedBufferRange(target, offset, length);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFlushMappedBufferRange thread_param_local;
+   EVGL_API_Thread_Command_glFlushMappedBufferRange *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->offset = offset;
+   thread_param->length = length;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFlushMappedBufferRange,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLuint texture;
+   GLint level;
+   GLint layer;
+
+} EVGL_API_Thread_Command_glFramebufferTextureLayer;
+
+void (*orig_evgl_api_glFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+
+static void
+_evgl_api_thread_glFramebufferTextureLayer(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferTextureLayer *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferTextureLayer *)data;
+
+   orig_evgl_api_glFramebufferTextureLayer(thread_param->target,
+                                           thread_param->attachment,
+                                           thread_param->texture,
+                                           thread_param->level,
+                                           thread_param->layer);
+
+}
+
+EAPI void
+glFramebufferTextureLayer_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferTextureLayer(target, attachment, texture, level, layer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferTextureLayer thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferTextureLayer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->texture = texture;
+   thread_param->level = level;
+   thread_param->layer = layer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferTextureLayer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenQueries(GLsizei n, GLuint * ids);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint * ids;
+
+} EVGL_API_Thread_Command_glGenQueries;
+
+void (*orig_evgl_api_glGenQueries)(GLsizei n, GLuint * ids);
+
+static void
+_evgl_api_thread_glGenQueries(void *data)
+{
+   EVGL_API_Thread_Command_glGenQueries *thread_param =
+      (EVGL_API_Thread_Command_glGenQueries *)data;
+
+   orig_evgl_api_glGenQueries(thread_param->n,
+                              thread_param->ids);
+
+}
+
+EAPI void
+glGenQueries_evgl_api_thread_cmd(GLsizei n, GLuint * ids)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenQueries(n, ids);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenQueries thread_param_local;
+   EVGL_API_Thread_Command_glGenQueries *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->ids = ids;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenQueries,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenSamplers(GLsizei n, GLuint *samplers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *samplers;
+
+} EVGL_API_Thread_Command_glGenSamplers;
+
+void (*orig_evgl_api_glGenSamplers)(GLsizei n, GLuint *samplers);
+
+static void
+_evgl_api_thread_glGenSamplers(void *data)
+{
+   EVGL_API_Thread_Command_glGenSamplers *thread_param =
+      (EVGL_API_Thread_Command_glGenSamplers *)data;
+
+   orig_evgl_api_glGenSamplers(thread_param->n,
+                               thread_param->samplers);
+
+}
+
+EAPI void
+glGenSamplers_evgl_api_thread_cmd(GLsizei n, GLuint *samplers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenSamplers(n, samplers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenSamplers thread_param_local;
+   EVGL_API_Thread_Command_glGenSamplers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->samplers = samplers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenSamplers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenTransformFeedbacks(GLsizei n, GLuint *ids);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *ids;
+
+} EVGL_API_Thread_Command_glGenTransformFeedbacks;
+
+void (*orig_evgl_api_glGenTransformFeedbacks)(GLsizei n, GLuint *ids);
+
+static void
+_evgl_api_thread_glGenTransformFeedbacks(void *data)
+{
+   EVGL_API_Thread_Command_glGenTransformFeedbacks *thread_param =
+      (EVGL_API_Thread_Command_glGenTransformFeedbacks *)data;
+
+   orig_evgl_api_glGenTransformFeedbacks(thread_param->n,
+                                         thread_param->ids);
+
+}
+
+EAPI void
+glGenTransformFeedbacks_evgl_api_thread_cmd(GLsizei n, GLuint *ids)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenTransformFeedbacks(n, ids);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenTransformFeedbacks thread_param_local;
+   EVGL_API_Thread_Command_glGenTransformFeedbacks *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->ids = ids;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenTransformFeedbacks,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenVertexArrays(GLsizei n, GLuint *arrays);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *arrays;
+
+} EVGL_API_Thread_Command_glGenVertexArrays;
+
+void (*orig_evgl_api_glGenVertexArrays)(GLsizei n, GLuint *arrays);
+
+static void
+_evgl_api_thread_glGenVertexArrays(void *data)
+{
+   EVGL_API_Thread_Command_glGenVertexArrays *thread_param =
+      (EVGL_API_Thread_Command_glGenVertexArrays *)data;
+
+   orig_evgl_api_glGenVertexArrays(thread_param->n,
+                                   thread_param->arrays);
+
+}
+
+EAPI void
+glGenVertexArrays_evgl_api_thread_cmd(GLsizei n, GLuint *arrays)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenVertexArrays(n, arrays);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenVertexArrays thread_param_local;
+   EVGL_API_Thread_Command_glGenVertexArrays *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->arrays = arrays;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenVertexArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint uniformBlockIndex;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetActiveUniformBlockiv;
+
+void (*orig_evgl_api_glGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetActiveUniformBlockiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetActiveUniformBlockiv *thread_param =
+      (EVGL_API_Thread_Command_glGetActiveUniformBlockiv *)data;
+
+   orig_evgl_api_glGetActiveUniformBlockiv(thread_param->program,
+                                           thread_param->uniformBlockIndex,
+                                           thread_param->pname,
+                                           thread_param->params);
+
+}
+
+EAPI void
+glGetActiveUniformBlockiv_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetActiveUniformBlockiv thread_param_local;
+   EVGL_API_Thread_Command_glGetActiveUniformBlockiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformBlockIndex = uniformBlockIndex;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetActiveUniformBlockiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint uniformBlockIndex;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *uniformBlockName;
+
+} EVGL_API_Thread_Command_glGetActiveUniformBlockName;
+
+void (*orig_evgl_api_glGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+
+static void
+_evgl_api_thread_glGetActiveUniformBlockName(void *data)
+{
+   EVGL_API_Thread_Command_glGetActiveUniformBlockName *thread_param =
+      (EVGL_API_Thread_Command_glGetActiveUniformBlockName *)data;
+
+   orig_evgl_api_glGetActiveUniformBlockName(thread_param->program,
+                                             thread_param->uniformBlockIndex,
+                                             thread_param->bufSize,
+                                             thread_param->length,
+                                             thread_param->uniformBlockName);
+
+}
+
+EAPI void
+glGetActiveUniformBlockName_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetActiveUniformBlockName thread_param_local;
+   EVGL_API_Thread_Command_glGetActiveUniformBlockName *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformBlockIndex = uniformBlockIndex;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->uniformBlockName = uniformBlockName;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetActiveUniformBlockName,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei uniformCount;
+   const GLuint *uniformIndices;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetActiveUniformsiv;
+
+void (*orig_evgl_api_glGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetActiveUniformsiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetActiveUniformsiv *thread_param =
+      (EVGL_API_Thread_Command_glGetActiveUniformsiv *)data;
+
+   orig_evgl_api_glGetActiveUniformsiv(thread_param->program,
+                                       thread_param->uniformCount,
+                                       thread_param->uniformIndices,
+                                       thread_param->pname,
+                                       thread_param->params);
+
+}
+
+EAPI void
+glGetActiveUniformsiv_evgl_api_thread_cmd(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetActiveUniformsiv thread_param_local;
+   EVGL_API_Thread_Command_glGetActiveUniformsiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformCount = uniformCount;
+   thread_param->uniformIndices = uniformIndices;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetActiveUniformsiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetBufferParameteri64v(GLenum target, GLenum value, EvasGLint64 * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum value;
+   EvasGLint64 * data;
+
+} EVGL_API_Thread_Command_glGetBufferParameteri64v;
+
+void (*orig_evgl_api_glGetBufferParameteri64v)(GLenum target, GLenum value, EvasGLint64 * data);
+
+static void
+_evgl_api_thread_glGetBufferParameteri64v(void *data)
+{
+   EVGL_API_Thread_Command_glGetBufferParameteri64v *thread_param =
+      (EVGL_API_Thread_Command_glGetBufferParameteri64v *)data;
+
+   orig_evgl_api_glGetBufferParameteri64v(thread_param->target,
+                                          thread_param->value,
+                                          thread_param->data);
+
+}
+
+EAPI void
+glGetBufferParameteri64v_evgl_api_thread_cmd(GLenum target, GLenum value, EvasGLint64 * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBufferParameteri64v(target, value, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBufferParameteri64v thread_param_local;
+   EVGL_API_Thread_Command_glGetBufferParameteri64v *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->value = value;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBufferParameteri64v,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLvoid ** params;
+
+} EVGL_API_Thread_Command_glGetBufferPointerv;
+
+void (*orig_evgl_api_glGetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params);
+
+static void
+_evgl_api_thread_glGetBufferPointerv(void *data)
+{
+   EVGL_API_Thread_Command_glGetBufferPointerv *thread_param =
+      (EVGL_API_Thread_Command_glGetBufferPointerv *)data;
+
+   orig_evgl_api_glGetBufferPointerv(thread_param->target,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetBufferPointerv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLvoid ** params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBufferPointerv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBufferPointerv thread_param_local;
+   EVGL_API_Thread_Command_glGetBufferPointerv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBufferPointerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetFragDataLocation(GLuint program, const char * name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   const char * name;
+
+} EVGL_API_Thread_Command_glGetFragDataLocation;
+
+GLint (*orig_evgl_api_glGetFragDataLocation)(GLuint program, const char * name);
+
+static void
+_evgl_api_thread_glGetFragDataLocation(void *data)
+{
+   EVGL_API_Thread_Command_glGetFragDataLocation *thread_param =
+      (EVGL_API_Thread_Command_glGetFragDataLocation *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetFragDataLocation(thread_param->program,
+                                                                    thread_param->name);
+
+}
+
+EAPI GLint
+glGetFragDataLocation_evgl_api_thread_cmd(GLuint program, const char * name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetFragDataLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFragDataLocation thread_param_local;
+   EVGL_API_Thread_Command_glGetFragDataLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFragDataLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetInteger64i_v(GLenum target, GLuint index, EvasGLint64 * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint index;
+   EvasGLint64 * data;
+
+} EVGL_API_Thread_Command_glGetInteger64i_v;
+
+void (*orig_evgl_api_glGetInteger64i_v)(GLenum target, GLuint index, EvasGLint64 * data);
+
+static void
+_evgl_api_thread_glGetInteger64i_v(void *data)
+{
+   EVGL_API_Thread_Command_glGetInteger64i_v *thread_param =
+      (EVGL_API_Thread_Command_glGetInteger64i_v *)data;
+
+   orig_evgl_api_glGetInteger64i_v(thread_param->target,
+                                   thread_param->index,
+                                   thread_param->data);
+
+}
+
+EAPI void
+glGetInteger64i_v_evgl_api_thread_cmd(GLenum target, GLuint index, EvasGLint64 * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetInteger64i_v(target, index, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetInteger64i_v thread_param_local;
+   EVGL_API_Thread_Command_glGetInteger64i_v *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->index = index;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetInteger64i_v,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetInteger64v(GLenum pname, EvasGLint64 * data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   EvasGLint64 * data;
+
+} EVGL_API_Thread_Command_glGetInteger64v;
+
+void (*orig_evgl_api_glGetInteger64v)(GLenum pname, EvasGLint64 * data);
+
+static void
+_evgl_api_thread_glGetInteger64v(void *data)
+{
+   EVGL_API_Thread_Command_glGetInteger64v *thread_param =
+      (EVGL_API_Thread_Command_glGetInteger64v *)data;
+
+   orig_evgl_api_glGetInteger64v(thread_param->pname,
+                                 thread_param->data);
+
+}
+
+EAPI void
+glGetInteger64v_evgl_api_thread_cmd(GLenum pname, EvasGLint64 * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetInteger64v(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetInteger64v thread_param_local;
+   EVGL_API_Thread_Command_glGetInteger64v *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetInteger64v,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetIntegeri_v(GLenum target, GLuint index, GLint * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint index;
+   GLint * data;
+
+} EVGL_API_Thread_Command_glGetIntegeri_v;
+
+void (*orig_evgl_api_glGetIntegeri_v)(GLenum target, GLuint index, GLint * data);
+
+static void
+_evgl_api_thread_glGetIntegeri_v(void *data)
+{
+   EVGL_API_Thread_Command_glGetIntegeri_v *thread_param =
+      (EVGL_API_Thread_Command_glGetIntegeri_v *)data;
+
+   orig_evgl_api_glGetIntegeri_v(thread_param->target,
+                                 thread_param->index,
+                                 thread_param->data);
+
+}
+
+EAPI void
+glGetIntegeri_v_evgl_api_thread_cmd(GLenum target, GLuint index, GLint * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetIntegeri_v(target, index, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetIntegeri_v thread_param_local;
+   EVGL_API_Thread_Command_glGetIntegeri_v *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->index = index;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetIntegeri_v,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum internalformat;
+   GLenum pname;
+   GLsizei bufSize;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetInternalformativ;
+
+void (*orig_evgl_api_glGetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+static void
+_evgl_api_thread_glGetInternalformativ(void *data)
+{
+   EVGL_API_Thread_Command_glGetInternalformativ *thread_param =
+      (EVGL_API_Thread_Command_glGetInternalformativ *)data;
+
+   orig_evgl_api_glGetInternalformativ(thread_param->target,
+                                       thread_param->internalformat,
+                                       thread_param->pname,
+                                       thread_param->bufSize,
+                                       thread_param->params);
+
+}
+
+EAPI void
+glGetInternalformativ_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetInternalformativ(target, internalformat, pname, bufSize, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetInternalformativ thread_param_local;
+   EVGL_API_Thread_Command_glGetInternalformativ *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->internalformat = internalformat;
+   thread_param->pname = pname;
+   thread_param->bufSize = bufSize;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetInternalformativ,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramBinary(GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufsize;
+   GLsizei *length;
+   GLenum *binaryFormat;
+   void *binary;
+
+} EVGL_API_Thread_Command_glGetProgramBinary;
+
+void (*orig_evgl_api_glGetProgramBinary)(GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+static void
+_evgl_api_thread_glGetProgramBinary(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramBinary *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramBinary *)data;
+
+   orig_evgl_api_glGetProgramBinary(thread_param->program,
+                                    thread_param->bufsize,
+                                    thread_param->length,
+                                    thread_param->binaryFormat,
+                                    thread_param->binary);
+
+}
+
+EAPI void
+glGetProgramBinary_evgl_api_thread_cmd(GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramBinary(program, bufsize, length, binaryFormat, binary);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramBinary thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramBinary *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufsize = bufsize;
+   thread_param->length = length;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetQueryiv(GLenum target, GLenum pname, GLint * params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint * params;
+
+} EVGL_API_Thread_Command_glGetQueryiv;
+
+void (*orig_evgl_api_glGetQueryiv)(GLenum target, GLenum pname, GLint * params);
+
+static void
+_evgl_api_thread_glGetQueryiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetQueryiv *thread_param =
+      (EVGL_API_Thread_Command_glGetQueryiv *)data;
+
+   orig_evgl_api_glGetQueryiv(thread_param->target,
+                              thread_param->pname,
+                              thread_param->params);
+
+}
+
+EAPI void
+glGetQueryiv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetQueryiv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetQueryiv thread_param_local;
+   EVGL_API_Thread_Command_glGetQueryiv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetQueryiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params);
+ */
+
+typedef struct
+{
+   GLuint id;
+   GLenum pname;
+   GLuint * params;
+
+} EVGL_API_Thread_Command_glGetQueryObjectuiv;
+
+void (*orig_evgl_api_glGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params);
+
+static void
+_evgl_api_thread_glGetQueryObjectuiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetQueryObjectuiv *thread_param =
+      (EVGL_API_Thread_Command_glGetQueryObjectuiv *)data;
+
+   orig_evgl_api_glGetQueryObjectuiv(thread_param->id,
+                                     thread_param->pname,
+                                     thread_param->params);
+
+}
+
+EAPI void
+glGetQueryObjectuiv_evgl_api_thread_cmd(GLuint id, GLenum pname, GLuint * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetQueryObjectuiv(id, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetQueryObjectuiv thread_param_local;
+   EVGL_API_Thread_Command_glGetQueryObjectuiv *thread_param = &thread_param_local;
+
+   thread_param->id = id;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetQueryObjectuiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   GLfloat * params;
+
+} EVGL_API_Thread_Command_glGetSamplerParameterfv;
+
+void (*orig_evgl_api_glGetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params);
+
+static void
+_evgl_api_thread_glGetSamplerParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetSamplerParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glGetSamplerParameterfv *)data;
+
+   orig_evgl_api_glGetSamplerParameterfv(thread_param->sampler,
+                                         thread_param->pname,
+                                         thread_param->params);
+
+}
+
+EAPI void
+glGetSamplerParameterfv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLfloat * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetSamplerParameterfv(sampler, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetSamplerParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glGetSamplerParameterfv *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetSamplerParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   GLint * params;
+
+} EVGL_API_Thread_Command_glGetSamplerParameteriv;
+
+void (*orig_evgl_api_glGetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params);
+
+static void
+_evgl_api_thread_glGetSamplerParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetSamplerParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetSamplerParameteriv *)data;
+
+   orig_evgl_api_glGetSamplerParameteriv(thread_param->sampler,
+                                         thread_param->pname,
+                                         thread_param->params);
+
+}
+
+EAPI void
+glGetSamplerParameteriv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLint * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetSamplerParameteriv(sampler, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetSamplerParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetSamplerParameteriv *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetSamplerParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   const GLubyte *
+   glGetStringi(GLenum name, GLuint index);
+ */
+
+typedef struct
+{
+   const GLubyte * return_value;
+   GLenum name;
+   GLuint index;
+
+} EVGL_API_Thread_Command_glGetStringi;
+
+const GLubyte * (*orig_evgl_api_glGetStringi)(GLenum name, GLuint index);
+
+static void
+_evgl_api_thread_glGetStringi(void *data)
+{
+   EVGL_API_Thread_Command_glGetStringi *thread_param =
+      (EVGL_API_Thread_Command_glGetStringi *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetStringi(thread_param->name,
+                                                           thread_param->index);
+
+}
+
+EAPI const GLubyte *
+glGetStringi_evgl_api_thread_cmd(GLenum name, GLuint index)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetStringi(name, index);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetStringi thread_param_local;
+   EVGL_API_Thread_Command_glGetStringi *thread_param = &thread_param_local;
+
+   thread_param->name = name;
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetStringi,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+ */
+
+typedef struct
+{
+   GLsync sync;
+   GLenum pname;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLint *values;
+
+} EVGL_API_Thread_Command_glGetSynciv;
+
+void (*orig_evgl_api_glGetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
+static void
+_evgl_api_thread_glGetSynciv(void *data)
+{
+   EVGL_API_Thread_Command_glGetSynciv *thread_param =
+      (EVGL_API_Thread_Command_glGetSynciv *)data;
+
+   orig_evgl_api_glGetSynciv(thread_param->sync,
+                             thread_param->pname,
+                             thread_param->bufSize,
+                             thread_param->length,
+                             thread_param->values);
+
+}
+
+EAPI void
+glGetSynciv_evgl_api_thread_cmd(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetSynciv(sync, pname, bufSize, length, values);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetSynciv thread_param_local;
+   EVGL_API_Thread_Command_glGetSynciv *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->pname = pname;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->values = values;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetSynciv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   GLsizei bufSize;
+   GLsizei * length;
+   GLsizei * size;
+   GLenum * type;
+   char * name;
+
+} EVGL_API_Thread_Command_glGetTransformFeedbackVarying;
+
+void (*orig_evgl_api_glGetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name);
+
+static void
+_evgl_api_thread_glGetTransformFeedbackVarying(void *data)
+{
+   EVGL_API_Thread_Command_glGetTransformFeedbackVarying *thread_param =
+      (EVGL_API_Thread_Command_glGetTransformFeedbackVarying *)data;
+
+   orig_evgl_api_glGetTransformFeedbackVarying(thread_param->program,
+                                               thread_param->index,
+                                               thread_param->bufSize,
+                                               thread_param->length,
+                                               thread_param->size,
+                                               thread_param->type,
+                                               thread_param->name);
+
+}
+
+EAPI void
+glGetTransformFeedbackVarying_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTransformFeedbackVarying thread_param_local;
+   EVGL_API_Thread_Command_glGetTransformFeedbackVarying *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTransformFeedbackVarying,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glGetUniformBlockIndex(GLuint program, const GLchar *uniformBlockName);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLuint program;
+   const GLchar *uniformBlockName;
+
+} EVGL_API_Thread_Command_glGetUniformBlockIndex;
+
+GLuint (*orig_evgl_api_glGetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName);
+
+static void
+_evgl_api_thread_glGetUniformBlockIndex(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformBlockIndex *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformBlockIndex *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetUniformBlockIndex(thread_param->program,
+                                                                     thread_param->uniformBlockName);
+
+}
+
+EAPI GLuint
+glGetUniformBlockIndex_evgl_api_thread_cmd(GLuint program, const GLchar *uniformBlockName)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetUniformBlockIndex(program, uniformBlockName);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformBlockIndex thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformBlockIndex *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformBlockName = uniformBlockName;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformBlockIndex,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei uniformCount;
+   const GLchar *const*uniformNames;
+   GLuint *uniformIndices;
+
+} EVGL_API_Thread_Command_glGetUniformIndices;
+
+void (*orig_evgl_api_glGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+
+static void
+_evgl_api_thread_glGetUniformIndices(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformIndices *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformIndices *)data;
+
+   orig_evgl_api_glGetUniformIndices(thread_param->program,
+                                     thread_param->uniformCount,
+                                     thread_param->uniformNames,
+                                     thread_param->uniformIndices);
+
+}
+
+EAPI void
+glGetUniformIndices_evgl_api_thread_cmd(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformIndices thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformIndices *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformCount = uniformCount;
+   thread_param->uniformNames = uniformNames;
+   thread_param->uniformIndices = uniformIndices;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformIndices,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetUniformuiv(GLuint program, GLint location, GLuint* params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLuint* params;
+
+} EVGL_API_Thread_Command_glGetUniformuiv;
+
+void (*orig_evgl_api_glGetUniformuiv)(GLuint program, GLint location, GLuint* params);
+
+static void
+_evgl_api_thread_glGetUniformuiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetUniformuiv *thread_param =
+      (EVGL_API_Thread_Command_glGetUniformuiv *)data;
+
+   orig_evgl_api_glGetUniformuiv(thread_param->program,
+                                 thread_param->location,
+                                 thread_param->params);
+
+}
+
+EAPI void
+glGetUniformuiv_evgl_api_thread_cmd(GLuint program, GLint location, GLuint* params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetUniformuiv(program, location, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetUniformuiv thread_param_local;
+   EVGL_API_Thread_Command_glGetUniformuiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetUniformuiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribIiv(GLuint index, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetVertexAttribIiv;
+
+void (*orig_evgl_api_glGetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetVertexAttribIiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetVertexAttribIiv *thread_param =
+      (EVGL_API_Thread_Command_glGetVertexAttribIiv *)data;
+
+   orig_evgl_api_glGetVertexAttribIiv(thread_param->index,
+                                      thread_param->pname,
+                                      thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribIiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetVertexAttribIiv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetVertexAttribIiv thread_param_local;
+   EVGL_API_Thread_Command_glGetVertexAttribIiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetVertexAttribIiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLuint *params;
+
+} EVGL_API_Thread_Command_glGetVertexAttribIuiv;
+
+void (*orig_evgl_api_glGetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
+
+static void
+_evgl_api_thread_glGetVertexAttribIuiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetVertexAttribIuiv *thread_param =
+      (EVGL_API_Thread_Command_glGetVertexAttribIuiv *)data;
+
+   orig_evgl_api_glGetVertexAttribIuiv(thread_param->index,
+                                       thread_param->pname,
+                                       thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribIuiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLuint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetVertexAttribIuiv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetVertexAttribIuiv thread_param_local;
+   EVGL_API_Thread_Command_glGetVertexAttribIuiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetVertexAttribIuiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei numAttachments;
+   const GLenum *attachments;
+
+} EVGL_API_Thread_Command_glInvalidateFramebuffer;
+
+void (*orig_evgl_api_glInvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+
+static void
+_evgl_api_thread_glInvalidateFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glInvalidateFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glInvalidateFramebuffer *)data;
+
+   orig_evgl_api_glInvalidateFramebuffer(thread_param->target,
+                                         thread_param->numAttachments,
+                                         thread_param->attachments);
+
+}
+
+EAPI void
+glInvalidateFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum *attachments)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glInvalidateFramebuffer(target, numAttachments, attachments);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glInvalidateFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glInvalidateFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->numAttachments = numAttachments;
+   thread_param->attachments = attachments;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glInvalidateFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei numAttachments;
+   const GLenum *attachments;
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glInvalidateSubFramebuffer;
+
+void (*orig_evgl_api_glInvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glInvalidateSubFramebuffer(void *data)
+{
+   EVGL_API_Thread_Command_glInvalidateSubFramebuffer *thread_param =
+      (EVGL_API_Thread_Command_glInvalidateSubFramebuffer *)data;
+
+   orig_evgl_api_glInvalidateSubFramebuffer(thread_param->target,
+                                            thread_param->numAttachments,
+                                            thread_param->attachments,
+                                            thread_param->x,
+                                            thread_param->y,
+                                            thread_param->width,
+                                            thread_param->height);
+
+}
+
+EAPI void
+glInvalidateSubFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glInvalidateSubFramebuffer thread_param_local;
+   EVGL_API_Thread_Command_glInvalidateSubFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->numAttachments = numAttachments;
+   thread_param->attachments = attachments;
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glInvalidateSubFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsQuery(GLuint id);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint id;
+
+} EVGL_API_Thread_Command_glIsQuery;
+
+GLboolean (*orig_evgl_api_glIsQuery)(GLuint id);
+
+static void
+_evgl_api_thread_glIsQuery(void *data)
+{
+   EVGL_API_Thread_Command_glIsQuery *thread_param =
+      (EVGL_API_Thread_Command_glIsQuery *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsQuery(thread_param->id);
+
+}
+
+EAPI GLboolean
+glIsQuery_evgl_api_thread_cmd(GLuint id)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsQuery(id);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsQuery thread_param_local;
+   EVGL_API_Thread_Command_glIsQuery *thread_param = &thread_param_local;
+
+   thread_param->id = id;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsQuery,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsSampler(GLuint id);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint id;
+
+} EVGL_API_Thread_Command_glIsSampler;
+
+GLboolean (*orig_evgl_api_glIsSampler)(GLuint id);
+
+static void
+_evgl_api_thread_glIsSampler(void *data)
+{
+   EVGL_API_Thread_Command_glIsSampler *thread_param =
+      (EVGL_API_Thread_Command_glIsSampler *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsSampler(thread_param->id);
+
+}
+
+EAPI GLboolean
+glIsSampler_evgl_api_thread_cmd(GLuint id)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsSampler(id);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsSampler thread_param_local;
+   EVGL_API_Thread_Command_glIsSampler *thread_param = &thread_param_local;
+
+   thread_param->id = id;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsSampler,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsSync(GLsync sync);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLsync sync;
+
+} EVGL_API_Thread_Command_glIsSync;
+
+GLboolean (*orig_evgl_api_glIsSync)(GLsync sync);
+
+static void
+_evgl_api_thread_glIsSync(void *data)
+{
+   EVGL_API_Thread_Command_glIsSync *thread_param =
+      (EVGL_API_Thread_Command_glIsSync *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsSync(thread_param->sync);
+
+}
+
+EAPI GLboolean
+glIsSync_evgl_api_thread_cmd(GLsync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsSync(sync);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsSync thread_param_local;
+   EVGL_API_Thread_Command_glIsSync *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsTransformFeedback(GLuint id);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint id;
+
+} EVGL_API_Thread_Command_glIsTransformFeedback;
+
+GLboolean (*orig_evgl_api_glIsTransformFeedback)(GLuint id);
+
+static void
+_evgl_api_thread_glIsTransformFeedback(void *data)
+{
+   EVGL_API_Thread_Command_glIsTransformFeedback *thread_param =
+      (EVGL_API_Thread_Command_glIsTransformFeedback *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsTransformFeedback(thread_param->id);
+
+}
+
+EAPI GLboolean
+glIsTransformFeedback_evgl_api_thread_cmd(GLuint id)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsTransformFeedback(id);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsTransformFeedback thread_param_local;
+   EVGL_API_Thread_Command_glIsTransformFeedback *thread_param = &thread_param_local;
+
+   thread_param->id = id;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsTransformFeedback,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsVertexArray(GLuint array);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint array;
+
+} EVGL_API_Thread_Command_glIsVertexArray;
+
+GLboolean (*orig_evgl_api_glIsVertexArray)(GLuint array);
+
+static void
+_evgl_api_thread_glIsVertexArray(void *data)
+{
+   EVGL_API_Thread_Command_glIsVertexArray *thread_param =
+      (EVGL_API_Thread_Command_glIsVertexArray *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsVertexArray(thread_param->array);
+
+}
+
+EAPI GLboolean
+glIsVertexArray_evgl_api_thread_cmd(GLuint array)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsVertexArray(array);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsVertexArray thread_param_local;
+   EVGL_API_Thread_Command_glIsVertexArray *thread_param = &thread_param_local;
+
+   thread_param->array = array;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsVertexArray,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void *
+   glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+ */
+
+typedef struct
+{
+   void * return_value;
+   GLenum target;
+   GLintptr offset;
+   GLsizeiptr length;
+   GLbitfield access;
+
+} EVGL_API_Thread_Command_glMapBufferRange;
+
+void * (*orig_evgl_api_glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+
+static void
+_evgl_api_thread_glMapBufferRange(void *data)
+{
+   EVGL_API_Thread_Command_glMapBufferRange *thread_param =
+      (EVGL_API_Thread_Command_glMapBufferRange *)data;
+
+   thread_param->return_value = orig_evgl_api_glMapBufferRange(thread_param->target,
+                                                               thread_param->offset,
+                                                               thread_param->length,
+                                                               thread_param->access);
+
+}
+
+EAPI void *
+glMapBufferRange_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glMapBufferRange(target, offset, length, access);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMapBufferRange thread_param_local;
+   EVGL_API_Thread_Command_glMapBufferRange *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->offset = offset;
+   thread_param->length = length;
+   thread_param->access = access;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMapBufferRange,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glPauseTransformFeedback(void);
+ */
+
+void (*orig_evgl_api_glPauseTransformFeedback)(void);
+
+static void
+_evgl_api_thread_glPauseTransformFeedback(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glPauseTransformFeedback();
+
+}
+
+EAPI void
+glPauseTransformFeedback_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glPauseTransformFeedback();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glPauseTransformFeedback,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum binaryFormat;
+   const void *binary;
+   GLsizei length;
+   void *binary_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glProgramBinary;
+
+void (*orig_evgl_api_glProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+
+static void
+_evgl_api_thread_glProgramBinary(void *data)
+{
+   EVGL_API_Thread_Command_glProgramBinary *thread_param =
+      (EVGL_API_Thread_Command_glProgramBinary *)data;
+
+   orig_evgl_api_glProgramBinary(thread_param->program,
+                                 thread_param->binaryFormat,
+                                 thread_param->binary,
+                                 thread_param->length);
+
+
+   if (thread_param->binary_copied)
+     eina_mempool_free(_mp_default, thread_param->binary_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glProgramBinary_evgl_api_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramBinary(program, binaryFormat, binary, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramBinary thread_param_local;
+   EVGL_API_Thread_Command_glProgramBinary *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glProgramBinary *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glProgramBinary));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+   thread_param->length = length;
+
+   thread_param->binary_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (binary)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = length;
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->binary_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->binary_copied)
+          {
+             memcpy(thread_param->binary_copied, binary, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->binary = (const void  *)thread_param->binary_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramParameteri(GLuint program, GLenum pname, GLint value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum pname;
+   GLint value;
+
+} EVGL_API_Thread_Command_glProgramParameteri;
+
+void (*orig_evgl_api_glProgramParameteri)(GLuint program, GLenum pname, GLint value);
+
+static void
+_evgl_api_thread_glProgramParameteri(void *data)
+{
+   EVGL_API_Thread_Command_glProgramParameteri *thread_param =
+      (EVGL_API_Thread_Command_glProgramParameteri *)data;
+
+   orig_evgl_api_glProgramParameteri(thread_param->program,
+                                     thread_param->pname,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramParameteri_evgl_api_thread_cmd(GLuint program, GLenum pname, GLint value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramParameteri(program, pname, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramParameteri thread_param_local;
+   EVGL_API_Thread_Command_glProgramParameteri *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->pname = pname;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReadBuffer(GLenum src);
+ */
+
+typedef struct
+{
+   GLenum src;
+
+} EVGL_API_Thread_Command_glReadBuffer;
+
+void (*orig_evgl_api_glReadBuffer)(GLenum src);
+
+static void
+_evgl_api_thread_glReadBuffer(void *data)
+{
+   EVGL_API_Thread_Command_glReadBuffer *thread_param =
+      (EVGL_API_Thread_Command_glReadBuffer *)data;
+
+   orig_evgl_api_glReadBuffer(thread_param->src);
+
+}
+
+EAPI void
+glReadBuffer_evgl_api_thread_cmd(GLenum src)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glReadBuffer(src);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glReadBuffer thread_param_local;
+   EVGL_API_Thread_Command_glReadBuffer *thread_param = &thread_param_local;
+
+   thread_param->src = src;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glReadBuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei samples;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glRenderbufferStorageMultisample;
+
+void (*orig_evgl_api_glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glRenderbufferStorageMultisample(void *data)
+{
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisample *thread_param =
+      (EVGL_API_Thread_Command_glRenderbufferStorageMultisample *)data;
+
+   orig_evgl_api_glRenderbufferStorageMultisample(thread_param->target,
+                                                  thread_param->samples,
+                                                  thread_param->internalformat,
+                                                  thread_param->width,
+                                                  thread_param->height);
+
+}
+
+EAPI void
+glRenderbufferStorageMultisample_evgl_api_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisample thread_param_local;
+   EVGL_API_Thread_Command_glRenderbufferStorageMultisample *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->samples = samples;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glRenderbufferStorageMultisample,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glResumeTransformFeedback(void);
+ */
+
+void (*orig_evgl_api_glResumeTransformFeedback)(void);
+
+static void
+_evgl_api_thread_glResumeTransformFeedback(void *data EINA_UNUSED)
+{
+   orig_evgl_api_glResumeTransformFeedback();
+
+}
+
+EAPI void
+glResumeTransformFeedback_evgl_api_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glResumeTransformFeedback();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glResumeTransformFeedback,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   GLfloat param;
+
+} EVGL_API_Thread_Command_glSamplerParameterf;
+
+void (*orig_evgl_api_glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
+
+static void
+_evgl_api_thread_glSamplerParameterf(void *data)
+{
+   EVGL_API_Thread_Command_glSamplerParameterf *thread_param =
+      (EVGL_API_Thread_Command_glSamplerParameterf *)data;
+
+   orig_evgl_api_glSamplerParameterf(thread_param->sampler,
+                                     thread_param->pname,
+                                     thread_param->param);
+
+}
+
+EAPI void
+glSamplerParameterf_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSamplerParameterf(sampler, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSamplerParameterf thread_param_local;
+   EVGL_API_Thread_Command_glSamplerParameterf *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSamplerParameterf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   const GLfloat * params;
+
+} EVGL_API_Thread_Command_glSamplerParameterfv;
+
+void (*orig_evgl_api_glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params);
+
+static void
+_evgl_api_thread_glSamplerParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glSamplerParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glSamplerParameterfv *)data;
+
+   orig_evgl_api_glSamplerParameterfv(thread_param->sampler,
+                                      thread_param->pname,
+                                      thread_param->params);
+
+}
+
+EAPI void
+glSamplerParameterfv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, const GLfloat * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSamplerParameterfv(sampler, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSamplerParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glSamplerParameterfv *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSamplerParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   GLint param;
+
+} EVGL_API_Thread_Command_glSamplerParameteri;
+
+void (*orig_evgl_api_glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glSamplerParameteri(void *data)
+{
+   EVGL_API_Thread_Command_glSamplerParameteri *thread_param =
+      (EVGL_API_Thread_Command_glSamplerParameteri *)data;
+
+   orig_evgl_api_glSamplerParameteri(thread_param->sampler,
+                                     thread_param->pname,
+                                     thread_param->param);
+
+}
+
+EAPI void
+glSamplerParameteri_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSamplerParameteri(sampler, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSamplerParameteri thread_param_local;
+   EVGL_API_Thread_Command_glSamplerParameteri *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSamplerParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params);
+ */
+
+typedef struct
+{
+   GLuint sampler;
+   GLenum pname;
+   const GLint * params;
+
+} EVGL_API_Thread_Command_glSamplerParameteriv;
+
+void (*orig_evgl_api_glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params);
+
+static void
+_evgl_api_thread_glSamplerParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glSamplerParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glSamplerParameteriv *)data;
+
+   orig_evgl_api_glSamplerParameteriv(thread_param->sampler,
+                                      thread_param->pname,
+                                      thread_param->params);
+
+}
+
+EAPI void
+glSamplerParameteriv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, const GLint * params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSamplerParameteriv(sampler, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSamplerParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glSamplerParameteriv *thread_param = &thread_param_local;
+
+   thread_param->sampler = sampler;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSamplerParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint internalFormat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLint border;
+   GLenum format;
+   GLenum type;
+   const GLvoid * data;
+
+} EVGL_API_Thread_Command_glTexImage3D;
+
+void (*orig_evgl_api_glTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data);
+
+static void
+_evgl_api_thread_glTexImage3D(void *data)
+{
+   EVGL_API_Thread_Command_glTexImage3D *thread_param =
+      (EVGL_API_Thread_Command_glTexImage3D *)data;
+
+   orig_evgl_api_glTexImage3D(thread_param->target,
+                              thread_param->level,
+                              thread_param->internalFormat,
+                              thread_param->width,
+                              thread_param->height,
+                              thread_param->depth,
+                              thread_param->border,
+                              thread_param->format,
+                              thread_param->type,
+                              thread_param->data);
+
+}
+
+EAPI void
+glTexImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexImage3D thread_param_local;
+   EVGL_API_Thread_Command_glTexImage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalFormat = internalFormat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->border = border;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexImage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+
+} EVGL_API_Thread_Command_glTexStorage2D;
+
+void (*orig_evgl_api_glTexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+static void
+_evgl_api_thread_glTexStorage2D(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage2D *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage2D *)data;
+
+   orig_evgl_api_glTexStorage2D(thread_param->target,
+                                thread_param->levels,
+                                thread_param->internalformat,
+                                thread_param->width,
+                                thread_param->height);
+
+}
+
+EAPI void
+glTexStorage2D_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage2D(target, levels, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage2D thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage2D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei levels;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+
+} EVGL_API_Thread_Command_glTexStorage3D;
+
+void (*orig_evgl_api_glTexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+static void
+_evgl_api_thread_glTexStorage3D(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage3D *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage3D *)data;
+
+   orig_evgl_api_glTexStorage3D(thread_param->target,
+                                thread_param->levels,
+                                thread_param->internalformat,
+                                thread_param->width,
+                                thread_param->height,
+                                thread_param->depth);
+
+}
+
+EAPI void
+glTexStorage3D_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage3D(target, levels, internalformat, width, height, depth);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage3D thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->levels = levels;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLint zoffset;
+   GLsizei width;
+   GLsizei height;
+   GLsizei depth;
+   GLenum format;
+   GLenum type;
+   const GLvoid * data;
+
+} EVGL_API_Thread_Command_glTexSubImage3D;
+
+void (*orig_evgl_api_glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data);
+
+static void
+_evgl_api_thread_glTexSubImage3D(void *data)
+{
+   EVGL_API_Thread_Command_glTexSubImage3D *thread_param =
+      (EVGL_API_Thread_Command_glTexSubImage3D *)data;
+
+   orig_evgl_api_glTexSubImage3D(thread_param->target,
+                                 thread_param->level,
+                                 thread_param->xoffset,
+                                 thread_param->yoffset,
+                                 thread_param->zoffset,
+                                 thread_param->width,
+                                 thread_param->height,
+                                 thread_param->depth,
+                                 thread_param->format,
+                                 thread_param->type,
+                                 thread_param->data);
+
+}
+
+EAPI void
+glTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexSubImage3D thread_param_local;
+   EVGL_API_Thread_Command_glTexSubImage3D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->zoffset = zoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->depth = depth;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexSubImage3D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei count;
+   const GLchar *const* varyings;
+   GLenum bufferMode;
+
+} EVGL_API_Thread_Command_glTransformFeedbackVaryings;
+
+void (*orig_evgl_api_glTransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+
+static void
+_evgl_api_thread_glTransformFeedbackVaryings(void *data)
+{
+   EVGL_API_Thread_Command_glTransformFeedbackVaryings *thread_param =
+      (EVGL_API_Thread_Command_glTransformFeedbackVaryings *)data;
+
+   orig_evgl_api_glTransformFeedbackVaryings(thread_param->program,
+                                             thread_param->count,
+                                             thread_param->varyings,
+                                             thread_param->bufferMode);
+
+}
+
+EAPI void
+glTransformFeedbackVaryings_evgl_api_thread_cmd(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTransformFeedbackVaryings(program, count, varyings, bufferMode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTransformFeedbackVaryings thread_param_local;
+   EVGL_API_Thread_Command_glTransformFeedbackVaryings *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->count = count;
+   thread_param->varyings = varyings;
+   thread_param->bufferMode = bufferMode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTransformFeedbackVaryings,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1ui(GLint location, GLuint v0);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLuint v0;
+
+} EVGL_API_Thread_Command_glUniform1ui;
+
+void (*orig_evgl_api_glUniform1ui)(GLint location, GLuint v0);
+
+static void
+_evgl_api_thread_glUniform1ui(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1ui *thread_param =
+      (EVGL_API_Thread_Command_glUniform1ui *)data;
+
+   orig_evgl_api_glUniform1ui(thread_param->location,
+                              thread_param->v0);
+
+}
+
+EAPI void
+glUniform1ui_evgl_api_thread_cmd(GLint location, GLuint v0)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1ui(location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1ui thread_param_local;
+   EVGL_API_Thread_Command_glUniform1ui *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1uiv(GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glUniform1uiv;
+
+void (*orig_evgl_api_glUniform1uiv)(GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glUniform1uiv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform1uiv *thread_param =
+      (EVGL_API_Thread_Command_glUniform1uiv *)data;
+
+   orig_evgl_api_glUniform1uiv(thread_param->location,
+                               thread_param->count,
+                               thread_param->value);
+
+}
+
+EAPI void
+glUniform1uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform1uiv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform1uiv thread_param_local;
+   EVGL_API_Thread_Command_glUniform1uiv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform1uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2ui(GLint location, GLuint v0, GLuint v1);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+
+} EVGL_API_Thread_Command_glUniform2ui;
+
+void (*orig_evgl_api_glUniform2ui)(GLint location, GLuint v0, GLuint v1);
+
+static void
+_evgl_api_thread_glUniform2ui(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2ui *thread_param =
+      (EVGL_API_Thread_Command_glUniform2ui *)data;
+
+   orig_evgl_api_glUniform2ui(thread_param->location,
+                              thread_param->v0,
+                              thread_param->v1);
+
+}
+
+EAPI void
+glUniform2ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2ui(location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2ui thread_param_local;
+   EVGL_API_Thread_Command_glUniform2ui *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2uiv(GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glUniform2uiv;
+
+void (*orig_evgl_api_glUniform2uiv)(GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glUniform2uiv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform2uiv *thread_param =
+      (EVGL_API_Thread_Command_glUniform2uiv *)data;
+
+   orig_evgl_api_glUniform2uiv(thread_param->location,
+                               thread_param->count,
+                               thread_param->value);
+
+}
+
+EAPI void
+glUniform2uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform2uiv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform2uiv thread_param_local;
+   EVGL_API_Thread_Command_glUniform2uiv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform2uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+   GLuint v2;
+
+} EVGL_API_Thread_Command_glUniform3ui;
+
+void (*orig_evgl_api_glUniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+
+static void
+_evgl_api_thread_glUniform3ui(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3ui *thread_param =
+      (EVGL_API_Thread_Command_glUniform3ui *)data;
+
+   orig_evgl_api_glUniform3ui(thread_param->location,
+                              thread_param->v0,
+                              thread_param->v1,
+                              thread_param->v2);
+
+}
+
+EAPI void
+glUniform3ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3ui(location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3ui thread_param_local;
+   EVGL_API_Thread_Command_glUniform3ui *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3uiv(GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glUniform3uiv;
+
+void (*orig_evgl_api_glUniform3uiv)(GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glUniform3uiv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform3uiv *thread_param =
+      (EVGL_API_Thread_Command_glUniform3uiv *)data;
+
+   orig_evgl_api_glUniform3uiv(thread_param->location,
+                               thread_param->count,
+                               thread_param->value);
+
+}
+
+EAPI void
+glUniform3uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform3uiv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform3uiv thread_param_local;
+   EVGL_API_Thread_Command_glUniform3uiv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform3uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+   GLuint v2;
+   GLuint v3;
+
+} EVGL_API_Thread_Command_glUniform4ui;
+
+void (*orig_evgl_api_glUniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+static void
+_evgl_api_thread_glUniform4ui(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4ui *thread_param =
+      (EVGL_API_Thread_Command_glUniform4ui *)data;
+
+   orig_evgl_api_glUniform4ui(thread_param->location,
+                              thread_param->v0,
+                              thread_param->v1,
+                              thread_param->v2,
+                              thread_param->v3);
+
+}
+
+EAPI void
+glUniform4ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4ui(location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4ui thread_param_local;
+   EVGL_API_Thread_Command_glUniform4ui *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4uiv(GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glUniform4uiv;
+
+void (*orig_evgl_api_glUniform4uiv)(GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glUniform4uiv(void *data)
+{
+   EVGL_API_Thread_Command_glUniform4uiv *thread_param =
+      (EVGL_API_Thread_Command_glUniform4uiv *)data;
+
+   orig_evgl_api_glUniform4uiv(thread_param->location,
+                               thread_param->count,
+                               thread_param->value);
+
+}
+
+EAPI void
+glUniform4uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniform4uiv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniform4uiv thread_param_local;
+   EVGL_API_Thread_Command_glUniform4uiv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniform4uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint uniformBlockIndex;
+   GLuint uniformBlockBinding;
+
+} EVGL_API_Thread_Command_glUniformBlockBinding;
+
+void (*orig_evgl_api_glUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+static void
+_evgl_api_thread_glUniformBlockBinding(void *data)
+{
+   EVGL_API_Thread_Command_glUniformBlockBinding *thread_param =
+      (EVGL_API_Thread_Command_glUniformBlockBinding *)data;
+
+   orig_evgl_api_glUniformBlockBinding(thread_param->program,
+                                       thread_param->uniformBlockIndex,
+                                       thread_param->uniformBlockBinding);
+
+}
+
+EAPI void
+glUniformBlockBinding_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformBlockBinding thread_param_local;
+   EVGL_API_Thread_Command_glUniformBlockBinding *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->uniformBlockIndex = uniformBlockIndex;
+   thread_param->uniformBlockBinding = uniformBlockBinding;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformBlockBinding,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix2x3fv;
+
+void (*orig_evgl_api_glUniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix2x3fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix2x3fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix2x3fv *)data;
+
+   orig_evgl_api_glUniformMatrix2x3fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix2x3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix2x3fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix2x3fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix2x3fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix2x3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix3x2fv;
+
+void (*orig_evgl_api_glUniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix3x2fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix3x2fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix3x2fv *)data;
+
+   orig_evgl_api_glUniformMatrix3x2fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix3x2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix3x2fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix3x2fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix3x2fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix3x2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix2x4fv;
+
+void (*orig_evgl_api_glUniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix2x4fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix2x4fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix2x4fv *)data;
+
+   orig_evgl_api_glUniformMatrix2x4fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix2x4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix2x4fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix2x4fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix2x4fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix2x4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix4x2fv;
+
+void (*orig_evgl_api_glUniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix4x2fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix4x2fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix4x2fv *)data;
+
+   orig_evgl_api_glUniformMatrix4x2fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix4x2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix4x2fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix4x2fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix4x2fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix4x2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix3x4fv;
+
+void (*orig_evgl_api_glUniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix3x4fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix3x4fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix3x4fv *)data;
+
+   orig_evgl_api_glUniformMatrix3x4fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix3x4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix3x4fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix3x4fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix3x4fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix3x4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glUniformMatrix4x3fv;
+
+void (*orig_evgl_api_glUniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glUniformMatrix4x3fv(void *data)
+{
+   EVGL_API_Thread_Command_glUniformMatrix4x3fv *thread_param =
+      (EVGL_API_Thread_Command_glUniformMatrix4x3fv *)data;
+
+   orig_evgl_api_glUniformMatrix4x3fv(thread_param->location,
+                                      thread_param->count,
+                                      thread_param->transpose,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glUniformMatrix4x3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUniformMatrix4x3fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUniformMatrix4x3fv thread_param_local;
+   EVGL_API_Thread_Command_glUniformMatrix4x3fv *thread_param = &thread_param_local;
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUniformMatrix4x3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glUnmapBuffer(GLenum target);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLenum target;
+
+} EVGL_API_Thread_Command_glUnmapBuffer;
+
+GLboolean (*orig_evgl_api_glUnmapBuffer)(GLenum target);
+
+static void
+_evgl_api_thread_glUnmapBuffer(void *data)
+{
+   EVGL_API_Thread_Command_glUnmapBuffer *thread_param =
+      (EVGL_API_Thread_Command_glUnmapBuffer *)data;
+
+   thread_param->return_value = orig_evgl_api_glUnmapBuffer(thread_param->target);
+
+}
+
+EAPI GLboolean
+glUnmapBuffer_evgl_api_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glUnmapBuffer(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUnmapBuffer thread_param_local;
+   EVGL_API_Thread_Command_glUnmapBuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUnmapBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glVertexAttribDivisor(GLuint index, GLuint divisor);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLuint divisor;
+
+} EVGL_API_Thread_Command_glVertexAttribDivisor;
+
+void (*orig_evgl_api_glVertexAttribDivisor)(GLuint index, GLuint divisor);
+
+static void
+_evgl_api_thread_glVertexAttribDivisor(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribDivisor *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribDivisor *)data;
+
+   orig_evgl_api_glVertexAttribDivisor(thread_param->index,
+                                       thread_param->divisor);
+
+}
+
+EAPI void
+glVertexAttribDivisor_evgl_api_thread_cmd(GLuint index, GLuint divisor)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribDivisor(index, divisor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribDivisor thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribDivisor *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->divisor = divisor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribDivisor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   GLint v3;
+
+} EVGL_API_Thread_Command_glVertexAttribI4i;
+
+void (*orig_evgl_api_glVertexAttribI4i)(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+
+static void
+_evgl_api_thread_glVertexAttribI4i(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribI4i *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribI4i *)data;
+
+   orig_evgl_api_glVertexAttribI4i(thread_param->index,
+                                   thread_param->v0,
+                                   thread_param->v1,
+                                   thread_param->v2,
+                                   thread_param->v3);
+
+}
+
+EAPI void
+glVertexAttribI4i_evgl_api_thread_cmd(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribI4i(index, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribI4i thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribI4i *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribI4i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribI4iv(GLuint index, const GLint *v);
+ */
+
+typedef struct
+{
+   GLuint index;
+   const GLint *v;
+
+} EVGL_API_Thread_Command_glVertexAttribI4iv;
+
+void (*orig_evgl_api_glVertexAttribI4iv)(GLuint index, const GLint *v);
+
+static void
+_evgl_api_thread_glVertexAttribI4iv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribI4iv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribI4iv *)data;
+
+   orig_evgl_api_glVertexAttribI4iv(thread_param->index,
+                                    thread_param->v);
+
+}
+
+EAPI void
+glVertexAttribI4iv_evgl_api_thread_cmd(GLuint index, const GLint *v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribI4iv(index, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribI4iv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribI4iv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->v = v;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribI4iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLuint v0;
+   GLuint v1;
+   GLuint v2;
+   GLuint v3;
+
+} EVGL_API_Thread_Command_glVertexAttribI4ui;
+
+void (*orig_evgl_api_glVertexAttribI4ui)(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+static void
+_evgl_api_thread_glVertexAttribI4ui(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribI4ui *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribI4ui *)data;
+
+   orig_evgl_api_glVertexAttribI4ui(thread_param->index,
+                                    thread_param->v0,
+                                    thread_param->v1,
+                                    thread_param->v2,
+                                    thread_param->v3);
+
+}
+
+EAPI void
+glVertexAttribI4ui_evgl_api_thread_cmd(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribI4ui(index, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribI4ui thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribI4ui *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribI4ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribI4uiv(GLuint index, const GLuint *v);
+ */
+
+typedef struct
+{
+   GLuint index;
+   const GLuint *v;
+
+} EVGL_API_Thread_Command_glVertexAttribI4uiv;
+
+void (*orig_evgl_api_glVertexAttribI4uiv)(GLuint index, const GLuint *v);
+
+static void
+_evgl_api_thread_glVertexAttribI4uiv(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribI4uiv *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribI4uiv *)data;
+
+   orig_evgl_api_glVertexAttribI4uiv(thread_param->index,
+                                     thread_param->v);
+
+}
+
+EAPI void
+glVertexAttribI4uiv_evgl_api_thread_cmd(GLuint index, const GLuint *v)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribI4uiv(index, v);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribI4uiv thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribI4uiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->v = v;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribI4uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLint size;
+   GLenum type;
+   GLsizei stride;
+   const GLvoid *pointer;
+
+} EVGL_API_Thread_Command_glVertexAttribIPointer;
+
+void (*orig_evgl_api_glVertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+static void
+_evgl_api_thread_glVertexAttribIPointer(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribIPointer *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribIPointer *)data;
+
+   orig_evgl_api_glVertexAttribIPointer(thread_param->index,
+                                        thread_param->size,
+                                        thread_param->type,
+                                        thread_param->stride,
+                                        thread_param->pointer);
+
+}
+
+EAPI void
+glVertexAttribIPointer_evgl_api_thread_cmd(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribIPointer(index, size, type, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribIPointer thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribIPointer *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribIPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glWaitSync(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+ */
+
+typedef struct
+{
+   GLsync sync;
+   GLbitfield flags;
+   EvasGLuint64 timeout;
+
+} EVGL_API_Thread_Command_glWaitSync;
+
+void (*orig_evgl_api_glWaitSync)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+static void
+_evgl_api_thread_glWaitSync(void *data)
+{
+   EVGL_API_Thread_Command_glWaitSync *thread_param =
+      (EVGL_API_Thread_Command_glWaitSync *)data;
+
+   orig_evgl_api_glWaitSync(thread_param->sync,
+                            thread_param->flags,
+                            thread_param->timeout);
+
+}
+
+EAPI void
+glWaitSync_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glWaitSync(sync, flags, timeout);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glWaitSync thread_param_local;
+   EVGL_API_Thread_Command_glWaitSync *thread_param = &thread_param_local;
+
+   thread_param->sync = sync;
+   thread_param->flags = flags;
+   thread_param->timeout = timeout;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glWaitSync,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+ */
+
+typedef struct
+{
+   GLuint num_groups_x;
+   GLuint num_groups_y;
+   GLuint num_groups_z;
+
+} EVGL_API_Thread_Command_glDispatchCompute;
+
+void (*orig_evgl_api_glDispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+
+static void
+_evgl_api_thread_glDispatchCompute(void *data)
+{
+   EVGL_API_Thread_Command_glDispatchCompute *thread_param =
+      (EVGL_API_Thread_Command_glDispatchCompute *)data;
+
+   orig_evgl_api_glDispatchCompute(thread_param->num_groups_x,
+                                   thread_param->num_groups_y,
+                                   thread_param->num_groups_z);
+
+}
+
+EAPI void
+glDispatchCompute_evgl_api_thread_cmd(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDispatchCompute thread_param_local;
+   EVGL_API_Thread_Command_glDispatchCompute *thread_param = &thread_param_local;
+
+   thread_param->num_groups_x = num_groups_x;
+   thread_param->num_groups_y = num_groups_y;
+   thread_param->num_groups_z = num_groups_z;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDispatchCompute,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDispatchComputeIndirect(GLintptr indirect);
+ */
+
+typedef struct
+{
+   GLintptr indirect;
+
+} EVGL_API_Thread_Command_glDispatchComputeIndirect;
+
+void (*orig_evgl_api_glDispatchComputeIndirect)(GLintptr indirect);
+
+static void
+_evgl_api_thread_glDispatchComputeIndirect(void *data)
+{
+   EVGL_API_Thread_Command_glDispatchComputeIndirect *thread_param =
+      (EVGL_API_Thread_Command_glDispatchComputeIndirect *)data;
+
+   orig_evgl_api_glDispatchComputeIndirect(thread_param->indirect);
+
+}
+
+EAPI void
+glDispatchComputeIndirect_evgl_api_thread_cmd(GLintptr indirect)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDispatchComputeIndirect(indirect);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDispatchComputeIndirect thread_param_local;
+   EVGL_API_Thread_Command_glDispatchComputeIndirect *thread_param = &thread_param_local;
+
+   thread_param->indirect = indirect;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDispatchComputeIndirect,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawArraysIndirect(GLenum mode, const void *indirect);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   const void *indirect;
+
+} EVGL_API_Thread_Command_glDrawArraysIndirect;
+
+void (*orig_evgl_api_glDrawArraysIndirect)(GLenum mode, const void *indirect);
+
+static void
+_evgl_api_thread_glDrawArraysIndirect(void *data)
+{
+   EVGL_API_Thread_Command_glDrawArraysIndirect *thread_param =
+      (EVGL_API_Thread_Command_glDrawArraysIndirect *)data;
+
+   orig_evgl_api_glDrawArraysIndirect(thread_param->mode,
+                                      thread_param->indirect);
+
+}
+
+EAPI void
+glDrawArraysIndirect_evgl_api_thread_cmd(GLenum mode, const void *indirect)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawArraysIndirect(mode, indirect);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawArraysIndirect thread_param_local;
+   EVGL_API_Thread_Command_glDrawArraysIndirect *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->indirect = indirect;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawArraysIndirect,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLenum type;
+   const void *indirect;
+
+} EVGL_API_Thread_Command_glDrawElementsIndirect;
+
+void (*orig_evgl_api_glDrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect);
+
+static void
+_evgl_api_thread_glDrawElementsIndirect(void *data)
+{
+   EVGL_API_Thread_Command_glDrawElementsIndirect *thread_param =
+      (EVGL_API_Thread_Command_glDrawElementsIndirect *)data;
+
+   orig_evgl_api_glDrawElementsIndirect(thread_param->mode,
+                                        thread_param->type,
+                                        thread_param->indirect);
+
+}
+
+EAPI void
+glDrawElementsIndirect_evgl_api_thread_cmd(GLenum mode, GLenum type, const void *indirect)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDrawElementsIndirect(mode, type, indirect);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDrawElementsIndirect thread_param_local;
+   EVGL_API_Thread_Command_glDrawElementsIndirect *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->type = type;
+   thread_param->indirect = indirect;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDrawElementsIndirect,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+
+} EVGL_API_Thread_Command_glFramebufferParameteri;
+
+void (*orig_evgl_api_glFramebufferParameteri)(GLenum target, GLenum pname, GLint param);
+
+static void
+_evgl_api_thread_glFramebufferParameteri(void *data)
+{
+   EVGL_API_Thread_Command_glFramebufferParameteri *thread_param =
+      (EVGL_API_Thread_Command_glFramebufferParameteri *)data;
+
+   orig_evgl_api_glFramebufferParameteri(thread_param->target,
+                                         thread_param->pname,
+                                         thread_param->param);
+
+}
+
+EAPI void
+glFramebufferParameteri_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glFramebufferParameteri(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glFramebufferParameteri thread_param_local;
+   EVGL_API_Thread_Command_glFramebufferParameteri *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glFramebufferParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetFramebufferParameteriv;
+
+void (*orig_evgl_api_glGetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetFramebufferParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetFramebufferParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetFramebufferParameteriv *)data;
+
+   orig_evgl_api_glGetFramebufferParameteriv(thread_param->target,
+                                             thread_param->pname,
+                                             thread_param->params);
+
+}
+
+EAPI void
+glGetFramebufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetFramebufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetFramebufferParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetFramebufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetFramebufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum programInterface;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetProgramInterfaceiv;
+
+void (*orig_evgl_api_glGetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetProgramInterfaceiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramInterfaceiv *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramInterfaceiv *)data;
+
+   orig_evgl_api_glGetProgramInterfaceiv(thread_param->program,
+                                         thread_param->programInterface,
+                                         thread_param->pname,
+                                         thread_param->params);
+
+}
+
+EAPI void
+glGetProgramInterfaceiv_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramInterfaceiv(program, programInterface, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramInterfaceiv thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramInterfaceiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->programInterface = programInterface;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramInterfaceiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glGetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLuint program;
+   GLenum programInterface;
+   const GLchar *name;
+
+} EVGL_API_Thread_Command_glGetProgramResourceIndex;
+
+GLuint (*orig_evgl_api_glGetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name);
+
+static void
+_evgl_api_thread_glGetProgramResourceIndex(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramResourceIndex *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramResourceIndex *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetProgramResourceIndex(thread_param->program,
+                                                                        thread_param->programInterface,
+                                                                        thread_param->name);
+
+}
+
+EAPI GLuint
+glGetProgramResourceIndex_evgl_api_thread_cmd(GLuint program, GLenum programInterface, const GLchar *name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetProgramResourceIndex(program, programInterface, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramResourceIndex thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramResourceIndex *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->programInterface = programInterface;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramResourceIndex,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum programInterface;
+   GLuint index;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *name;
+
+} EVGL_API_Thread_Command_glGetProgramResourceName;
+
+void (*orig_evgl_api_glGetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+
+static void
+_evgl_api_thread_glGetProgramResourceName(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramResourceName *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramResourceName *)data;
+
+   orig_evgl_api_glGetProgramResourceName(thread_param->program,
+                                          thread_param->programInterface,
+                                          thread_param->index,
+                                          thread_param->bufSize,
+                                          thread_param->length,
+                                          thread_param->name);
+
+}
+
+EAPI void
+glGetProgramResourceName_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramResourceName(program, programInterface, index, bufSize, length, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramResourceName thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramResourceName *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->programInterface = programInterface;
+   thread_param->index = index;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramResourceName,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum programInterface;
+   GLuint index;
+   GLsizei propCount;
+   const GLenum *props;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetProgramResourceiv;
+
+void (*orig_evgl_api_glGetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+
+static void
+_evgl_api_thread_glGetProgramResourceiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramResourceiv *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramResourceiv *)data;
+
+   orig_evgl_api_glGetProgramResourceiv(thread_param->program,
+                                        thread_param->programInterface,
+                                        thread_param->index,
+                                        thread_param->propCount,
+                                        thread_param->props,
+                                        thread_param->bufSize,
+                                        thread_param->length,
+                                        thread_param->params);
+
+}
+
+EAPI void
+glGetProgramResourceiv_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramResourceiv thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramResourceiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->programInterface = programInterface;
+   thread_param->index = index;
+   thread_param->propCount = propCount;
+   thread_param->props = props;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramResourceiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   GLenum programInterface;
+   const GLchar *name;
+
+} EVGL_API_Thread_Command_glGetProgramResourceLocation;
+
+GLint (*orig_evgl_api_glGetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name);
+
+static void
+_evgl_api_thread_glGetProgramResourceLocation(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramResourceLocation *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramResourceLocation *)data;
+
+   thread_param->return_value = orig_evgl_api_glGetProgramResourceLocation(thread_param->program,
+                                                                           thread_param->programInterface,
+                                                                           thread_param->name);
+
+}
+
+EAPI GLint
+glGetProgramResourceLocation_evgl_api_thread_cmd(GLuint program, GLenum programInterface, const GLchar *name)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glGetProgramResourceLocation(program, programInterface, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramResourceLocation thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramResourceLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->programInterface = programInterface;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramResourceLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+   GLbitfield stages;
+   GLuint program;
+
+} EVGL_API_Thread_Command_glUseProgramStages;
+
+void (*orig_evgl_api_glUseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program);
+
+static void
+_evgl_api_thread_glUseProgramStages(void *data)
+{
+   EVGL_API_Thread_Command_glUseProgramStages *thread_param =
+      (EVGL_API_Thread_Command_glUseProgramStages *)data;
+
+   orig_evgl_api_glUseProgramStages(thread_param->pipeline,
+                                    thread_param->stages,
+                                    thread_param->program);
+
+}
+
+EAPI void
+glUseProgramStages_evgl_api_thread_cmd(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glUseProgramStages(pipeline, stages, program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glUseProgramStages thread_param_local;
+   EVGL_API_Thread_Command_glUseProgramStages *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+   thread_param->stages = stages;
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glUseProgramStages,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glActiveShaderProgram(GLuint pipeline, GLuint program);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+   GLuint program;
+
+} EVGL_API_Thread_Command_glActiveShaderProgram;
+
+void (*orig_evgl_api_glActiveShaderProgram)(GLuint pipeline, GLuint program);
+
+static void
+_evgl_api_thread_glActiveShaderProgram(void *data)
+{
+   EVGL_API_Thread_Command_glActiveShaderProgram *thread_param =
+      (EVGL_API_Thread_Command_glActiveShaderProgram *)data;
+
+   orig_evgl_api_glActiveShaderProgram(thread_param->pipeline,
+                                       thread_param->program);
+
+}
+
+EAPI void
+glActiveShaderProgram_evgl_api_thread_cmd(GLuint pipeline, GLuint program)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glActiveShaderProgram(pipeline, program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glActiveShaderProgram thread_param_local;
+   EVGL_API_Thread_Command_glActiveShaderProgram *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glActiveShaderProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLenum type;
+   GLsizei count;
+   const GLchar *const*strings;
+
+} EVGL_API_Thread_Command_glCreateShaderProgramv;
+
+GLuint (*orig_evgl_api_glCreateShaderProgramv)(GLenum type, GLsizei count, const GLchar *const*strings);
+
+static void
+_evgl_api_thread_glCreateShaderProgramv(void *data)
+{
+   EVGL_API_Thread_Command_glCreateShaderProgramv *thread_param =
+      (EVGL_API_Thread_Command_glCreateShaderProgramv *)data;
+
+   thread_param->return_value = orig_evgl_api_glCreateShaderProgramv(thread_param->type,
+                                                                     thread_param->count,
+                                                                     thread_param->strings);
+
+}
+
+EAPI GLuint
+glCreateShaderProgramv_evgl_api_thread_cmd(GLenum type, GLsizei count, const GLchar *const*strings)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glCreateShaderProgramv(type, count, strings);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glCreateShaderProgramv thread_param_local;
+   EVGL_API_Thread_Command_glCreateShaderProgramv *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+   thread_param->count = count;
+   thread_param->strings = strings;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glCreateShaderProgramv,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glBindProgramPipeline(GLuint pipeline);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+
+} EVGL_API_Thread_Command_glBindProgramPipeline;
+
+void (*orig_evgl_api_glBindProgramPipeline)(GLuint pipeline);
+
+static void
+_evgl_api_thread_glBindProgramPipeline(void *data)
+{
+   EVGL_API_Thread_Command_glBindProgramPipeline *thread_param =
+      (EVGL_API_Thread_Command_glBindProgramPipeline *)data;
+
+   orig_evgl_api_glBindProgramPipeline(thread_param->pipeline);
+
+}
+
+EAPI void
+glBindProgramPipeline_evgl_api_thread_cmd(GLuint pipeline)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindProgramPipeline(pipeline);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindProgramPipeline thread_param_local;
+   EVGL_API_Thread_Command_glBindProgramPipeline *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindProgramPipeline,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteProgramPipelines(GLsizei n, const GLuint *pipelines);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *pipelines;
+
+} EVGL_API_Thread_Command_glDeleteProgramPipelines;
+
+void (*orig_evgl_api_glDeleteProgramPipelines)(GLsizei n, const GLuint *pipelines);
+
+static void
+_evgl_api_thread_glDeleteProgramPipelines(void *data)
+{
+   EVGL_API_Thread_Command_glDeleteProgramPipelines *thread_param =
+      (EVGL_API_Thread_Command_glDeleteProgramPipelines *)data;
+
+   orig_evgl_api_glDeleteProgramPipelines(thread_param->n,
+                                          thread_param->pipelines);
+
+}
+
+EAPI void
+glDeleteProgramPipelines_evgl_api_thread_cmd(GLsizei n, const GLuint *pipelines)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glDeleteProgramPipelines(n, pipelines);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glDeleteProgramPipelines thread_param_local;
+   EVGL_API_Thread_Command_glDeleteProgramPipelines *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->pipelines = pipelines;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glDeleteProgramPipelines,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenProgramPipelines(GLsizei n, GLuint *pipelines);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *pipelines;
+
+} EVGL_API_Thread_Command_glGenProgramPipelines;
+
+void (*orig_evgl_api_glGenProgramPipelines)(GLsizei n, GLuint *pipelines);
+
+static void
+_evgl_api_thread_glGenProgramPipelines(void *data)
+{
+   EVGL_API_Thread_Command_glGenProgramPipelines *thread_param =
+      (EVGL_API_Thread_Command_glGenProgramPipelines *)data;
+
+   orig_evgl_api_glGenProgramPipelines(thread_param->n,
+                                       thread_param->pipelines);
+
+}
+
+EAPI void
+glGenProgramPipelines_evgl_api_thread_cmd(GLsizei n, GLuint *pipelines)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGenProgramPipelines(n, pipelines);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGenProgramPipelines thread_param_local;
+   EVGL_API_Thread_Command_glGenProgramPipelines *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->pipelines = pipelines;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGenProgramPipelines,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsProgramPipeline(GLuint pipeline);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint pipeline;
+
+} EVGL_API_Thread_Command_glIsProgramPipeline;
+
+GLboolean (*orig_evgl_api_glIsProgramPipeline)(GLuint pipeline);
+
+static void
+_evgl_api_thread_glIsProgramPipeline(void *data)
+{
+   EVGL_API_Thread_Command_glIsProgramPipeline *thread_param =
+      (EVGL_API_Thread_Command_glIsProgramPipeline *)data;
+
+   thread_param->return_value = orig_evgl_api_glIsProgramPipeline(thread_param->pipeline);
+
+}
+
+EAPI GLboolean
+glIsProgramPipeline_evgl_api_thread_cmd(GLuint pipeline)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api_glIsProgramPipeline(pipeline);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glIsProgramPipeline thread_param_local;
+   EVGL_API_Thread_Command_glIsProgramPipeline *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glIsProgramPipeline,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetProgramPipelineiv;
+
+void (*orig_evgl_api_glGetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetProgramPipelineiv(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramPipelineiv *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramPipelineiv *)data;
+
+   orig_evgl_api_glGetProgramPipelineiv(thread_param->pipeline,
+                                        thread_param->pname,
+                                        thread_param->params);
+
+}
+
+EAPI void
+glGetProgramPipelineiv_evgl_api_thread_cmd(GLuint pipeline, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramPipelineiv(pipeline, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramPipelineiv thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramPipelineiv *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramPipelineiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1i(GLuint program, GLint location, GLint v0);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLint v0;
+
+} EVGL_API_Thread_Command_glProgramUniform1i;
+
+void (*orig_evgl_api_glProgramUniform1i)(GLuint program, GLint location, GLint v0);
+
+static void
+_evgl_api_thread_glProgramUniform1i(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1i *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1i *)data;
+
+   orig_evgl_api_glProgramUniform1i(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0);
+
+}
+
+EAPI void
+glProgramUniform1i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1i(program, location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1i thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1i *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLint v0;
+   GLint v1;
+
+} EVGL_API_Thread_Command_glProgramUniform2i;
+
+void (*orig_evgl_api_glProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1);
+
+static void
+_evgl_api_thread_glProgramUniform2i(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2i *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2i *)data;
+
+   orig_evgl_api_glProgramUniform2i(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1);
+
+}
+
+EAPI void
+glProgramUniform2i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2i(program, location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2i thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2i *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+
+} EVGL_API_Thread_Command_glProgramUniform3i;
+
+void (*orig_evgl_api_glProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+
+static void
+_evgl_api_thread_glProgramUniform3i(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3i *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3i *)data;
+
+   orig_evgl_api_glProgramUniform3i(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1,
+                                    thread_param->v2);
+
+}
+
+EAPI void
+glProgramUniform3i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3i(program, location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3i thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3i *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   GLint v3;
+
+} EVGL_API_Thread_Command_glProgramUniform4i;
+
+void (*orig_evgl_api_glProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+
+static void
+_evgl_api_thread_glProgramUniform4i(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4i *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4i *)data;
+
+   orig_evgl_api_glProgramUniform4i(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1,
+                                    thread_param->v2,
+                                    thread_param->v3);
+
+}
+
+EAPI void
+glProgramUniform4i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4i(program, location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4i thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4i *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLuint v0;
+
+} EVGL_API_Thread_Command_glProgramUniform1ui;
+
+void (*orig_evgl_api_glProgramUniform1ui)(GLuint program, GLint location, GLuint v0);
+
+static void
+_evgl_api_thread_glProgramUniform1ui(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1ui *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1ui *)data;
+
+   orig_evgl_api_glProgramUniform1ui(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->v0);
+
+}
+
+EAPI void
+glProgramUniform1ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1ui(program, location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1ui thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1ui *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+
+} EVGL_API_Thread_Command_glProgramUniform2ui;
+
+void (*orig_evgl_api_glProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1);
+
+static void
+_evgl_api_thread_glProgramUniform2ui(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2ui *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2ui *)data;
+
+   orig_evgl_api_glProgramUniform2ui(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->v0,
+                                     thread_param->v1);
+
+}
+
+EAPI void
+glProgramUniform2ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2ui(program, location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2ui thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2ui *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+   GLuint v2;
+
+} EVGL_API_Thread_Command_glProgramUniform3ui;
+
+void (*orig_evgl_api_glProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+
+static void
+_evgl_api_thread_glProgramUniform3ui(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3ui *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3ui *)data;
+
+   orig_evgl_api_glProgramUniform3ui(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->v0,
+                                     thread_param->v1,
+                                     thread_param->v2);
+
+}
+
+EAPI void
+glProgramUniform3ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3ui(program, location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3ui thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3ui *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLuint v0;
+   GLuint v1;
+   GLuint v2;
+   GLuint v3;
+
+} EVGL_API_Thread_Command_glProgramUniform4ui;
+
+void (*orig_evgl_api_glProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+static void
+_evgl_api_thread_glProgramUniform4ui(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4ui *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4ui *)data;
+
+   orig_evgl_api_glProgramUniform4ui(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->v0,
+                                     thread_param->v1,
+                                     thread_param->v2,
+                                     thread_param->v3);
+
+}
+
+EAPI void
+glProgramUniform4ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4ui(program, location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4ui thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4ui *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4ui,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLfloat v0;
+
+} EVGL_API_Thread_Command_glProgramUniform1f;
+
+void (*orig_evgl_api_glProgramUniform1f)(GLuint program, GLint location, GLfloat v0);
+
+static void
+_evgl_api_thread_glProgramUniform1f(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1f *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1f *)data;
+
+   orig_evgl_api_glProgramUniform1f(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0);
+
+}
+
+EAPI void
+glProgramUniform1f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1f(program, location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1f thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1f *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+
+} EVGL_API_Thread_Command_glProgramUniform2f;
+
+void (*orig_evgl_api_glProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+
+static void
+_evgl_api_thread_glProgramUniform2f(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2f *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2f *)data;
+
+   orig_evgl_api_glProgramUniform2f(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1);
+
+}
+
+EAPI void
+glProgramUniform2f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2f(program, location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2f thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2f *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+
+} EVGL_API_Thread_Command_glProgramUniform3f;
+
+void (*orig_evgl_api_glProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+
+static void
+_evgl_api_thread_glProgramUniform3f(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3f *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3f *)data;
+
+   orig_evgl_api_glProgramUniform3f(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1,
+                                    thread_param->v2);
+
+}
+
+EAPI void
+glProgramUniform3f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3f(program, location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3f thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3f *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+   GLfloat v3;
+
+} EVGL_API_Thread_Command_glProgramUniform4f;
+
+void (*orig_evgl_api_glProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+
+static void
+_evgl_api_thread_glProgramUniform4f(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4f *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4f *)data;
+
+   orig_evgl_api_glProgramUniform4f(thread_param->program,
+                                    thread_param->location,
+                                    thread_param->v0,
+                                    thread_param->v1,
+                                    thread_param->v2,
+                                    thread_param->v3);
+
+}
+
+EAPI void
+glProgramUniform4f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4f(program, location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4f thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4f *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform1iv;
+
+void (*orig_evgl_api_glProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+static void
+_evgl_api_thread_glProgramUniform1iv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1iv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1iv *)data;
+
+   orig_evgl_api_glProgramUniform1iv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform1iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1iv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1iv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1iv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform2iv;
+
+void (*orig_evgl_api_glProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+static void
+_evgl_api_thread_glProgramUniform2iv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2iv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2iv *)data;
+
+   orig_evgl_api_glProgramUniform2iv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform2iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2iv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2iv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2iv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform3iv;
+
+void (*orig_evgl_api_glProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+static void
+_evgl_api_thread_glProgramUniform3iv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3iv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3iv *)data;
+
+   orig_evgl_api_glProgramUniform3iv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform3iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3iv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3iv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3iv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform4iv;
+
+void (*orig_evgl_api_glProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+static void
+_evgl_api_thread_glProgramUniform4iv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4iv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4iv *)data;
+
+   orig_evgl_api_glProgramUniform4iv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform4iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4iv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4iv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4iv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform1uiv;
+
+void (*orig_evgl_api_glProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glProgramUniform1uiv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1uiv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1uiv *)data;
+
+   orig_evgl_api_glProgramUniform1uiv(thread_param->program,
+                                      thread_param->location,
+                                      thread_param->count,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform1uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1uiv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1uiv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1uiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform2uiv;
+
+void (*orig_evgl_api_glProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glProgramUniform2uiv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2uiv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2uiv *)data;
+
+   orig_evgl_api_glProgramUniform2uiv(thread_param->program,
+                                      thread_param->location,
+                                      thread_param->count,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform2uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2uiv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2uiv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2uiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform3uiv;
+
+void (*orig_evgl_api_glProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glProgramUniform3uiv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3uiv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3uiv *)data;
+
+   orig_evgl_api_glProgramUniform3uiv(thread_param->program,
+                                      thread_param->location,
+                                      thread_param->count,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform3uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3uiv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3uiv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3uiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLuint *value;
+
+} EVGL_API_Thread_Command_glProgramUniform4uiv;
+
+void (*orig_evgl_api_glProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+static void
+_evgl_api_thread_glProgramUniform4uiv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4uiv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4uiv *)data;
+
+   orig_evgl_api_glProgramUniform4uiv(thread_param->program,
+                                      thread_param->location,
+                                      thread_param->count,
+                                      thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform4uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4uiv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4uiv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4uiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4uiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniform1fv;
+
+void (*orig_evgl_api_glProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniform1fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform1fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform1fv *)data;
+
+   orig_evgl_api_glProgramUniform1fv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform1fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform1fv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform1fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform1fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform1fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniform2fv;
+
+void (*orig_evgl_api_glProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniform2fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform2fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform2fv *)data;
+
+   orig_evgl_api_glProgramUniform2fv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform2fv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform2fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform2fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniform3fv;
+
+void (*orig_evgl_api_glProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniform3fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform3fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform3fv *)data;
+
+   orig_evgl_api_glProgramUniform3fv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform3fv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform3fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform3fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniform4fv;
+
+void (*orig_evgl_api_glProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniform4fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniform4fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniform4fv *)data;
+
+   orig_evgl_api_glProgramUniform4fv(thread_param->program,
+                                     thread_param->location,
+                                     thread_param->count,
+                                     thread_param->value);
+
+}
+
+EAPI void
+glProgramUniform4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniform4fv(program, location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniform4fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniform4fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniform4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix2fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix2fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix2fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix2fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix2fv(thread_param->program,
+                                           thread_param->location,
+                                           thread_param->count,
+                                           thread_param->transpose,
+                                           thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix2fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix2fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix2fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix3fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix3fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix3fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix3fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix3fv(thread_param->program,
+                                           thread_param->location,
+                                           thread_param->count,
+                                           thread_param->transpose,
+                                           thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix3fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix3fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix3fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix4fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix4fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix4fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix4fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix4fv(thread_param->program,
+                                           thread_param->location,
+                                           thread_param->count,
+                                           thread_param->transpose,
+                                           thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix4fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix4fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix4fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix2x3fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix2x3fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x3fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix2x3fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix2x3fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix2x3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix2x3fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x3fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x3fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix2x3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix3x2fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix3x2fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x2fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix3x2fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix3x2fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix3x2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix3x2fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x2fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x2fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix3x2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix2x4fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix2x4fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x4fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix2x4fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix2x4fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix2x4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix2x4fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x4fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix2x4fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix2x4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix4x2fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix4x2fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x2fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix4x2fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix4x2fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix4x2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix4x2fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x2fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x2fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix4x2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix3x4fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix3x4fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x4fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix3x4fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix3x4fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix3x4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix3x4fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x4fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix3x4fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix3x4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+
+} EVGL_API_Thread_Command_glProgramUniformMatrix4x3fv;
+
+void (*orig_evgl_api_glProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+static void
+_evgl_api_thread_glProgramUniformMatrix4x3fv(void *data)
+{
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x3fv *thread_param =
+      (EVGL_API_Thread_Command_glProgramUniformMatrix4x3fv *)data;
+
+   orig_evgl_api_glProgramUniformMatrix4x3fv(thread_param->program,
+                                             thread_param->location,
+                                             thread_param->count,
+                                             thread_param->transpose,
+                                             thread_param->value);
+
+}
+
+EAPI void
+glProgramUniformMatrix4x3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glProgramUniformMatrix4x3fv(program, location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x3fv thread_param_local;
+   EVGL_API_Thread_Command_glProgramUniformMatrix4x3fv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glProgramUniformMatrix4x3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glValidateProgramPipeline(GLuint pipeline);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+
+} EVGL_API_Thread_Command_glValidateProgramPipeline;
+
+void (*orig_evgl_api_glValidateProgramPipeline)(GLuint pipeline);
+
+static void
+_evgl_api_thread_glValidateProgramPipeline(void *data)
+{
+   EVGL_API_Thread_Command_glValidateProgramPipeline *thread_param =
+      (EVGL_API_Thread_Command_glValidateProgramPipeline *)data;
+
+   orig_evgl_api_glValidateProgramPipeline(thread_param->pipeline);
+
+}
+
+EAPI void
+glValidateProgramPipeline_evgl_api_thread_cmd(GLuint pipeline)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glValidateProgramPipeline(pipeline);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glValidateProgramPipeline thread_param_local;
+   EVGL_API_Thread_Command_glValidateProgramPipeline *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glValidateProgramPipeline,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ */
+
+typedef struct
+{
+   GLuint pipeline;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *infoLog;
+
+} EVGL_API_Thread_Command_glGetProgramPipelineInfoLog;
+
+void (*orig_evgl_api_glGetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+
+static void
+_evgl_api_thread_glGetProgramPipelineInfoLog(void *data)
+{
+   EVGL_API_Thread_Command_glGetProgramPipelineInfoLog *thread_param =
+      (EVGL_API_Thread_Command_glGetProgramPipelineInfoLog *)data;
+
+   orig_evgl_api_glGetProgramPipelineInfoLog(thread_param->pipeline,
+                                             thread_param->bufSize,
+                                             thread_param->length,
+                                             thread_param->infoLog);
+
+}
+
+EAPI void
+glGetProgramPipelineInfoLog_evgl_api_thread_cmd(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetProgramPipelineInfoLog thread_param_local;
+   EVGL_API_Thread_Command_glGetProgramPipelineInfoLog *thread_param = &thread_param_local;
+
+   thread_param->pipeline = pipeline;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->infoLog = infoLog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetProgramPipelineInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+ */
+
+typedef struct
+{
+   GLuint unit;
+   GLuint texture;
+   GLint level;
+   GLboolean layered;
+   GLint layer;
+   GLenum access;
+   GLenum format;
+
+} EVGL_API_Thread_Command_glBindImageTexture;
+
+void (*orig_evgl_api_glBindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+
+static void
+_evgl_api_thread_glBindImageTexture(void *data)
+{
+   EVGL_API_Thread_Command_glBindImageTexture *thread_param =
+      (EVGL_API_Thread_Command_glBindImageTexture *)data;
+
+   orig_evgl_api_glBindImageTexture(thread_param->unit,
+                                    thread_param->texture,
+                                    thread_param->level,
+                                    thread_param->layered,
+                                    thread_param->layer,
+                                    thread_param->access,
+                                    thread_param->format);
+
+}
+
+EAPI void
+glBindImageTexture_evgl_api_thread_cmd(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindImageTexture(unit, texture, level, layered, layer, access, format);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindImageTexture thread_param_local;
+   EVGL_API_Thread_Command_glBindImageTexture *thread_param = &thread_param_local;
+
+   thread_param->unit = unit;
+   thread_param->texture = texture;
+   thread_param->level = level;
+   thread_param->layered = layered;
+   thread_param->layer = layer;
+   thread_param->access = access;
+   thread_param->format = format;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindImageTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetBooleani_v(GLenum target, GLuint index, GLboolean *data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint index;
+   GLboolean *data;
+
+} EVGL_API_Thread_Command_glGetBooleani_v;
+
+void (*orig_evgl_api_glGetBooleani_v)(GLenum target, GLuint index, GLboolean *data);
+
+static void
+_evgl_api_thread_glGetBooleani_v(void *data)
+{
+   EVGL_API_Thread_Command_glGetBooleani_v *thread_param =
+      (EVGL_API_Thread_Command_glGetBooleani_v *)data;
+
+   orig_evgl_api_glGetBooleani_v(thread_param->target,
+                                 thread_param->index,
+                                 thread_param->data);
+
+}
+
+EAPI void
+glGetBooleani_v_evgl_api_thread_cmd(GLenum target, GLuint index, GLboolean *data)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetBooleani_v(target, index, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetBooleani_v thread_param_local;
+   EVGL_API_Thread_Command_glGetBooleani_v *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->index = index;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetBooleani_v,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMemoryBarrier(GLbitfield barriers);
+ */
+
+typedef struct
+{
+   GLbitfield barriers;
+
+} EVGL_API_Thread_Command_glMemoryBarrier;
+
+void (*orig_evgl_api_glMemoryBarrier)(GLbitfield barriers);
+
+static void
+_evgl_api_thread_glMemoryBarrier(void *data)
+{
+   EVGL_API_Thread_Command_glMemoryBarrier *thread_param =
+      (EVGL_API_Thread_Command_glMemoryBarrier *)data;
+
+   orig_evgl_api_glMemoryBarrier(thread_param->barriers);
+
+}
+
+EAPI void
+glMemoryBarrier_evgl_api_thread_cmd(GLbitfield barriers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMemoryBarrier(barriers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMemoryBarrier thread_param_local;
+   EVGL_API_Thread_Command_glMemoryBarrier *thread_param = &thread_param_local;
+
+   thread_param->barriers = barriers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMemoryBarrier,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glMemoryBarrierByRegion(GLbitfield barriers);
+ */
+
+typedef struct
+{
+   GLbitfield barriers;
+
+} EVGL_API_Thread_Command_glMemoryBarrierByRegion;
+
+void (*orig_evgl_api_glMemoryBarrierByRegion)(GLbitfield barriers);
+
+static void
+_evgl_api_thread_glMemoryBarrierByRegion(void *data)
+{
+   EVGL_API_Thread_Command_glMemoryBarrierByRegion *thread_param =
+      (EVGL_API_Thread_Command_glMemoryBarrierByRegion *)data;
+
+   orig_evgl_api_glMemoryBarrierByRegion(thread_param->barriers);
+
+}
+
+EAPI void
+glMemoryBarrierByRegion_evgl_api_thread_cmd(GLbitfield barriers)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glMemoryBarrierByRegion(barriers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glMemoryBarrierByRegion thread_param_local;
+   EVGL_API_Thread_Command_glMemoryBarrierByRegion *thread_param = &thread_param_local;
+
+   thread_param->barriers = barriers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glMemoryBarrierByRegion,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei samples;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLboolean fixedsamplelocations;
+
+} EVGL_API_Thread_Command_glTexStorage2DMultisample;
+
+void (*orig_evgl_api_glTexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+
+static void
+_evgl_api_thread_glTexStorage2DMultisample(void *data)
+{
+   EVGL_API_Thread_Command_glTexStorage2DMultisample *thread_param =
+      (EVGL_API_Thread_Command_glTexStorage2DMultisample *)data;
+
+   orig_evgl_api_glTexStorage2DMultisample(thread_param->target,
+                                           thread_param->samples,
+                                           thread_param->internalformat,
+                                           thread_param->width,
+                                           thread_param->height,
+                                           thread_param->fixedsamplelocations);
+
+}
+
+EAPI void
+glTexStorage2DMultisample_evgl_api_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glTexStorage2DMultisample thread_param_local;
+   EVGL_API_Thread_Command_glTexStorage2DMultisample *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->samples = samples;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->fixedsamplelocations = fixedsamplelocations;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glTexStorage2DMultisample,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetMultisamplefv(GLenum pname, GLuint index, GLfloat *val);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLuint index;
+   GLfloat *val;
+
+} EVGL_API_Thread_Command_glGetMultisamplefv;
+
+void (*orig_evgl_api_glGetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val);
+
+static void
+_evgl_api_thread_glGetMultisamplefv(void *data)
+{
+   EVGL_API_Thread_Command_glGetMultisamplefv *thread_param =
+      (EVGL_API_Thread_Command_glGetMultisamplefv *)data;
+
+   orig_evgl_api_glGetMultisamplefv(thread_param->pname,
+                                    thread_param->index,
+                                    thread_param->val);
+
+}
+
+EAPI void
+glGetMultisamplefv_evgl_api_thread_cmd(GLenum pname, GLuint index, GLfloat *val)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetMultisamplefv(pname, index, val);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetMultisamplefv thread_param_local;
+   EVGL_API_Thread_Command_glGetMultisamplefv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->index = index;
+   thread_param->val = val;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetMultisamplefv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glSampleMaski(GLuint maskNumber, GLbitfield mask);
+ */
+
+typedef struct
+{
+   GLuint maskNumber;
+   GLbitfield mask;
+
+} EVGL_API_Thread_Command_glSampleMaski;
+
+void (*orig_evgl_api_glSampleMaski)(GLuint maskNumber, GLbitfield mask);
+
+static void
+_evgl_api_thread_glSampleMaski(void *data)
+{
+   EVGL_API_Thread_Command_glSampleMaski *thread_param =
+      (EVGL_API_Thread_Command_glSampleMaski *)data;
+
+   orig_evgl_api_glSampleMaski(thread_param->maskNumber,
+                               thread_param->mask);
+
+}
+
+EAPI void
+glSampleMaski_evgl_api_thread_cmd(GLuint maskNumber, GLbitfield mask)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glSampleMaski(maskNumber, mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glSampleMaski thread_param_local;
+   EVGL_API_Thread_Command_glSampleMaski *thread_param = &thread_param_local;
+
+   thread_param->maskNumber = maskNumber;
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glSampleMaski,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_API_Thread_Command_glGetTexLevelParameteriv;
+
+void (*orig_evgl_api_glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+
+static void
+_evgl_api_thread_glGetTexLevelParameteriv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexLevelParameteriv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexLevelParameteriv *)data;
+
+   orig_evgl_api_glGetTexLevelParameteriv(thread_param->target,
+                                          thread_param->level,
+                                          thread_param->pname,
+                                          thread_param->params);
+
+}
+
+EAPI void
+glGetTexLevelParameteriv_evgl_api_thread_cmd(GLenum target, GLint level, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexLevelParameteriv(target, level, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexLevelParameteriv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexLevelParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexLevelParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_API_Thread_Command_glGetTexLevelParameterfv;
+
+void (*orig_evgl_api_glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+
+static void
+_evgl_api_thread_glGetTexLevelParameterfv(void *data)
+{
+   EVGL_API_Thread_Command_glGetTexLevelParameterfv *thread_param =
+      (EVGL_API_Thread_Command_glGetTexLevelParameterfv *)data;
+
+   orig_evgl_api_glGetTexLevelParameterfv(thread_param->target,
+                                          thread_param->level,
+                                          thread_param->pname,
+                                          thread_param->params);
+
+}
+
+EAPI void
+glGetTexLevelParameterfv_evgl_api_thread_cmd(GLenum target, GLint level, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glGetTexLevelParameterfv(target, level, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glGetTexLevelParameterfv thread_param_local;
+   EVGL_API_Thread_Command_glGetTexLevelParameterfv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glGetTexLevelParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+ */
+
+typedef struct
+{
+   GLuint bindingindex;
+   GLuint buffer;
+   GLintptr offset;
+   GLsizei stride;
+
+} EVGL_API_Thread_Command_glBindVertexBuffer;
+
+void (*orig_evgl_api_glBindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+
+static void
+_evgl_api_thread_glBindVertexBuffer(void *data)
+{
+   EVGL_API_Thread_Command_glBindVertexBuffer *thread_param =
+      (EVGL_API_Thread_Command_glBindVertexBuffer *)data;
+
+   orig_evgl_api_glBindVertexBuffer(thread_param->bindingindex,
+                                    thread_param->buffer,
+                                    thread_param->offset,
+                                    thread_param->stride);
+
+}
+
+EAPI void
+glBindVertexBuffer_evgl_api_thread_cmd(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glBindVertexBuffer(bindingindex, buffer, offset, stride);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glBindVertexBuffer thread_param_local;
+   EVGL_API_Thread_Command_glBindVertexBuffer *thread_param = &thread_param_local;
+
+   thread_param->bindingindex = bindingindex;
+   thread_param->buffer = buffer;
+   thread_param->offset = offset;
+   thread_param->stride = stride;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glBindVertexBuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+ */
+
+typedef struct
+{
+   GLuint attribindex;
+   GLint size;
+   GLenum type;
+   GLboolean normalized;
+   GLuint relativeoffset;
+
+} EVGL_API_Thread_Command_glVertexAttribFormat;
+
+void (*orig_evgl_api_glVertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+
+static void
+_evgl_api_thread_glVertexAttribFormat(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribFormat *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribFormat *)data;
+
+   orig_evgl_api_glVertexAttribFormat(thread_param->attribindex,
+                                      thread_param->size,
+                                      thread_param->type,
+                                      thread_param->normalized,
+                                      thread_param->relativeoffset);
+
+}
+
+EAPI void
+glVertexAttribFormat_evgl_api_thread_cmd(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribFormat thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribFormat *thread_param = &thread_param_local;
+
+   thread_param->attribindex = attribindex;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->normalized = normalized;
+   thread_param->relativeoffset = relativeoffset;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribFormat,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+ */
+
+typedef struct
+{
+   GLuint attribindex;
+   GLint size;
+   GLenum type;
+   GLuint relativeoffset;
+
+} EVGL_API_Thread_Command_glVertexAttribIFormat;
+
+void (*orig_evgl_api_glVertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+
+static void
+_evgl_api_thread_glVertexAttribIFormat(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribIFormat *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribIFormat *)data;
+
+   orig_evgl_api_glVertexAttribIFormat(thread_param->attribindex,
+                                       thread_param->size,
+                                       thread_param->type,
+                                       thread_param->relativeoffset);
+
+}
+
+EAPI void
+glVertexAttribIFormat_evgl_api_thread_cmd(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribIFormat(attribindex, size, type, relativeoffset);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribIFormat thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribIFormat *thread_param = &thread_param_local;
+
+   thread_param->attribindex = attribindex;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->relativeoffset = relativeoffset;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribIFormat,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
+ */
+
+typedef struct
+{
+   GLuint attribindex;
+   GLuint bindingindex;
+
+} EVGL_API_Thread_Command_glVertexAttribBinding;
+
+void (*orig_evgl_api_glVertexAttribBinding)(GLuint attribindex, GLuint bindingindex);
+
+static void
+_evgl_api_thread_glVertexAttribBinding(void *data)
+{
+   EVGL_API_Thread_Command_glVertexAttribBinding *thread_param =
+      (EVGL_API_Thread_Command_glVertexAttribBinding *)data;
+
+   orig_evgl_api_glVertexAttribBinding(thread_param->attribindex,
+                                       thread_param->bindingindex);
+
+}
+
+EAPI void
+glVertexAttribBinding_evgl_api_thread_cmd(GLuint attribindex, GLuint bindingindex)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexAttribBinding(attribindex, bindingindex);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexAttribBinding thread_param_local;
+   EVGL_API_Thread_Command_glVertexAttribBinding *thread_param = &thread_param_local;
+
+   thread_param->attribindex = attribindex;
+   thread_param->bindingindex = bindingindex;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexAttribBinding,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+ */
+
+typedef struct
+{
+   GLuint bindingindex;
+   GLuint divisor;
+
+} EVGL_API_Thread_Command_glVertexBindingDivisor;
+
+void (*orig_evgl_api_glVertexBindingDivisor)(GLuint bindingindex, GLuint divisor);
+
+static void
+_evgl_api_thread_glVertexBindingDivisor(void *data)
+{
+   EVGL_API_Thread_Command_glVertexBindingDivisor *thread_param =
+      (EVGL_API_Thread_Command_glVertexBindingDivisor *)data;
+
+   orig_evgl_api_glVertexBindingDivisor(thread_param->bindingindex,
+                                        thread_param->divisor);
+
+}
+
+EAPI void
+glVertexBindingDivisor_evgl_api_thread_cmd(GLuint bindingindex, GLuint divisor)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glVertexBindingDivisor(bindingindex, divisor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glVertexBindingDivisor thread_param_local;
+   EVGL_API_Thread_Command_glVertexBindingDivisor *thread_param = &thread_param_local;
+
+   thread_param->bindingindex = bindingindex;
+   thread_param->divisor = divisor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glVertexBindingDivisor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEGLImageTargetTexture2DOES(GLenum target, void *image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   void *image;
+
+} EVGL_API_Thread_Command_glEGLImageTargetTexture2DOES;
+
+void (*orig_evgl_api_glEGLImageTargetTexture2DOES)(GLenum target, void *image);
+
+static void
+_evgl_api_thread_glEGLImageTargetTexture2DOES(void *data)
+{
+   EVGL_API_Thread_Command_glEGLImageTargetTexture2DOES *thread_param =
+      (EVGL_API_Thread_Command_glEGLImageTargetTexture2DOES *)data;
+
+   orig_evgl_api_glEGLImageTargetTexture2DOES(thread_param->target,
+                                              thread_param->image);
+
+}
+
+EAPI void
+glEGLImageTargetTexture2DOES_evgl_api_thread_cmd(GLenum target, void *image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEGLImageTargetTexture2DOES(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEGLImageTargetTexture2DOES thread_param_local;
+   EVGL_API_Thread_Command_glEGLImageTargetTexture2DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEGLImageTargetTexture2DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEGLImageTargetRenderbufferStorageOES(GLenum target, void *image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   void *image;
+   int command_allocated;
+
+} EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES;
+
+void (*orig_evgl_api_glEGLImageTargetRenderbufferStorageOES)(GLenum target, void *image);
+
+static void
+_evgl_api_thread_glEGLImageTargetRenderbufferStorageOES(void *data)
+{
+   EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES *thread_param =
+      (EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES *)data;
+
+   orig_evgl_api_glEGLImageTargetRenderbufferStorageOES(thread_param->target,
+                                                        thread_param->image);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEGLImageTargetRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, void *image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api_glEGLImageTargetRenderbufferStorageOES(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES thread_param_local;
+   EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_API_Thread_Command_glEGLImageTargetRenderbufferStorageOES));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread_glEGLImageTargetRenderbufferStorageOES,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   _evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei numAttachments;
+   const GLenum* attachments;
+
+} EVGL_API_Thread_Command__evgl_glDiscardFramebufferEXT;
+
+void (*orig_evgl_api__evgl_glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+static void
+_evgl_api_thread__evgl_glDiscardFramebufferEXT(void *data)
+{
+   EVGL_API_Thread_Command__evgl_glDiscardFramebufferEXT *thread_param =
+      (EVGL_API_Thread_Command__evgl_glDiscardFramebufferEXT *)data;
+
+   orig_evgl_api__evgl_glDiscardFramebufferEXT(thread_param->target,
+                                               thread_param->numAttachments,
+                                               thread_param->attachments);
+
+}
+
+EAPI void
+_evgl_glDiscardFramebufferEXT_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api__evgl_glDiscardFramebufferEXT(target, numAttachments, attachments);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_glDiscardFramebufferEXT thread_param_local;
+   EVGL_API_Thread_Command__evgl_glDiscardFramebufferEXT *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->numAttachments = numAttachments;
+   thread_param->attachments = attachments;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_glDiscardFramebufferEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   _evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   EvasGLImage image;
+
+} EVGL_API_Thread_Command__evgl_glEvasGLImageTargetTexture2D;
+
+void (*orig_evgl_api__evgl_glEvasGLImageTargetTexture2D)(GLenum target, EvasGLImage image);
+
+static void
+_evgl_api_thread__evgl_glEvasGLImageTargetTexture2D(void *data)
+{
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetTexture2D *thread_param =
+      (EVGL_API_Thread_Command__evgl_glEvasGLImageTargetTexture2D *)data;
+
+   orig_evgl_api__evgl_glEvasGLImageTargetTexture2D(thread_param->target,
+                                                    thread_param->image);
+
+}
+
+EAPI void
+_evgl_glEvasGLImageTargetTexture2D_evgl_api_thread_cmd(GLenum target, EvasGLImage image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api__evgl_glEvasGLImageTargetTexture2D(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetTexture2D thread_param_local;
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetTexture2D *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_glEvasGLImageTargetTexture2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   _evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   EvasGLImage image;
+
+} EVGL_API_Thread_Command__evgl_glEvasGLImageTargetRenderbufferStorage;
+
+void (*orig_evgl_api__evgl_glEvasGLImageTargetRenderbufferStorage)(GLenum target, EvasGLImage image);
+
+static void
+_evgl_api_thread__evgl_glEvasGLImageTargetRenderbufferStorage(void *data)
+{
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetRenderbufferStorage *thread_param =
+      (EVGL_API_Thread_Command__evgl_glEvasGLImageTargetRenderbufferStorage *)data;
+
+   orig_evgl_api__evgl_glEvasGLImageTargetRenderbufferStorage(thread_param->target,
+                                                              thread_param->image);
+
+}
+
+EAPI void
+_evgl_glEvasGLImageTargetRenderbufferStorage_evgl_api_thread_cmd(GLenum target, EvasGLImage image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api__evgl_glEvasGLImageTargetRenderbufferStorage(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetRenderbufferStorage thread_param_local;
+   EVGL_API_Thread_Command__evgl_glEvasGLImageTargetRenderbufferStorage *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_glEvasGLImageTargetRenderbufferStorage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   EvasGLImage
+   _evgl_evasglCreateImage(int target, void* buffer, const int *attrib_list);
+ */
+
+typedef struct
+{
+   EvasGLImage return_value;
+   int target;
+   void* buffer;
+   const int *attrib_list;
+
+} EVGL_API_Thread_Command__evgl_evasglCreateImage;
+
+EvasGLImage (*orig_evgl_api__evgl_evasglCreateImage)(int target, void* buffer, const int *attrib_list);
+
+static void
+_evgl_api_thread__evgl_evasglCreateImage(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglCreateImage *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglCreateImage *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglCreateImage(thread_param->target,
+                                                                      thread_param->buffer,
+                                                                      thread_param->attrib_list);
+
+}
+
+EAPI EvasGLImage
+_evgl_evasglCreateImage_evgl_api_thread_cmd(int target, void* buffer, const int *attrib_list)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglCreateImage(target, buffer, attrib_list);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglCreateImage thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglCreateImage *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->buffer = buffer;
+   thread_param->attrib_list = attrib_list;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglCreateImage,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   _evgl_evasglDestroyImage(EvasGLImage image);
+ */
+
+typedef struct
+{
+   EvasGLImage image;
+
+} EVGL_API_Thread_Command__evgl_evasglDestroyImage;
+
+void (*orig_evgl_api__evgl_evasglDestroyImage)(EvasGLImage image);
+
+static void
+_evgl_api_thread__evgl_evasglDestroyImage(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglDestroyImage *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglDestroyImage *)data;
+
+   orig_evgl_api__evgl_evasglDestroyImage(thread_param->image);
+
+}
+
+EAPI void
+_evgl_evasglDestroyImage_evgl_api_thread_cmd(EvasGLImage image)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        orig_evgl_api__evgl_evasglDestroyImage(image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglDestroyImage thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglDestroyImage *thread_param = &thread_param_local;
+
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglDestroyImage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   EvasGLImage
+   _evgl_evasglCreateImageForContext(Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list);
+ */
+
+typedef struct
+{
+   EvasGLImage return_value;
+   Evas_GL *evas_gl;
+   Evas_GL_Context *ctx;
+   int target;
+   void* buffer;
+   const int *attrib_list;
+
+} EVGL_API_Thread_Command__evgl_evasglCreateImageForContext;
+
+EvasGLImage (*orig_evgl_api__evgl_evasglCreateImageForContext)(Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list);
+
+static void
+_evgl_api_thread__evgl_evasglCreateImageForContext(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglCreateImageForContext *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglCreateImageForContext *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglCreateImageForContext(thread_param->evas_gl,
+                                                                                thread_param->ctx,
+                                                                                thread_param->target,
+                                                                                thread_param->buffer,
+                                                                                thread_param->attrib_list);
+
+}
+
+EAPI EvasGLImage
+_evgl_evasglCreateImageForContext_evgl_api_thread_cmd(Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglCreateImageForContext(evas_gl, ctx, target, buffer, attrib_list);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglCreateImageForContext thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglCreateImageForContext *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->ctx = ctx;
+   thread_param->target = target;
+   thread_param->buffer = buffer;
+   thread_param->attrib_list = attrib_list;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglCreateImageForContext,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   EvasGLSync
+   _evgl_evasglCreateSync(Evas_GL *evas_gl, unsigned int type, const int *attrib_list);
+ */
+
+typedef struct
+{
+   EvasGLSync return_value;
+   Evas_GL *evas_gl;
+   unsigned int type;
+   const int *attrib_list;
+
+} EVGL_API_Thread_Command__evgl_evasglCreateSync;
+
+EvasGLSync (*orig_evgl_api__evgl_evasglCreateSync)(Evas_GL *evas_gl, unsigned int type, const int *attrib_list);
+
+static void
+_evgl_api_thread__evgl_evasglCreateSync(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglCreateSync *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglCreateSync *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglCreateSync(thread_param->evas_gl,
+                                                                     thread_param->type,
+                                                                     thread_param->attrib_list);
+
+}
+
+EAPI EvasGLSync
+_evgl_evasglCreateSync_evgl_api_thread_cmd(Evas_GL *evas_gl, unsigned int type, const int *attrib_list)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglCreateSync(evas_gl, type, attrib_list);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglCreateSync thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglCreateSync *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->type = type;
+   thread_param->attrib_list = attrib_list;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglCreateSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglDestroySync(Evas_GL *evas_gl, EvasGLSync sync);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   EvasGLSync sync;
+
+} EVGL_API_Thread_Command__evgl_evasglDestroySync;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglDestroySync)(Evas_GL *evas_gl, EvasGLSync sync);
+
+static void
+_evgl_api_thread__evgl_evasglDestroySync(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglDestroySync *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglDestroySync *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglDestroySync(thread_param->evas_gl,
+                                                                      thread_param->sync);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglDestroySync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglDestroySync(evas_gl, sync);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglDestroySync thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglDestroySync *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglDestroySync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   _evgl_evasglClientWaitSync(Evas_GL *evas_gl, EvasGLSync sync);
+ */
+
+typedef struct
+{
+   int return_value;
+   Evas_GL *evas_gl;
+   EvasGLSync sync;
+
+} EVGL_API_Thread_Command__evgl_evasglClientWaitSync;
+
+int (*orig_evgl_api__evgl_evasglClientWaitSync)(Evas_GL *evas_gl, EvasGLSync sync);
+
+static void
+_evgl_api_thread__evgl_evasglClientWaitSync(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglClientWaitSync *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglClientWaitSync *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglClientWaitSync(thread_param->evas_gl,
+                                                                         thread_param->sync);
+
+}
+
+EAPI int
+_evgl_evasglClientWaitSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglClientWaitSync(evas_gl, sync);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglClientWaitSync thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglClientWaitSync *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->sync = sync;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglClientWaitSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglGetSyncAttrib(Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   EvasGLSync sync;
+   int attribute;
+   int *value;
+
+} EVGL_API_Thread_Command__evgl_evasglGetSyncAttrib;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglGetSyncAttrib)(Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value);
+
+static void
+_evgl_api_thread__evgl_evasglGetSyncAttrib(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglGetSyncAttrib *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglGetSyncAttrib *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglGetSyncAttrib(thread_param->evas_gl,
+                                                                        thread_param->sync,
+                                                                        thread_param->attribute,
+                                                                        thread_param->value);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglGetSyncAttrib_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglGetSyncAttrib(evas_gl, sync, attribute, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglGetSyncAttrib thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglGetSyncAttrib *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->sync = sync;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglGetSyncAttrib,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglSignalSync(Evas_GL *evas_gl, EvasGLSync sync, unsigned mode);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   EvasGLSync sync;
+   unsigned mode;
+
+} EVGL_API_Thread_Command__evgl_evasglSignalSync;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglSignalSync)(Evas_GL *evas_gl, EvasGLSync sync, unsigned mode);
+
+static void
+_evgl_api_thread__evgl_evasglSignalSync(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglSignalSync *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglSignalSync *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglSignalSync(thread_param->evas_gl,
+                                                                     thread_param->sync,
+                                                                     thread_param->mode);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglSignalSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, unsigned mode)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglSignalSync(evas_gl, sync, mode);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglSignalSync thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglSignalSync *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->sync = sync;
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglSignalSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   _evgl_evasglWaitSync(Evas_GL *evas_gl, EvasGLSync sync, int flags);
+ */
+
+typedef struct
+{
+   int return_value;
+   Evas_GL *evas_gl;
+   EvasGLSync sync;
+   int flags;
+
+} EVGL_API_Thread_Command__evgl_evasglWaitSync;
+
+int (*orig_evgl_api__evgl_evasglWaitSync)(Evas_GL *evas_gl, EvasGLSync sync, int flags);
+
+static void
+_evgl_api_thread__evgl_evasglWaitSync(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglWaitSync *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglWaitSync *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglWaitSync(thread_param->evas_gl,
+                                                                   thread_param->sync,
+                                                                   thread_param->flags);
+
+}
+
+EAPI int
+_evgl_evasglWaitSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, int flags)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglWaitSync(evas_gl, sync, flags);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglWaitSync thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglWaitSync *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->sync = sync;
+   thread_param->flags = flags;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglWaitSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglBindWaylandDisplay(Evas_GL *evas_gl, void *wl_display);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   void *wl_display;
+
+} EVGL_API_Thread_Command__evgl_evasglBindWaylandDisplay;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglBindWaylandDisplay)(Evas_GL *evas_gl, void *wl_display);
+
+static void
+_evgl_api_thread__evgl_evasglBindWaylandDisplay(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglBindWaylandDisplay *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglBindWaylandDisplay *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglBindWaylandDisplay(thread_param->evas_gl,
+                                                                             thread_param->wl_display);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglBindWaylandDisplay_evgl_api_thread_cmd(Evas_GL *evas_gl, void *wl_display)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglBindWaylandDisplay(evas_gl, wl_display);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglBindWaylandDisplay thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglBindWaylandDisplay *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->wl_display = wl_display;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglBindWaylandDisplay,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglUnbindWaylandDisplay(Evas_GL *evas_gl, void *wl_display);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   void *wl_display;
+
+} EVGL_API_Thread_Command__evgl_evasglUnbindWaylandDisplay;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglUnbindWaylandDisplay)(Evas_GL *evas_gl, void *wl_display);
+
+static void
+_evgl_api_thread__evgl_evasglUnbindWaylandDisplay(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglUnbindWaylandDisplay *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglUnbindWaylandDisplay *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglUnbindWaylandDisplay(thread_param->evas_gl,
+                                                                               thread_param->wl_display);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglUnbindWaylandDisplay_evgl_api_thread_cmd(Evas_GL *evas_gl, void *wl_display)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglUnbindWaylandDisplay(evas_gl, wl_display);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglUnbindWaylandDisplay thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglUnbindWaylandDisplay *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->wl_display = wl_display;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglUnbindWaylandDisplay,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Eina_Bool
+   _evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl, void *buffer, int attribute, int *value);
+ */
+
+typedef struct
+{
+   Eina_Bool return_value;
+   Evas_GL *evas_gl;
+   void *buffer;
+   int attribute;
+   int *value;
+
+} EVGL_API_Thread_Command__evgl_evasglQueryWaylandBuffer;
+
+Eina_Bool (*orig_evgl_api__evgl_evasglQueryWaylandBuffer)(Evas_GL *evas_gl, void *buffer, int attribute, int *value);
+
+static void
+_evgl_api_thread__evgl_evasglQueryWaylandBuffer(void *data)
+{
+   EVGL_API_Thread_Command__evgl_evasglQueryWaylandBuffer *thread_param =
+      (EVGL_API_Thread_Command__evgl_evasglQueryWaylandBuffer *)data;
+
+   thread_param->return_value = orig_evgl_api__evgl_evasglQueryWaylandBuffer(thread_param->evas_gl,
+                                                                             thread_param->buffer,
+                                                                             thread_param->attribute,
+                                                                             thread_param->value);
+
+}
+
+EAPI Eina_Bool
+_evgl_evasglQueryWaylandBuffer_evgl_api_thread_cmd(Evas_GL *evas_gl, void *buffer, int attribute, int *value)
+{
+   if (!evas_evgl_thread_enabled() || (_main_thread_id != eina_thread_self()))
+     {
+        return orig_evgl_api__evgl_evasglQueryWaylandBuffer(evas_gl, buffer, attribute, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_API_Thread_Command__evgl_evasglQueryWaylandBuffer thread_param_local;
+   EVGL_API_Thread_Command__evgl_evasglQueryWaylandBuffer *thread_param = &thread_param_local;
+
+   thread_param->evas_gl = evas_gl;
+   thread_param->buffer = buffer;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_api_thread__evgl_evasglQueryWaylandBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.h b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_api_generated.h
new file mode 100644 (file)
index 0000000..85e3377
--- /dev/null
@@ -0,0 +1,1817 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+#define EVAS_GL_NO_GL_H_CHECK 1
+#include "Evas_GL.h"
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+
+extern void (*orig_evgl_api_glActiveTexture)(GLenum texture);
+EAPI void glActiveTexture_evgl_api_thread_cmd(GLenum texture);
+
+extern void (*orig_evgl_api_glAttachShader)(GLuint program, GLuint shader);
+EAPI void glAttachShader_evgl_api_thread_cmd(GLuint program, GLuint shader);
+
+extern void (*orig_evgl_api_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
+EAPI void glBindAttribLocation_evgl_api_thread_cmd(GLuint program, GLuint index, const char* name);
+
+extern void (*orig_evgl_api_glBindBuffer)(GLenum target, GLuint buffer);
+EAPI void glBindBuffer_evgl_api_thread_cmd(GLenum target, GLuint buffer);
+
+extern void (*orig_evgl_api_glBindFramebuffer)(GLenum target, GLuint framebuffer);
+EAPI void glBindFramebuffer_evgl_api_thread_cmd(GLenum target, GLuint framebuffer);
+
+extern void (*orig_evgl_api_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
+EAPI void glBindRenderbuffer_evgl_api_thread_cmd(GLenum target, GLuint renderbuffer);
+
+extern void (*orig_evgl_api_glBindTexture)(GLenum target, GLuint texture);
+EAPI void glBindTexture_evgl_api_thread_cmd(GLenum target, GLuint texture);
+
+extern void (*orig_evgl_api_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+EAPI void glBlendColor_evgl_api_thread_cmd(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+
+extern void (*orig_evgl_api_glBlendEquation)(GLenum mode);
+EAPI void glBlendEquation_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
+EAPI void glBlendEquationSeparate_evgl_api_thread_cmd(GLenum modeRGB, GLenum modeAlpha);
+
+extern void (*orig_evgl_api_glBlendFunc)(GLenum sfactor, GLenum dfactor);
+EAPI void glBlendFunc_evgl_api_thread_cmd(GLenum sfactor, GLenum dfactor);
+
+extern void (*orig_evgl_api_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+EAPI void glBlendFuncSeparate_evgl_api_thread_cmd(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+
+extern void (*orig_evgl_api_glBufferData)(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+EAPI void glBufferData_evgl_api_thread_cmd(GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+
+extern void (*orig_evgl_api_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+EAPI void glBufferSubData_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+
+extern GLenum (*orig_evgl_api_glCheckFramebufferStatus)(GLenum target);
+EAPI GLenum glCheckFramebufferStatus_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glClear)(GLbitfield mask);
+EAPI void glClear_evgl_api_thread_cmd(GLbitfield mask);
+
+extern void (*orig_evgl_api_glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+EAPI void glClearColor_evgl_api_thread_cmd(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+
+extern void (*orig_evgl_api_glClearDepthf)(GLclampf depth);
+EAPI void glClearDepthf_evgl_api_thread_cmd(GLclampf depth);
+
+extern void (*orig_evgl_api_glClearStencil)(GLint s);
+EAPI void glClearStencil_evgl_api_thread_cmd(GLint s);
+
+extern void (*orig_evgl_api_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+EAPI void glColorMask_evgl_api_thread_cmd(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+
+extern void (*orig_evgl_api_glCompileShader)(GLuint shader);
+EAPI void glCompileShader_evgl_api_thread_cmd(GLuint shader);
+
+extern void (*orig_evgl_api_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+EAPI void glCompressedTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+
+extern void (*orig_evgl_api_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+EAPI void glCompressedTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+
+extern void (*orig_evgl_api_glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+EAPI void glCopyTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+
+extern void (*orig_evgl_api_glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glCopyTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern GLuint (*orig_evgl_api_glCreateProgram)(void);
+EAPI GLuint glCreateProgram_evgl_api_thread_cmd(void);
+
+extern GLuint (*orig_evgl_api_glCreateShader)(GLenum type);
+EAPI GLuint glCreateShader_evgl_api_thread_cmd(GLenum type);
+
+extern void (*orig_evgl_api_glCullFace)(GLenum mode);
+EAPI void glCullFace_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
+EAPI void glDeleteBuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* buffers);
+
+extern void (*orig_evgl_api_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
+EAPI void glDeleteFramebuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* framebuffers);
+
+extern void (*orig_evgl_api_glDeleteProgram)(GLuint program);
+EAPI void glDeleteProgram_evgl_api_thread_cmd(GLuint program);
+
+extern void (*orig_evgl_api_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
+EAPI void glDeleteRenderbuffers_evgl_api_thread_cmd(GLsizei n, const GLuint* renderbuffers);
+
+extern void (*orig_evgl_api_glDeleteShader)(GLuint shader);
+EAPI void glDeleteShader_evgl_api_thread_cmd(GLuint shader);
+
+extern void (*orig_evgl_api_glDeleteTextures)(GLsizei n, const GLuint* textures);
+EAPI void glDeleteTextures_evgl_api_thread_cmd(GLsizei n, const GLuint* textures);
+
+extern void (*orig_evgl_api_glDepthFunc)(GLenum func);
+EAPI void glDepthFunc_evgl_api_thread_cmd(GLenum func);
+
+extern void (*orig_evgl_api_glDepthMask)(GLboolean flag);
+EAPI void glDepthMask_evgl_api_thread_cmd(GLboolean flag);
+
+extern void (*orig_evgl_api_glDepthRangef)(GLclampf zNear, GLclampf zFar);
+EAPI void glDepthRangef_evgl_api_thread_cmd(GLclampf zNear, GLclampf zFar);
+
+extern void (*orig_evgl_api_glDetachShader)(GLuint program, GLuint shader);
+EAPI void glDetachShader_evgl_api_thread_cmd(GLuint program, GLuint shader);
+
+extern void (*orig_evgl_api_glDisable)(GLenum cap);
+EAPI void glDisable_evgl_api_thread_cmd(GLenum cap);
+
+extern void (*orig_evgl_api_glDisableVertexAttribArray)(GLuint index);
+EAPI void glDisableVertexAttribArray_evgl_api_thread_cmd(GLuint index);
+
+extern void (*orig_evgl_api_glDrawArrays)(GLenum mode, GLint first, GLsizei count);
+EAPI void glDrawArrays_evgl_api_thread_cmd(GLenum mode, GLint first, GLsizei count);
+
+extern void (*orig_evgl_api_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void* indices);
+EAPI void glDrawElements_evgl_api_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void* indices);
+
+extern void (*orig_evgl_api_glEnable)(GLenum cap);
+EAPI void glEnable_evgl_api_thread_cmd(GLenum cap);
+
+extern void (*orig_evgl_api_glEnableVertexAttribArray)(GLuint index);
+EAPI void glEnableVertexAttribArray_evgl_api_thread_cmd(GLuint index);
+
+extern void (*orig_evgl_api_glFinish)(void);
+EAPI void glFinish_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glFlush)(void);
+EAPI void glFlush_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+EAPI void glFramebufferRenderbuffer_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+extern void (*orig_evgl_api_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+EAPI void glFramebufferTexture2D_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+extern void (*orig_evgl_api_glFrontFace)(GLenum mode);
+EAPI void glFrontFace_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glGenBuffers)(GLsizei n, GLuint* buffers);
+EAPI void glGenBuffers_evgl_api_thread_cmd(GLsizei n, GLuint* buffers);
+
+extern void (*orig_evgl_api_glGenerateMipmap)(GLenum target);
+EAPI void glGenerateMipmap_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
+EAPI void glGenFramebuffers_evgl_api_thread_cmd(GLsizei n, GLuint* framebuffers);
+
+extern void (*orig_evgl_api_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
+EAPI void glGenRenderbuffers_evgl_api_thread_cmd(GLsizei n, GLuint* renderbuffers);
+
+extern void (*orig_evgl_api_glGenTextures)(GLsizei n, GLuint* textures);
+EAPI void glGenTextures_evgl_api_thread_cmd(GLsizei n, GLuint* textures);
+
+extern void (*orig_evgl_api_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+EAPI void glGetActiveAttrib_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+
+extern void (*orig_evgl_api_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+EAPI void glGetActiveUniform_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+
+extern void (*orig_evgl_api_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+EAPI void glGetAttachedShaders_evgl_api_thread_cmd(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+
+extern int (*orig_evgl_api_glGetAttribLocation)(GLuint program, const char* name);
+EAPI int glGetAttribLocation_evgl_api_thread_cmd(GLuint program, const char* name);
+
+extern void (*orig_evgl_api_glGetBooleanv)(GLenum pname, GLboolean* params);
+EAPI void glGetBooleanv_evgl_api_thread_cmd(GLenum pname, GLboolean* params);
+
+extern void (*orig_evgl_api_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
+EAPI void glGetBufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params);
+
+extern GLenum (*orig_evgl_api_glGetError)(void);
+EAPI GLenum glGetError_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glGetFloatv)(GLenum pname, GLfloat* params);
+EAPI void glGetFloatv_evgl_api_thread_cmd(GLenum pname, GLfloat* params);
+
+extern void (*orig_evgl_api_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+EAPI void glGetFramebufferAttachmentParameteriv_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetIntegerv)(GLenum pname, GLint* params);
+EAPI void glGetIntegerv_evgl_api_thread_cmd(GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
+EAPI void glGetProgramiv_evgl_api_thread_cmd(GLuint program, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+EAPI void glGetProgramInfoLog_evgl_api_thread_cmd(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+
+extern void (*orig_evgl_api_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
+EAPI void glGetRenderbufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
+EAPI void glGetShaderiv_evgl_api_thread_cmd(GLuint shader, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+EAPI void glGetShaderInfoLog_evgl_api_thread_cmd(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+
+extern void (*orig_evgl_api_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+EAPI void glGetShaderPrecisionFormat_evgl_api_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+
+extern void (*orig_evgl_api_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+EAPI void glGetShaderSource_evgl_api_thread_cmd(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+
+extern const GLubyte* (*orig_evgl_api_glGetString)(GLenum name);
+EAPI const GLubyte* glGetString_evgl_api_thread_cmd(GLenum name);
+
+extern void (*orig_evgl_api_glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat* params);
+EAPI void glGetTexParameterfv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat* params);
+
+extern void (*orig_evgl_api_glGetTexParameteriv)(GLenum target, GLenum pname, GLint* params);
+EAPI void glGetTexParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
+EAPI void glGetUniformfv_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat* params);
+
+extern void (*orig_evgl_api_glGetUniformiv)(GLuint program, GLint location, GLint* params);
+EAPI void glGetUniformiv_evgl_api_thread_cmd(GLuint program, GLint location, GLint* params);
+
+extern int (*orig_evgl_api_glGetUniformLocation)(GLuint program, const char* name);
+EAPI int glGetUniformLocation_evgl_api_thread_cmd(GLuint program, const char* name);
+
+extern void (*orig_evgl_api_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
+EAPI void glGetVertexAttribfv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLfloat* params);
+
+extern void (*orig_evgl_api_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
+EAPI void glGetVertexAttribiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
+EAPI void glGetVertexAttribPointerv_evgl_api_thread_cmd(GLuint index, GLenum pname, void** pointer);
+
+extern void (*orig_evgl_api_glHint)(GLenum target, GLenum mode);
+EAPI void glHint_evgl_api_thread_cmd(GLenum target, GLenum mode);
+
+extern GLboolean (*orig_evgl_api_glIsBuffer)(GLuint buffer);
+EAPI GLboolean glIsBuffer_evgl_api_thread_cmd(GLuint buffer);
+
+extern GLboolean (*orig_evgl_api_glIsEnabled)(GLenum cap);
+EAPI GLboolean glIsEnabled_evgl_api_thread_cmd(GLenum cap);
+
+extern GLboolean (*orig_evgl_api_glIsFramebuffer)(GLuint framebuffer);
+EAPI GLboolean glIsFramebuffer_evgl_api_thread_cmd(GLuint framebuffer);
+
+extern GLboolean (*orig_evgl_api_glIsProgram)(GLuint program);
+EAPI GLboolean glIsProgram_evgl_api_thread_cmd(GLuint program);
+
+extern GLboolean (*orig_evgl_api_glIsRenderbuffer)(GLuint renderbuffer);
+EAPI GLboolean glIsRenderbuffer_evgl_api_thread_cmd(GLuint renderbuffer);
+
+extern GLboolean (*orig_evgl_api_glIsShader)(GLuint shader);
+EAPI GLboolean glIsShader_evgl_api_thread_cmd(GLuint shader);
+
+extern GLboolean (*orig_evgl_api_glIsTexture)(GLuint texture);
+EAPI GLboolean glIsTexture_evgl_api_thread_cmd(GLuint texture);
+
+extern void (*orig_evgl_api_glLineWidth)(GLfloat width);
+EAPI void glLineWidth_evgl_api_thread_cmd(GLfloat width);
+
+extern void (*orig_evgl_api_glLinkProgram)(GLuint program);
+EAPI void glLinkProgram_evgl_api_thread_cmd(GLuint program);
+
+extern void (*orig_evgl_api_glPixelStorei)(GLenum pname, GLint param);
+EAPI void glPixelStorei_evgl_api_thread_cmd(GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glPolygonOffset)(GLfloat factor, GLfloat units);
+EAPI void glPolygonOffset_evgl_api_thread_cmd(GLfloat factor, GLfloat units);
+
+extern void (*orig_evgl_api_glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+EAPI void glReadPixels_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+
+extern void (*orig_evgl_api_glReleaseShaderCompiler)(void);
+EAPI void glReleaseShaderCompiler_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glRenderbufferStorage_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glSampleCoverage)(GLclampf value, GLboolean invert);
+EAPI void glSampleCoverage_evgl_api_thread_cmd(GLclampf value, GLboolean invert);
+
+extern void (*orig_evgl_api_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glScissor_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+EAPI void glShaderBinary_evgl_api_thread_cmd(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+
+extern void (*orig_evgl_api_glShaderSource)(GLuint shader, GLsizei count, const char* const * string, const GLint* length);
+EAPI void glShaderSource_evgl_api_thread_cmd(GLuint shader, GLsizei count, const char* const * string, const GLint* length);
+
+extern void (*orig_evgl_api_glStencilFunc)(GLenum func, GLint ref, GLuint mask);
+EAPI void glStencilFunc_evgl_api_thread_cmd(GLenum func, GLint ref, GLuint mask);
+
+extern void (*orig_evgl_api_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
+EAPI void glStencilFuncSeparate_evgl_api_thread_cmd(GLenum face, GLenum func, GLint ref, GLuint mask);
+
+extern void (*orig_evgl_api_glStencilMask)(GLuint mask);
+EAPI void glStencilMask_evgl_api_thread_cmd(GLuint mask);
+
+extern void (*orig_evgl_api_glStencilMaskSeparate)(GLenum face, GLuint mask);
+EAPI void glStencilMaskSeparate_evgl_api_thread_cmd(GLenum face, GLuint mask);
+
+extern void (*orig_evgl_api_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
+EAPI void glStencilOp_evgl_api_thread_cmd(GLenum fail, GLenum zfail, GLenum zpass);
+
+extern void (*orig_evgl_api_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+EAPI void glStencilOpSeparate_evgl_api_thread_cmd(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+
+extern void (*orig_evgl_api_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+EAPI void glTexImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+
+extern void (*orig_evgl_api_glTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+EAPI void glTexParameterf_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glTexParameterfv)(GLenum target, GLenum pname, const GLfloat* params);
+EAPI void glTexParameterfv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfloat* params);
+
+extern void (*orig_evgl_api_glTexParameteri)(GLenum target, GLenum pname, GLint param);
+EAPI void glTexParameteri_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glTexParameteriv)(GLenum target, GLenum pname, const GLint* params);
+EAPI void glTexParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLint* params);
+
+extern void (*orig_evgl_api_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+EAPI void glTexSubImage2D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+
+extern void (*orig_evgl_api_glUniform1f)(GLint location, GLfloat x);
+EAPI void glUniform1f_evgl_api_thread_cmd(GLint location, GLfloat x);
+
+extern void (*orig_evgl_api_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
+EAPI void glUniform1fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v);
+
+extern void (*orig_evgl_api_glUniform1i)(GLint location, GLint x);
+EAPI void glUniform1i_evgl_api_thread_cmd(GLint location, GLint x);
+
+extern void (*orig_evgl_api_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
+EAPI void glUniform1iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v);
+
+extern void (*orig_evgl_api_glUniform2f)(GLint location, GLfloat x, GLfloat y);
+EAPI void glUniform2f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y);
+
+extern void (*orig_evgl_api_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
+EAPI void glUniform2fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v);
+
+extern void (*orig_evgl_api_glUniform2i)(GLint location, GLint x, GLint y);
+EAPI void glUniform2i_evgl_api_thread_cmd(GLint location, GLint x, GLint y);
+
+extern void (*orig_evgl_api_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
+EAPI void glUniform2iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v);
+
+extern void (*orig_evgl_api_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
+EAPI void glUniform3f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y, GLfloat z);
+
+extern void (*orig_evgl_api_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
+EAPI void glUniform3fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v);
+
+extern void (*orig_evgl_api_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
+EAPI void glUniform3i_evgl_api_thread_cmd(GLint location, GLint x, GLint y, GLint z);
+
+extern void (*orig_evgl_api_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
+EAPI void glUniform3iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v);
+
+extern void (*orig_evgl_api_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+EAPI void glUniform4f_evgl_api_thread_cmd(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+extern void (*orig_evgl_api_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
+EAPI void glUniform4fv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLfloat* v);
+
+extern void (*orig_evgl_api_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
+EAPI void glUniform4i_evgl_api_thread_cmd(GLint location, GLint x, GLint y, GLint z, GLint w);
+
+extern void (*orig_evgl_api_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
+EAPI void glUniform4iv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLint* v);
+
+extern void (*orig_evgl_api_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+EAPI void glUniformMatrix2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+extern void (*orig_evgl_api_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+EAPI void glUniformMatrix3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+extern void (*orig_evgl_api_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+EAPI void glUniformMatrix4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+
+extern void (*orig_evgl_api_glUseProgram)(GLuint program);
+EAPI void glUseProgram_evgl_api_thread_cmd(GLuint program);
+
+extern void (*orig_evgl_api_glValidateProgram)(GLuint program);
+EAPI void glValidateProgram_evgl_api_thread_cmd(GLuint program);
+
+extern void (*orig_evgl_api_glVertexAttrib1f)(GLuint indx, GLfloat x);
+EAPI void glVertexAttrib1f_evgl_api_thread_cmd(GLuint indx, GLfloat x);
+
+extern void (*orig_evgl_api_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
+EAPI void glVertexAttrib1fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values);
+
+extern void (*orig_evgl_api_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
+EAPI void glVertexAttrib2f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y);
+
+extern void (*orig_evgl_api_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
+EAPI void glVertexAttrib2fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values);
+
+extern void (*orig_evgl_api_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+EAPI void glVertexAttrib3f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+
+extern void (*orig_evgl_api_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
+EAPI void glVertexAttrib3fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values);
+
+extern void (*orig_evgl_api_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+EAPI void glVertexAttrib4f_evgl_api_thread_cmd(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+extern void (*orig_evgl_api_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
+EAPI void glVertexAttrib4fv_evgl_api_thread_cmd(GLuint indx, const GLfloat* values);
+
+extern void (*orig_evgl_api_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+EAPI void glVertexAttribPointer_evgl_api_thread_cmd(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+
+extern void (*orig_evgl_api_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glViewport_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glEvasGLImageTargetTexture2DOES)(GLenum target, EvasGLImage image);
+EAPI void glEvasGLImageTargetTexture2DOES_evgl_api_thread_cmd(GLenum target, EvasGLImage image);
+
+extern void (*orig_evgl_api_glEvasGLImageTargetRenderbufferStorageOES)(GLenum target, EvasGLImage image);
+EAPI void glEvasGLImageTargetRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, EvasGLImage image);
+
+extern void (*orig_evgl_api_glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+EAPI void glGetProgramBinaryOES_evgl_api_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+extern void (*orig_evgl_api_glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+EAPI void glProgramBinaryOES_evgl_api_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+
+extern void * (*orig_evgl_api_glMapBufferOES)(GLenum target, GLenum access);
+EAPI void * glMapBufferOES_evgl_api_thread_cmd(GLenum target, GLenum access);
+
+extern GLboolean (*orig_evgl_api_glUnmapBufferOES)(GLenum target);
+EAPI GLboolean glUnmapBufferOES_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glGetBufferPointervOES)(GLenum target, GLenum pname, void** params);
+EAPI void glGetBufferPointervOES_evgl_api_thread_cmd(GLenum target, GLenum pname, void** params);
+
+extern void (*orig_evgl_api_glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+EAPI void glTexImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+
+extern void (*orig_evgl_api_glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+EAPI void glTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+
+extern void (*orig_evgl_api_glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glCopyTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+EAPI void glCompressedTexImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+
+extern void (*orig_evgl_api_glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+EAPI void glCompressedTexSubImage3DOES_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+
+extern void (*orig_evgl_api_glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+EAPI void glFramebufferTexture3DOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+
+extern void (*orig_evgl_api_glGetPerfMonitorGroupsAMD)(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
+EAPI void glGetPerfMonitorGroupsAMD_evgl_api_thread_cmd(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
+
+extern void (*orig_evgl_api_glGetPerfMonitorCountersAMD)(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
+EAPI void glGetPerfMonitorCountersAMD_evgl_api_thread_cmd(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
+
+extern void (*orig_evgl_api_glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
+EAPI void glGetPerfMonitorGroupStringAMD_evgl_api_thread_cmd(GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
+
+extern void (*orig_evgl_api_glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
+EAPI void glGetPerfMonitorCounterStringAMD_evgl_api_thread_cmd(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
+
+extern void (*orig_evgl_api_glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, void* data);
+EAPI void glGetPerfMonitorCounterInfoAMD_evgl_api_thread_cmd(GLuint group, GLuint counter, GLenum pname, void* data);
+
+extern void (*orig_evgl_api_glGenPerfMonitorsAMD)(GLsizei n, GLuint* monitors);
+EAPI void glGenPerfMonitorsAMD_evgl_api_thread_cmd(GLsizei n, GLuint* monitors);
+
+extern void (*orig_evgl_api_glDeletePerfMonitorsAMD)(GLsizei n, GLuint* monitors);
+EAPI void glDeletePerfMonitorsAMD_evgl_api_thread_cmd(GLsizei n, GLuint* monitors);
+
+extern void (*orig_evgl_api_glSelectPerfMonitorCountersAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
+EAPI void glSelectPerfMonitorCountersAMD_evgl_api_thread_cmd(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
+
+extern void (*orig_evgl_api_glBeginPerfMonitorAMD)(GLuint monitor);
+EAPI void glBeginPerfMonitorAMD_evgl_api_thread_cmd(GLuint monitor);
+
+extern void (*orig_evgl_api_glEndPerfMonitorAMD)(GLuint monitor);
+EAPI void glEndPerfMonitorAMD_evgl_api_thread_cmd(GLuint monitor);
+
+extern void (*orig_evgl_api_glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
+EAPI void glGetPerfMonitorCounterDataAMD_evgl_api_thread_cmd(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
+
+extern void (*orig_evgl_api_glDiscardFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+EAPI void glDiscardFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+extern void (*orig_evgl_api_glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+EAPI void glDiscardFramebufferEXT_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+extern void (*orig_evgl_api_glMultiDrawArrays)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+EAPI void glMultiDrawArrays_evgl_api_thread_cmd(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+
+extern void (*orig_evgl_api_glMultiDrawArraysEXT)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+EAPI void glMultiDrawArraysEXT_evgl_api_thread_cmd(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
+
+extern void (*orig_evgl_api_glMultiDrawElements)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+EAPI void glMultiDrawElements_evgl_api_thread_cmd(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+
+extern void (*orig_evgl_api_glMultiDrawElementsEXT)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+EAPI void glMultiDrawElementsEXT_evgl_api_thread_cmd(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
+
+extern void (*orig_evgl_api_glDeleteFencesNV)(GLsizei n, const GLuint* fences);
+EAPI void glDeleteFencesNV_evgl_api_thread_cmd(GLsizei n, const GLuint* fences);
+
+extern void (*orig_evgl_api_glGenFencesNV)(GLsizei n, GLuint* fences);
+EAPI void glGenFencesNV_evgl_api_thread_cmd(GLsizei n, GLuint* fences);
+
+extern GLboolean (*orig_evgl_api_glIsFenceNV)(GLuint fence);
+EAPI GLboolean glIsFenceNV_evgl_api_thread_cmd(GLuint fence);
+
+extern GLboolean (*orig_evgl_api_glTestFenceNV)(GLuint fence);
+EAPI GLboolean glTestFenceNV_evgl_api_thread_cmd(GLuint fence);
+
+extern void (*orig_evgl_api_glGetFenceivNV)(GLuint fence, GLenum pname, GLint* params);
+EAPI void glGetFenceivNV_evgl_api_thread_cmd(GLuint fence, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glFinishFenceNV)(GLuint fence);
+EAPI void glFinishFenceNV_evgl_api_thread_cmd(GLuint fence);
+
+extern void (*orig_evgl_api_glSetFenceNV)(GLuint a, GLenum b);
+EAPI void glSetFenceNV_evgl_api_thread_cmd(GLuint a, GLenum b);
+
+extern void (*orig_evgl_api_glGetDriverControlsQCOM)(GLint* num, GLsizei size, GLuint* driverControls);
+EAPI void glGetDriverControlsQCOM_evgl_api_thread_cmd(GLint* num, GLsizei size, GLuint* driverControls);
+
+extern void (*orig_evgl_api_glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
+EAPI void glGetDriverControlStringQCOM_evgl_api_thread_cmd(GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
+
+extern void (*orig_evgl_api_glEnableDriverControlQCOM)(GLuint driverControl);
+EAPI void glEnableDriverControlQCOM_evgl_api_thread_cmd(GLuint driverControl);
+
+extern void (*orig_evgl_api_glDisableDriverControlQCOM)(GLuint driverControl);
+EAPI void glDisableDriverControlQCOM_evgl_api_thread_cmd(GLuint driverControl);
+
+extern void (*orig_evgl_api_glExtGetTexturesQCOM)(GLuint* textures, GLint maxTextures, GLint* numTextures);
+EAPI void glExtGetTexturesQCOM_evgl_api_thread_cmd(GLuint* textures, GLint maxTextures, GLint* numTextures);
+
+extern void (*orig_evgl_api_glExtGetBuffersQCOM)(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+EAPI void glExtGetBuffersQCOM_evgl_api_thread_cmd(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
+
+extern void (*orig_evgl_api_glExtGetRenderbuffersQCOM)(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+EAPI void glExtGetRenderbuffersQCOM_evgl_api_thread_cmd(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
+
+extern void (*orig_evgl_api_glExtGetFramebuffersQCOM)(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+EAPI void glExtGetFramebuffersQCOM_evgl_api_thread_cmd(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
+
+extern void (*orig_evgl_api_glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+EAPI void glExtGetTexLevelParameterivQCOM_evgl_api_thread_cmd(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param);
+EAPI void glExtTexObjectStateOverrideiQCOM_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
+EAPI void glExtGetTexSubImageQCOM_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
+
+extern void (*orig_evgl_api_glExtGetBufferPointervQCOM)(GLenum target, void** params);
+EAPI void glExtGetBufferPointervQCOM_evgl_api_thread_cmd(GLenum target, void** params);
+
+extern void (*orig_evgl_api_glExtGetShadersQCOM)(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+EAPI void glExtGetShadersQCOM_evgl_api_thread_cmd(GLuint* shaders, GLint maxShaders, GLint* numShaders);
+
+extern void (*orig_evgl_api_glExtGetProgramsQCOM)(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+EAPI void glExtGetProgramsQCOM_evgl_api_thread_cmd(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
+
+extern GLboolean (*orig_evgl_api_glExtIsProgramBinaryQCOM)(GLuint program);
+EAPI GLboolean glExtIsProgramBinaryQCOM_evgl_api_thread_cmd(GLuint program);
+
+extern void (*orig_evgl_api_glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, char* source, GLint* length);
+EAPI void glExtGetProgramBinarySourceQCOM_evgl_api_thread_cmd(GLuint program, GLenum shadertype, char* source, GLint* length);
+
+extern void (*orig_evgl_api_glAlphaFunc)(GLenum func, GLclampf ref);
+EAPI void glAlphaFunc_evgl_api_thread_cmd(GLenum func, GLclampf ref);
+
+extern void (*orig_evgl_api_glClipPlanef)(GLenum plane, const GLfloat *equation);
+EAPI void glClipPlanef_evgl_api_thread_cmd(GLenum plane, const GLfloat *equation);
+
+extern void (*orig_evgl_api_glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+EAPI void glColor4f_evgl_api_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+
+extern void (*orig_evgl_api_glFogf)(GLenum pname, GLfloat param);
+EAPI void glFogf_evgl_api_thread_cmd(GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glFogfv)(GLenum pname, const GLfloat *params);
+EAPI void glFogfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glFrustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+EAPI void glFrustumf_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+extern void (*orig_evgl_api_glGetClipPlanef)(GLenum pname, GLfloat eqn[4]);
+EAPI void glGetClipPlanef_evgl_api_thread_cmd(GLenum pname, GLfloat eqn[4]);
+
+extern void (*orig_evgl_api_glGetLightfv)(GLenum light, GLenum pname, GLfloat *params);
+EAPI void glGetLightfv_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfloat *params);
+
+extern void (*orig_evgl_api_glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
+EAPI void glGetMaterialfv_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfloat *params);
+
+extern void (*orig_evgl_api_glGetTexEnvfv)(GLenum env, GLenum pname, GLfloat *params);
+EAPI void glGetTexEnvfv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfloat *params);
+
+extern void (*orig_evgl_api_glLightModelf)(GLenum pname, GLfloat param);
+EAPI void glLightModelf_evgl_api_thread_cmd(GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glLightModelfv)(GLenum pname, const GLfloat *params);
+EAPI void glLightModelfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glLightf)(GLenum light, GLenum pname, GLfloat param);
+EAPI void glLightf_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glLightfv)(GLenum light, GLenum pname, const GLfloat *params);
+EAPI void glLightfv_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glLoadMatrixf)(const GLfloat *m);
+EAPI void glLoadMatrixf_evgl_api_thread_cmd(const GLfloat *m);
+
+extern void (*orig_evgl_api_glMaterialf)(GLenum face, GLenum pname, GLfloat param);
+EAPI void glMaterialf_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params);
+EAPI void glMaterialfv_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glMultMatrixf)(const GLfloat *m);
+EAPI void glMultMatrixf_evgl_api_thread_cmd(const GLfloat *m);
+
+extern void (*orig_evgl_api_glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+EAPI void glMultiTexCoord4f_evgl_api_thread_cmd(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+
+extern void (*orig_evgl_api_glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
+EAPI void glNormal3f_evgl_api_thread_cmd(GLfloat nx, GLfloat ny, GLfloat nz);
+
+extern void (*orig_evgl_api_glOrthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+EAPI void glOrthof_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+extern void (*orig_evgl_api_glPointParameterf)(GLenum pname, GLfloat param);
+EAPI void glPointParameterf_evgl_api_thread_cmd(GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glPointParameterfv)(GLenum pname, const GLfloat *params);
+EAPI void glPointParameterfv_evgl_api_thread_cmd(GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glPointSize)(GLfloat size);
+EAPI void glPointSize_evgl_api_thread_cmd(GLfloat size);
+
+extern void (*orig_evgl_api_glPointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid * pointer);
+EAPI void glPointSizePointerOES_evgl_api_thread_cmd(GLenum type, GLsizei stride, const GLvoid * pointer);
+
+extern void (*orig_evgl_api_glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+EAPI void glRotatef_evgl_api_thread_cmd(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+
+extern void (*orig_evgl_api_glScalef)(GLfloat x, GLfloat y, GLfloat z);
+EAPI void glScalef_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z);
+
+extern void (*orig_evgl_api_glTexEnvf)(GLenum target, GLenum pname, GLfloat param);
+EAPI void glTexEnvf_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
+EAPI void glTexEnvfv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glTranslatef)(GLfloat x, GLfloat y, GLfloat z);
+EAPI void glTranslatef_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z);
+
+extern void (*orig_evgl_api_glAlphaFuncx)(GLenum func, GLclampx ref);
+EAPI void glAlphaFuncx_evgl_api_thread_cmd(GLenum func, GLclampx ref);
+
+extern void (*orig_evgl_api_glClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+EAPI void glClearColorx_evgl_api_thread_cmd(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+
+extern void (*orig_evgl_api_glClearDepthx)(GLclampx depth);
+EAPI void glClearDepthx_evgl_api_thread_cmd(GLclampx depth);
+
+extern void (*orig_evgl_api_glClientActiveTexture)(GLenum texture);
+EAPI void glClientActiveTexture_evgl_api_thread_cmd(GLenum texture);
+
+extern void (*orig_evgl_api_glClipPlanex)(GLenum plane, const GLfixed *equation);
+EAPI void glClipPlanex_evgl_api_thread_cmd(GLenum plane, const GLfixed *equation);
+
+extern void (*orig_evgl_api_glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+EAPI void glColor4ub_evgl_api_thread_cmd(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+
+extern void (*orig_evgl_api_glColor4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+EAPI void glColor4x_evgl_api_thread_cmd(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+
+extern void (*orig_evgl_api_glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glColorPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glDepthRangex)(GLclampx zNear, GLclampx zFar);
+EAPI void glDepthRangex_evgl_api_thread_cmd(GLclampx zNear, GLclampx zFar);
+
+extern void (*orig_evgl_api_glDisableClientState)(GLenum array);
+EAPI void glDisableClientState_evgl_api_thread_cmd(GLenum array);
+
+extern void (*orig_evgl_api_glEnableClientState)(GLenum array);
+EAPI void glEnableClientState_evgl_api_thread_cmd(GLenum array);
+
+extern void (*orig_evgl_api_glFogx)(GLenum pname, GLfixed param);
+EAPI void glFogx_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glFogxv)(GLenum pname, const GLfixed *params);
+EAPI void glFogxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glFrustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+EAPI void glFrustumx_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+extern void (*orig_evgl_api_glGetClipPlanex)(GLenum pname, GLfixed eqn[4]);
+EAPI void glGetClipPlanex_evgl_api_thread_cmd(GLenum pname, GLfixed eqn[4]);
+
+extern void (*orig_evgl_api_glGetFixedv)(GLenum pname, GLfixed *params);
+EAPI void glGetFixedv_evgl_api_thread_cmd(GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetLightxv)(GLenum light, GLenum pname, GLfixed *params);
+EAPI void glGetLightxv_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params);
+EAPI void glGetMaterialxv_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetPointerv)(GLenum pname, GLvoid **params);
+EAPI void glGetPointerv_evgl_api_thread_cmd(GLenum pname, GLvoid **params);
+
+extern void (*orig_evgl_api_glGetTexEnviv)(GLenum env, GLenum pname, GLint *params);
+EAPI void glGetTexEnviv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetTexEnvxv)(GLenum env, GLenum pname, GLfixed *params);
+EAPI void glGetTexEnvxv_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetTexParameterxv)(GLenum target, GLenum pname, GLfixed *params);
+EAPI void glGetTexParameterxv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glLightModelx)(GLenum pname, GLfixed param);
+EAPI void glLightModelx_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glLightModelxv)(GLenum pname, const GLfixed *params);
+EAPI void glLightModelxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glLightx)(GLenum light, GLenum pname, GLfixed param);
+EAPI void glLightx_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glLightxv)(GLenum light, GLenum pname, const GLfixed *params);
+EAPI void glLightxv_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glLineWidthx)(GLfixed width);
+EAPI void glLineWidthx_evgl_api_thread_cmd(GLfixed width);
+
+extern void (*orig_evgl_api_glLoadIdentity)(void);
+EAPI void glLoadIdentity_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glLoadMatrixx)(const GLfixed *m);
+EAPI void glLoadMatrixx_evgl_api_thread_cmd(const GLfixed *m);
+
+extern void (*orig_evgl_api_glLogicOp)(GLenum opcode);
+EAPI void glLogicOp_evgl_api_thread_cmd(GLenum opcode);
+
+extern void (*orig_evgl_api_glMaterialx)(GLenum face, GLenum pname, GLfixed param);
+EAPI void glMaterialx_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glMaterialxv)(GLenum face, GLenum pname, const GLfixed *params);
+EAPI void glMaterialxv_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glMatrixMode)(GLenum mode);
+EAPI void glMatrixMode_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glMultMatrixx)(const GLfixed *m);
+EAPI void glMultMatrixx_evgl_api_thread_cmd(const GLfixed *m);
+
+extern void (*orig_evgl_api_glMultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+EAPI void glMultiTexCoord4x_evgl_api_thread_cmd(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+
+extern void (*orig_evgl_api_glNormal3x)(GLfixed nx, GLfixed ny, GLfixed nz);
+EAPI void glNormal3x_evgl_api_thread_cmd(GLfixed nx, GLfixed ny, GLfixed nz);
+
+extern void (*orig_evgl_api_glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glNormalPointer_evgl_api_thread_cmd(GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glOrthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+EAPI void glOrthox_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+extern void (*orig_evgl_api_glPointParameterx)(GLenum pname, GLfixed param);
+EAPI void glPointParameterx_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glPointParameterxv)(GLenum pname, const GLfixed *params);
+EAPI void glPointParameterxv_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glPointSizex)(GLfixed size);
+EAPI void glPointSizex_evgl_api_thread_cmd(GLfixed size);
+
+extern void (*orig_evgl_api_glPolygonOffsetx)(GLfixed factor, GLfixed units);
+EAPI void glPolygonOffsetx_evgl_api_thread_cmd(GLfixed factor, GLfixed units);
+
+extern void (*orig_evgl_api_glPopMatrix)(void);
+EAPI void glPopMatrix_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glPushMatrix)(void);
+EAPI void glPushMatrix_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glRotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+EAPI void glRotatex_evgl_api_thread_cmd(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+
+extern void (*orig_evgl_api_glSampleCoveragex)(GLclampx value, GLboolean invert);
+EAPI void glSampleCoveragex_evgl_api_thread_cmd(GLclampx value, GLboolean invert);
+
+extern void (*orig_evgl_api_glScalex)(GLfixed x, GLfixed y, GLfixed z);
+EAPI void glScalex_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z);
+
+extern void (*orig_evgl_api_glShadeModel)(GLenum mode);
+EAPI void glShadeModel_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glTexCoordPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glTexEnvi)(GLenum target, GLenum pname, GLint param);
+EAPI void glTexEnvi_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glTexEnvx)(GLenum target, GLenum pname, GLfixed param);
+EAPI void glTexEnvx_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glTexEnviv)(GLenum target, GLenum pname, const GLint *params);
+EAPI void glTexEnviv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLint *params);
+
+extern void (*orig_evgl_api_glTexEnvxv)(GLenum target, GLenum pname, const GLfixed *params);
+EAPI void glTexEnvxv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glTexParameterx)(GLenum target, GLenum pname, GLfixed param);
+EAPI void glTexParameterx_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glTexParameterxv)(GLenum target, GLenum pname, const GLfixed *params);
+EAPI void glTexParameterxv_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glTranslatex)(GLfixed x, GLfixed y, GLfixed z);
+EAPI void glTranslatex_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z);
+
+extern void (*orig_evgl_api_glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glVertexPointer_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glBlendEquationSeparateOES)(GLenum modeRGB, GLenum modeAlpha);
+EAPI void glBlendEquationSeparateOES_evgl_api_thread_cmd(GLenum modeRGB, GLenum modeAlpha);
+
+extern void (*orig_evgl_api_glBlendFuncSeparateOES)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+EAPI void glBlendFuncSeparateOES_evgl_api_thread_cmd(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+
+extern void (*orig_evgl_api_glBlendEquationOES)(GLenum mode);
+EAPI void glBlendEquationOES_evgl_api_thread_cmd(GLenum mode);
+
+extern void (*orig_evgl_api_glDrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+EAPI void glDrawTexsOES_evgl_api_thread_cmd(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+
+extern void (*orig_evgl_api_glDrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height);
+EAPI void glDrawTexiOES_evgl_api_thread_cmd(GLint x, GLint y, GLint z, GLint width, GLint height);
+
+extern void (*orig_evgl_api_glDrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+EAPI void glDrawTexxOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+
+extern void (*orig_evgl_api_glDrawTexsvOES)(const GLshort *coords);
+EAPI void glDrawTexsvOES_evgl_api_thread_cmd(const GLshort *coords);
+
+extern void (*orig_evgl_api_glDrawTexivOES)(const GLint *coords);
+EAPI void glDrawTexivOES_evgl_api_thread_cmd(const GLint *coords);
+
+extern void (*orig_evgl_api_glDrawTexxvOES)(const GLfixed *coords);
+EAPI void glDrawTexxvOES_evgl_api_thread_cmd(const GLfixed *coords);
+
+extern void (*orig_evgl_api_glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+EAPI void glDrawTexfOES_evgl_api_thread_cmd(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+
+extern void (*orig_evgl_api_glDrawTexfvOES)(const GLfloat *coords);
+EAPI void glDrawTexfvOES_evgl_api_thread_cmd(const GLfloat *coords);
+
+extern void (*orig_evgl_api_glAlphaFuncxOES)(GLenum func, GLclampx ref);
+EAPI void glAlphaFuncxOES_evgl_api_thread_cmd(GLenum func, GLclampx ref);
+
+extern void (*orig_evgl_api_glClearColorxOES)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+EAPI void glClearColorxOES_evgl_api_thread_cmd(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+
+extern void (*orig_evgl_api_glClearDepthxOES)(GLclampx depth);
+EAPI void glClearDepthxOES_evgl_api_thread_cmd(GLclampx depth);
+
+extern void (*orig_evgl_api_glClipPlanexOES)(GLenum plane, const GLfixed *equation);
+EAPI void glClipPlanexOES_evgl_api_thread_cmd(GLenum plane, const GLfixed *equation);
+
+extern void (*orig_evgl_api_glColor4xOES)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+EAPI void glColor4xOES_evgl_api_thread_cmd(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+
+extern void (*orig_evgl_api_glDepthRangexOES)(GLclampx zNear, GLclampx zFar);
+EAPI void glDepthRangexOES_evgl_api_thread_cmd(GLclampx zNear, GLclampx zFar);
+
+extern void (*orig_evgl_api_glFogxOES)(GLenum pname, GLfixed param);
+EAPI void glFogxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glFogxvOES)(GLenum pname, const GLfixed *params);
+EAPI void glFogxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glFrustumxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+EAPI void glFrustumxOES_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+extern void (*orig_evgl_api_glGetClipPlanexOES)(GLenum pname, GLfixed eqn[4]);
+EAPI void glGetClipPlanexOES_evgl_api_thread_cmd(GLenum pname, GLfixed eqn[4]);
+
+extern void (*orig_evgl_api_glGetFixedvOES)(GLenum pname, GLfixed *params);
+EAPI void glGetFixedvOES_evgl_api_thread_cmd(GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetLightxvOES)(GLenum light, GLenum pname, GLfixed *params);
+EAPI void glGetLightxvOES_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetMaterialxvOES)(GLenum face, GLenum pname, GLfixed *params);
+EAPI void glGetMaterialxvOES_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetTexEnvxvOES)(GLenum env, GLenum pname, GLfixed *params);
+EAPI void glGetTexEnvxvOES_evgl_api_thread_cmd(GLenum env, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glGetTexParameterxvOES)(GLenum target, GLenum pname, GLfixed *params);
+EAPI void glGetTexParameterxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glLightModelxOES)(GLenum pname, GLfixed param);
+EAPI void glLightModelxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glLightModelxvOES)(GLenum pname, const GLfixed *params);
+EAPI void glLightModelxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glLightxOES)(GLenum light, GLenum pname, GLfixed param);
+EAPI void glLightxOES_evgl_api_thread_cmd(GLenum light, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glLightxvOES)(GLenum light, GLenum pname, const GLfixed *params);
+EAPI void glLightxvOES_evgl_api_thread_cmd(GLenum light, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glLineWidthxOES)(GLfixed width);
+EAPI void glLineWidthxOES_evgl_api_thread_cmd(GLfixed width);
+
+extern void (*orig_evgl_api_glLoadMatrixxOES)(const GLfixed *m);
+EAPI void glLoadMatrixxOES_evgl_api_thread_cmd(const GLfixed *m);
+
+extern void (*orig_evgl_api_glMaterialxOES)(GLenum face, GLenum pname, GLfixed param);
+EAPI void glMaterialxOES_evgl_api_thread_cmd(GLenum face, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glMaterialxvOES)(GLenum face, GLenum pname, const GLfixed *params);
+EAPI void glMaterialxvOES_evgl_api_thread_cmd(GLenum face, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glMultMatrixxOES)(const GLfixed *m);
+EAPI void glMultMatrixxOES_evgl_api_thread_cmd(const GLfixed *m);
+
+extern void (*orig_evgl_api_glMultiTexCoord4xOES)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+EAPI void glMultiTexCoord4xOES_evgl_api_thread_cmd(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+
+extern void (*orig_evgl_api_glNormal3xOES)(GLfixed nx, GLfixed ny, GLfixed nz);
+EAPI void glNormal3xOES_evgl_api_thread_cmd(GLfixed nx, GLfixed ny, GLfixed nz);
+
+extern void (*orig_evgl_api_glOrthoxOES)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+EAPI void glOrthoxOES_evgl_api_thread_cmd(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+
+extern void (*orig_evgl_api_glPointParameterxOES)(GLenum pname, GLfixed param);
+EAPI void glPointParameterxOES_evgl_api_thread_cmd(GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glPointParameterxvOES)(GLenum pname, const GLfixed *params);
+EAPI void glPointParameterxvOES_evgl_api_thread_cmd(GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glPointSizexOES)(GLfixed size);
+EAPI void glPointSizexOES_evgl_api_thread_cmd(GLfixed size);
+
+extern void (*orig_evgl_api_glPolygonOffsetxOES)(GLfixed factor, GLfixed units);
+EAPI void glPolygonOffsetxOES_evgl_api_thread_cmd(GLfixed factor, GLfixed units);
+
+extern void (*orig_evgl_api_glRotatexOES)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+EAPI void glRotatexOES_evgl_api_thread_cmd(GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+
+extern void (*orig_evgl_api_glSampleCoveragexOES)(GLclampx value, GLboolean invert);
+EAPI void glSampleCoveragexOES_evgl_api_thread_cmd(GLclampx value, GLboolean invert);
+
+extern void (*orig_evgl_api_glScalexOES)(GLfixed x, GLfixed y, GLfixed z);
+EAPI void glScalexOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z);
+
+extern void (*orig_evgl_api_glTexEnvxOES)(GLenum target, GLenum pname, GLfixed param);
+EAPI void glTexEnvxOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glTexEnvxvOES)(GLenum target, GLenum pname, const GLfixed *params);
+EAPI void glTexEnvxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glTexParameterxOES)(GLenum target, GLenum pname, GLfixed param);
+EAPI void glTexParameterxOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glTexParameterxvOES)(GLenum target, GLenum pname, const GLfixed *params);
+EAPI void glTexParameterxvOES_evgl_api_thread_cmd(GLenum target, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glTranslatexOES)(GLfixed x, GLfixed y, GLfixed z);
+EAPI void glTranslatexOES_evgl_api_thread_cmd(GLfixed x, GLfixed y, GLfixed z);
+
+extern GLboolean (*orig_evgl_api_glIsRenderbufferOES)(GLuint renderbuffer);
+EAPI GLboolean glIsRenderbufferOES_evgl_api_thread_cmd(GLuint renderbuffer);
+
+extern void (*orig_evgl_api_glBindRenderbufferOES)(GLenum target, GLuint renderbuffer);
+EAPI void glBindRenderbufferOES_evgl_api_thread_cmd(GLenum target, GLuint renderbuffer);
+
+extern void (*orig_evgl_api_glDeleteRenderbuffersOES)(GLsizei n, const GLuint* renderbuffers);
+EAPI void glDeleteRenderbuffersOES_evgl_api_thread_cmd(GLsizei n, const GLuint* renderbuffers);
+
+extern void (*orig_evgl_api_glGenRenderbuffersOES)(GLsizei n, GLuint* renderbuffers);
+EAPI void glGenRenderbuffersOES_evgl_api_thread_cmd(GLsizei n, GLuint* renderbuffers);
+
+extern void (*orig_evgl_api_glRenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glGetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint* params);
+EAPI void glGetRenderbufferParameterivOES_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint* params);
+
+extern GLboolean (*orig_evgl_api_glIsFramebufferOES)(GLuint framebuffer);
+EAPI GLboolean glIsFramebufferOES_evgl_api_thread_cmd(GLuint framebuffer);
+
+extern void (*orig_evgl_api_glBindFramebufferOES)(GLenum target, GLuint framebuffer);
+EAPI void glBindFramebufferOES_evgl_api_thread_cmd(GLenum target, GLuint framebuffer);
+
+extern void (*orig_evgl_api_glDeleteFramebuffersOES)(GLsizei n, const GLuint* framebuffers);
+EAPI void glDeleteFramebuffersOES_evgl_api_thread_cmd(GLsizei n, const GLuint* framebuffers);
+
+extern void (*orig_evgl_api_glGenFramebuffersOES)(GLsizei n, GLuint* framebuffers);
+EAPI void glGenFramebuffersOES_evgl_api_thread_cmd(GLsizei n, GLuint* framebuffers);
+
+extern GLenum (*orig_evgl_api_glCheckFramebufferStatusOES)(GLenum target);
+EAPI GLenum glCheckFramebufferStatusOES_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glFramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+EAPI void glFramebufferRenderbufferOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+extern void (*orig_evgl_api_glFramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+EAPI void glFramebufferTexture2DOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+extern void (*orig_evgl_api_glGetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+EAPI void glGetFramebufferAttachmentParameterivOES_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLenum pname, GLint* params);
+
+extern void (*orig_evgl_api_glGenerateMipmapOES)(GLenum target);
+EAPI void glGenerateMipmapOES_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glCurrentPaletteMatrixOES)(GLuint matrixpaletteindex);
+EAPI void glCurrentPaletteMatrixOES_evgl_api_thread_cmd(GLuint matrixpaletteindex);
+
+extern void (*orig_evgl_api_glLoadPaletteFromModelViewMatrixOES)(void);
+EAPI void glLoadPaletteFromModelViewMatrixOES_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glMatrixIndexPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glMatrixIndexPointerOES_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glWeightPointerOES)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glWeightPointerOES_evgl_api_thread_cmd(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern GLbitfield (*orig_evgl_api_glQueryMatrixxOES)(GLfixed mantissa[16], GLint exponent[16]);
+EAPI GLbitfield glQueryMatrixxOES_evgl_api_thread_cmd(GLfixed mantissa[16], GLint exponent[16]);
+
+extern void (*orig_evgl_api_glDepthRangefOES)(GLclampf zNear, GLclampf zFar);
+EAPI void glDepthRangefOES_evgl_api_thread_cmd(GLclampf zNear, GLclampf zFar);
+
+extern void (*orig_evgl_api_glFrustumfOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+EAPI void glFrustumfOES_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+extern void (*orig_evgl_api_glOrthofOES)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+EAPI void glOrthofOES_evgl_api_thread_cmd(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+extern void (*orig_evgl_api_glClipPlanefOES)(GLenum plane, const GLfloat *equation);
+EAPI void glClipPlanefOES_evgl_api_thread_cmd(GLenum plane, const GLfloat *equation);
+
+extern void (*orig_evgl_api_glGetClipPlanefOES)(GLenum pname, GLfloat eqn[4]);
+EAPI void glGetClipPlanefOES_evgl_api_thread_cmd(GLenum pname, GLfloat eqn[4]);
+
+extern void (*orig_evgl_api_glClearDepthfOES)(GLclampf depth);
+EAPI void glClearDepthfOES_evgl_api_thread_cmd(GLclampf depth);
+
+extern void (*orig_evgl_api_glTexGenfOES)(GLenum coord, GLenum pname, GLfloat param);
+EAPI void glTexGenfOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glTexGenfvOES)(GLenum coord, GLenum pname, const GLfloat *params);
+EAPI void glTexGenfvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLfloat *params);
+
+extern void (*orig_evgl_api_glTexGeniOES)(GLenum coord, GLenum pname, GLint param);
+EAPI void glTexGeniOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glTexGenivOES)(GLenum coord, GLenum pname, const GLint *params);
+EAPI void glTexGenivOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLint *params);
+
+extern void (*orig_evgl_api_glTexGenxOES)(GLenum coord, GLenum pname, GLfixed param);
+EAPI void glTexGenxOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfixed param);
+
+extern void (*orig_evgl_api_glTexGenxvOES)(GLenum coord, GLenum pname, const GLfixed *params);
+EAPI void glTexGenxvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, const GLfixed *params);
+
+extern void (*orig_evgl_api_glGetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat *params);
+EAPI void glGetTexGenfvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfloat *params);
+
+extern void (*orig_evgl_api_glGetTexGenivOES)(GLenum coord, GLenum pname, GLint *params);
+EAPI void glGetTexGenivOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params);
+EAPI void glGetTexGenxvOES_evgl_api_thread_cmd(GLenum coord, GLenum pname, GLfixed *params);
+
+extern void (*orig_evgl_api_glBindVertexArrayOES)(GLuint array);
+EAPI void glBindVertexArrayOES_evgl_api_thread_cmd(GLuint array);
+
+extern void (*orig_evgl_api_glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays);
+EAPI void glDeleteVertexArraysOES_evgl_api_thread_cmd(GLsizei n, const GLuint *arrays);
+
+extern void (*orig_evgl_api_glGenVertexArraysOES)(GLsizei n, GLuint *arrays);
+EAPI void glGenVertexArraysOES_evgl_api_thread_cmd(GLsizei n, GLuint *arrays);
+
+extern GLboolean (*orig_evgl_api_glIsVertexArrayOES)(GLuint array);
+EAPI GLboolean glIsVertexArrayOES_evgl_api_thread_cmd(GLuint array);
+
+extern void (*orig_evgl_api_glCopyTextureLevelsAPPLE)(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+EAPI void glCopyTextureLevelsAPPLE_evgl_api_thread_cmd(GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+
+extern void (*orig_evgl_api_glRenderbufferStorageMultisampleAPPLE)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+EAPI void glRenderbufferStorageMultisampleAPPLE_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+extern void (*orig_evgl_api_glResolveMultisampleFramebufferAPPLE)(void);
+EAPI void glResolveMultisampleFramebufferAPPLE_evgl_api_thread_cmd(void);
+
+extern GLsync (*orig_evgl_api_glFenceSyncAPPLE)(GLenum condition, GLbitfield flags);
+EAPI GLsync glFenceSyncAPPLE_evgl_api_thread_cmd(GLenum condition, GLbitfield flags);
+
+extern GLboolean (*orig_evgl_api_glIsSyncAPPLE)(GLsync sync);
+EAPI GLboolean glIsSyncAPPLE_evgl_api_thread_cmd(GLsync sync);
+
+extern void (*orig_evgl_api_glDeleteSyncAPPLE)(GLsync sync);
+EAPI void glDeleteSyncAPPLE_evgl_api_thread_cmd(GLsync sync);
+
+extern GLenum (*orig_evgl_api_glClientWaitSyncAPPLE)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+EAPI GLenum glClientWaitSyncAPPLE_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+extern void (*orig_evgl_api_glWaitSyncAPPLE)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+EAPI void glWaitSyncAPPLE_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+extern void (*orig_evgl_api_glGetInteger64vAPPLE)(GLenum pname, EvasGLint64 *params);
+EAPI void glGetInteger64vAPPLE_evgl_api_thread_cmd(GLenum pname, EvasGLint64 *params);
+
+extern void (*orig_evgl_api_glGetSyncivAPPLE)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+EAPI void glGetSyncivAPPLE_evgl_api_thread_cmd(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
+extern void * (*orig_evgl_api_glMapBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+EAPI void * glMapBufferRangeEXT_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+
+extern void (*orig_evgl_api_glFlushMappedBufferRangeEXT)(GLenum target, GLintptr offset, GLsizeiptr length);
+EAPI void glFlushMappedBufferRangeEXT_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length);
+
+extern void (*orig_evgl_api_glRenderbufferStorageMultisampleEXT)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+EAPI void glRenderbufferStorageMultisampleEXT_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+extern void (*orig_evgl_api_glFramebufferTexture2DMultisample)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+EAPI void glFramebufferTexture2DMultisample_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+extern void (*orig_evgl_api_glFramebufferTexture2DMultisampleEXT)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+EAPI void glFramebufferTexture2DMultisampleEXT_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+extern GLenum (*orig_evgl_api_glGetGraphicsResetStatus)(void);
+EAPI GLenum glGetGraphicsResetStatus_evgl_api_thread_cmd(void);
+
+extern GLenum (*orig_evgl_api_glGetGraphicsResetStatusEXT)(void);
+EAPI GLenum glGetGraphicsResetStatusEXT_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glReadnPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+EAPI void glReadnPixels_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+
+extern void (*orig_evgl_api_glReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+EAPI void glReadnPixelsEXT_evgl_api_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+
+extern void (*orig_evgl_api_glGetnUniformfv)(GLuint program, GLint location, GLsizei bufSize, float *params);
+EAPI void glGetnUniformfv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, float *params);
+
+extern void (*orig_evgl_api_glGetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params);
+EAPI void glGetnUniformfvEXT_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, float *params);
+
+extern void (*orig_evgl_api_glGetnUniformiv)(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+EAPI void glGetnUniformiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+
+extern void (*orig_evgl_api_glGetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+EAPI void glGetnUniformivEXT_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+
+extern void (*orig_evgl_api_glTexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+EAPI void glTexStorage1DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+
+extern void (*orig_evgl_api_glTexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glTexStorage2DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glTexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+EAPI void glTexStorage3DEXT_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+extern void (*orig_evgl_api_glTextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+EAPI void glTextureStorage1DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+
+extern void (*orig_evgl_api_glTextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glTextureStorage2DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glTextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+EAPI void glTextureStorage3DEXT_evgl_api_thread_cmd(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+extern void (*orig_evgl_api_glClipPlanefIMG)(GLenum a, const GLfloat * b);
+EAPI void glClipPlanefIMG_evgl_api_thread_cmd(GLenum a, const GLfloat * b);
+
+extern void (*orig_evgl_api_glClipPlanexIMG)(GLenum a, const GLfixed * b);
+EAPI void glClipPlanexIMG_evgl_api_thread_cmd(GLenum a, const GLfixed * b);
+
+extern void (*orig_evgl_api_glRenderbufferStorageMultisampleIMG)(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+EAPI void glRenderbufferStorageMultisampleIMG_evgl_api_thread_cmd(GLenum a, GLsizei b, GLenum c, GLsizei d, GLsizei e);
+
+extern void (*orig_evgl_api_glFramebufferTexture2DMultisampleIMG)(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+EAPI void glFramebufferTexture2DMultisampleIMG_evgl_api_thread_cmd(GLenum a, GLenum b, GLenum c, GLuint d, GLint e, GLsizei f);
+
+extern void (*orig_evgl_api_glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+EAPI void glStartTilingQCOM_evgl_api_thread_cmd(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+
+extern void (*orig_evgl_api_glEndTilingQCOM)(GLbitfield preserveMask);
+EAPI void glEndTilingQCOM_evgl_api_thread_cmd(GLbitfield preserveMask);
+
+extern void (*orig_evgl_api_glBeginQuery)(GLenum target, GLuint id);
+EAPI void glBeginQuery_evgl_api_thread_cmd(GLenum target, GLuint id);
+
+extern void (*orig_evgl_api_glBeginTransformFeedback)(GLenum primitiveMode);
+EAPI void glBeginTransformFeedback_evgl_api_thread_cmd(GLenum primitiveMode);
+
+extern void (*orig_evgl_api_glBindBufferBase)(GLenum target, GLuint index, GLuint buffer);
+EAPI void glBindBufferBase_evgl_api_thread_cmd(GLenum target, GLuint index, GLuint buffer);
+
+extern void (*orig_evgl_api_glBindBufferRange)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+EAPI void glBindBufferRange_evgl_api_thread_cmd(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+
+extern void (*orig_evgl_api_glBindSampler)(GLuint unit, GLuint sampler);
+EAPI void glBindSampler_evgl_api_thread_cmd(GLuint unit, GLuint sampler);
+
+extern void (*orig_evgl_api_glBindTransformFeedback)(GLenum target, GLuint id);
+EAPI void glBindTransformFeedback_evgl_api_thread_cmd(GLenum target, GLuint id);
+
+extern void (*orig_evgl_api_glBindVertexArray)(GLuint array);
+EAPI void glBindVertexArray_evgl_api_thread_cmd(GLuint array);
+
+extern void (*orig_evgl_api_glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+EAPI void glBlitFramebuffer_evgl_api_thread_cmd(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+extern void (*orig_evgl_api_glClearBufferfi)(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
+EAPI void glClearBufferfi_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
+
+extern void (*orig_evgl_api_glClearBufferfv)(GLenum buffer, GLint drawBuffer, const GLfloat * value);
+EAPI void glClearBufferfv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLfloat * value);
+
+extern void (*orig_evgl_api_glClearBufferiv)(GLenum buffer, GLint drawBuffer, const GLint * value);
+EAPI void glClearBufferiv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLint * value);
+
+extern void (*orig_evgl_api_glClearBufferuiv)(GLenum buffer, GLint drawBuffer, const GLuint * value);
+EAPI void glClearBufferuiv_evgl_api_thread_cmd(GLenum buffer, GLint drawBuffer, const GLuint * value);
+
+extern GLenum (*orig_evgl_api_glClientWaitSync)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+EAPI GLenum glClientWaitSync_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+extern void (*orig_evgl_api_glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
+EAPI void glCompressedTexImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
+
+extern void (*orig_evgl_api_glCompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
+EAPI void glCompressedTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
+
+extern void (*orig_evgl_api_glCopyBufferSubData)(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+EAPI void glCopyBufferSubData_evgl_api_thread_cmd(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+
+extern void (*orig_evgl_api_glCopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glCopyTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glDeleteQueries)(GLsizei n, const GLuint * ids);
+EAPI void glDeleteQueries_evgl_api_thread_cmd(GLsizei n, const GLuint * ids);
+
+extern void (*orig_evgl_api_glDeleteSamplers)(GLsizei n, const GLuint * samplers);
+EAPI void glDeleteSamplers_evgl_api_thread_cmd(GLsizei n, const GLuint * samplers);
+
+extern void (*orig_evgl_api_glDeleteSync)(GLsync sync);
+EAPI void glDeleteSync_evgl_api_thread_cmd(GLsync sync);
+
+extern void (*orig_evgl_api_glDeleteTransformFeedbacks)(GLsizei n, const GLuint *ids);
+EAPI void glDeleteTransformFeedbacks_evgl_api_thread_cmd(GLsizei n, const GLuint *ids);
+
+extern void (*orig_evgl_api_glDeleteVertexArrays)(GLsizei n, const GLuint *arrays);
+EAPI void glDeleteVertexArrays_evgl_api_thread_cmd(GLsizei n, const GLuint *arrays);
+
+extern void (*orig_evgl_api_glDrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+EAPI void glDrawArraysInstanced_evgl_api_thread_cmd(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+
+extern void (*orig_evgl_api_glDrawBuffers)(GLsizei n, const GLenum *bufs);
+EAPI void glDrawBuffers_evgl_api_thread_cmd(GLsizei n, const GLenum *bufs);
+
+extern void (*orig_evgl_api_glDrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+EAPI void glDrawElementsInstanced_evgl_api_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount);
+
+extern void (*orig_evgl_api_glDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
+EAPI void glDrawRangeElements_evgl_api_thread_cmd(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices);
+
+extern void (*orig_evgl_api_glEndQuery)(GLenum target);
+EAPI void glEndQuery_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glEndTransformFeedback)(void);
+EAPI void glEndTransformFeedback_evgl_api_thread_cmd(void);
+
+extern GLsync (*orig_evgl_api_glFenceSync)(GLenum condition, GLbitfield flags);
+EAPI GLsync glFenceSync_evgl_api_thread_cmd(GLenum condition, GLbitfield flags);
+
+extern GLsync (*orig_evgl_api_glFlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length);
+EAPI GLsync glFlushMappedBufferRange_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length);
+
+extern void (*orig_evgl_api_glFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+EAPI void glFramebufferTextureLayer_evgl_api_thread_cmd(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+
+extern void (*orig_evgl_api_glGenQueries)(GLsizei n, GLuint * ids);
+EAPI void glGenQueries_evgl_api_thread_cmd(GLsizei n, GLuint * ids);
+
+extern void (*orig_evgl_api_glGenSamplers)(GLsizei n, GLuint *samplers);
+EAPI void glGenSamplers_evgl_api_thread_cmd(GLsizei n, GLuint *samplers);
+
+extern void (*orig_evgl_api_glGenTransformFeedbacks)(GLsizei n, GLuint *ids);
+EAPI void glGenTransformFeedbacks_evgl_api_thread_cmd(GLsizei n, GLuint *ids);
+
+extern void (*orig_evgl_api_glGenVertexArrays)(GLsizei n, GLuint *arrays);
+EAPI void glGenVertexArrays_evgl_api_thread_cmd(GLsizei n, GLuint *arrays);
+
+extern void (*orig_evgl_api_glGetActiveUniformBlockiv)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+EAPI void glGetActiveUniformBlockiv_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetActiveUniformBlockName)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+EAPI void glGetActiveUniformBlockName_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+
+extern void (*orig_evgl_api_glGetActiveUniformsiv)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+EAPI void glGetActiveUniformsiv_evgl_api_thread_cmd(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetBufferParameteri64v)(GLenum target, GLenum value, EvasGLint64 * data);
+EAPI void glGetBufferParameteri64v_evgl_api_thread_cmd(GLenum target, GLenum value, EvasGLint64 * data);
+
+extern void (*orig_evgl_api_glGetBufferPointerv)(GLenum target, GLenum pname, GLvoid ** params);
+EAPI void glGetBufferPointerv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLvoid ** params);
+
+extern GLint (*orig_evgl_api_glGetFragDataLocation)(GLuint program, const char * name);
+EAPI GLint glGetFragDataLocation_evgl_api_thread_cmd(GLuint program, const char * name);
+
+extern void (*orig_evgl_api_glGetInteger64i_v)(GLenum target, GLuint index, EvasGLint64 * data);
+EAPI void glGetInteger64i_v_evgl_api_thread_cmd(GLenum target, GLuint index, EvasGLint64 * data);
+
+extern void (*orig_evgl_api_glGetInteger64v)(GLenum pname, EvasGLint64 * data);
+EAPI void glGetInteger64v_evgl_api_thread_cmd(GLenum pname, EvasGLint64 * data);
+
+extern void (*orig_evgl_api_glGetIntegeri_v)(GLenum target, GLuint index, GLint * data);
+EAPI void glGetIntegeri_v_evgl_api_thread_cmd(GLenum target, GLuint index, GLint * data);
+
+extern void (*orig_evgl_api_glGetInternalformativ)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+EAPI void glGetInternalformativ_evgl_api_thread_cmd(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+
+extern void (*orig_evgl_api_glGetProgramBinary)(GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary);
+EAPI void glGetProgramBinary_evgl_api_thread_cmd(GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+extern void (*orig_evgl_api_glGetQueryiv)(GLenum target, GLenum pname, GLint * params);
+EAPI void glGetQueryiv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint * params);
+
+extern void (*orig_evgl_api_glGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint * params);
+EAPI void glGetQueryObjectuiv_evgl_api_thread_cmd(GLuint id, GLenum pname, GLuint * params);
+
+extern void (*orig_evgl_api_glGetSamplerParameterfv)(GLuint sampler, GLenum pname, GLfloat * params);
+EAPI void glGetSamplerParameterfv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLfloat * params);
+
+extern void (*orig_evgl_api_glGetSamplerParameteriv)(GLuint sampler, GLenum pname, GLint * params);
+EAPI void glGetSamplerParameteriv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLint * params);
+
+extern const GLubyte * (*orig_evgl_api_glGetStringi)(GLenum name, GLuint index);
+EAPI const GLubyte * glGetStringi_evgl_api_thread_cmd(GLenum name, GLuint index);
+
+extern void (*orig_evgl_api_glGetSynciv)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+EAPI void glGetSynciv_evgl_api_thread_cmd(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
+extern void (*orig_evgl_api_glGetTransformFeedbackVarying)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name);
+EAPI void glGetTransformFeedbackVarying_evgl_api_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name);
+
+extern GLuint (*orig_evgl_api_glGetUniformBlockIndex)(GLuint program, const GLchar *uniformBlockName);
+EAPI GLuint glGetUniformBlockIndex_evgl_api_thread_cmd(GLuint program, const GLchar *uniformBlockName);
+
+extern void (*orig_evgl_api_glGetUniformIndices)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+EAPI void glGetUniformIndices_evgl_api_thread_cmd(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+
+extern void (*orig_evgl_api_glGetUniformuiv)(GLuint program, GLint location, GLuint* params);
+EAPI void glGetUniformuiv_evgl_api_thread_cmd(GLuint program, GLint location, GLuint* params);
+
+extern void (*orig_evgl_api_glGetVertexAttribIiv)(GLuint index, GLenum pname, GLint *params);
+EAPI void glGetVertexAttribIiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetVertexAttribIuiv)(GLuint index, GLenum pname, GLuint *params);
+EAPI void glGetVertexAttribIuiv_evgl_api_thread_cmd(GLuint index, GLenum pname, GLuint *params);
+
+extern void (*orig_evgl_api_glInvalidateFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+EAPI void glInvalidateFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+
+extern void (*orig_evgl_api_glInvalidateSubFramebuffer)(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glInvalidateSubFramebuffer_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+
+extern GLboolean (*orig_evgl_api_glIsQuery)(GLuint id);
+EAPI GLboolean glIsQuery_evgl_api_thread_cmd(GLuint id);
+
+extern GLboolean (*orig_evgl_api_glIsSampler)(GLuint id);
+EAPI GLboolean glIsSampler_evgl_api_thread_cmd(GLuint id);
+
+extern GLboolean (*orig_evgl_api_glIsSync)(GLsync sync);
+EAPI GLboolean glIsSync_evgl_api_thread_cmd(GLsync sync);
+
+extern GLboolean (*orig_evgl_api_glIsTransformFeedback)(GLuint id);
+EAPI GLboolean glIsTransformFeedback_evgl_api_thread_cmd(GLuint id);
+
+extern GLboolean (*orig_evgl_api_glIsVertexArray)(GLuint array);
+EAPI GLboolean glIsVertexArray_evgl_api_thread_cmd(GLuint array);
+
+extern void * (*orig_evgl_api_glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+EAPI void * glMapBufferRange_evgl_api_thread_cmd(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+
+extern void (*orig_evgl_api_glPauseTransformFeedback)(void);
+EAPI void glPauseTransformFeedback_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+EAPI void glProgramBinary_evgl_api_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+
+extern void (*orig_evgl_api_glProgramParameteri)(GLuint program, GLenum pname, GLint value);
+EAPI void glProgramParameteri_evgl_api_thread_cmd(GLuint program, GLenum pname, GLint value);
+
+extern void (*orig_evgl_api_glReadBuffer)(GLenum src);
+EAPI void glReadBuffer_evgl_api_thread_cmd(GLenum src);
+
+extern void (*orig_evgl_api_glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glRenderbufferStorageMultisample_evgl_api_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glResumeTransformFeedback)(void);
+EAPI void glResumeTransformFeedback_evgl_api_thread_cmd(void);
+
+extern void (*orig_evgl_api_glSamplerParameterf)(GLuint sampler, GLenum pname, GLfloat param);
+EAPI void glSamplerParameterf_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLfloat param);
+
+extern void (*orig_evgl_api_glSamplerParameterfv)(GLuint sampler, GLenum pname, const GLfloat * params);
+EAPI void glSamplerParameterfv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, const GLfloat * params);
+
+extern void (*orig_evgl_api_glSamplerParameteri)(GLuint sampler, GLenum pname, GLint param);
+EAPI void glSamplerParameteri_evgl_api_thread_cmd(GLuint sampler, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glSamplerParameteriv)(GLuint sampler, GLenum pname, const GLint * params);
+EAPI void glSamplerParameteriv_evgl_api_thread_cmd(GLuint sampler, GLenum pname, const GLint * params);
+
+extern void (*orig_evgl_api_glTexImage3D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data);
+EAPI void glTexImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data);
+
+extern void (*orig_evgl_api_glTexStorage2D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glTexStorage2D_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+
+extern void (*orig_evgl_api_glTexStorage3D)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+EAPI void glTexStorage3D_evgl_api_thread_cmd(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+extern void (*orig_evgl_api_glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data);
+EAPI void glTexSubImage3D_evgl_api_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data);
+
+extern void (*orig_evgl_api_glTransformFeedbackVaryings)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+EAPI void glTransformFeedbackVaryings_evgl_api_thread_cmd(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+
+extern void (*orig_evgl_api_glUniform1ui)(GLint location, GLuint v0);
+EAPI void glUniform1ui_evgl_api_thread_cmd(GLint location, GLuint v0);
+
+extern void (*orig_evgl_api_glUniform1uiv)(GLint location, GLsizei count, const GLuint *value);
+EAPI void glUniform1uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glUniform2ui)(GLint location, GLuint v0, GLuint v1);
+EAPI void glUniform2ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1);
+
+extern void (*orig_evgl_api_glUniform2uiv)(GLint location, GLsizei count, const GLuint *value);
+EAPI void glUniform2uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glUniform3ui)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+EAPI void glUniform3ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1, GLuint v2);
+
+extern void (*orig_evgl_api_glUniform3uiv)(GLint location, GLsizei count, const GLuint *value);
+EAPI void glUniform3uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glUniform4ui)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+EAPI void glUniform4ui_evgl_api_thread_cmd(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+extern void (*orig_evgl_api_glUniform4uiv)(GLint location, GLsizei count, const GLuint *value);
+EAPI void glUniform4uiv_evgl_api_thread_cmd(GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glUniformBlockBinding)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+EAPI void glUniformBlockBinding_evgl_api_thread_cmd(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+extern void (*orig_evgl_api_glUniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix2x3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glUniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix3x2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glUniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix2x4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glUniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix4x2fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glUniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix3x4fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glUniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix4x3fv_evgl_api_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern GLboolean (*orig_evgl_api_glUnmapBuffer)(GLenum target);
+EAPI GLboolean glUnmapBuffer_evgl_api_thread_cmd(GLenum target);
+
+extern void (*orig_evgl_api_glVertexAttribDivisor)(GLuint index, GLuint divisor);
+EAPI void glVertexAttribDivisor_evgl_api_thread_cmd(GLuint index, GLuint divisor);
+
+extern void (*orig_evgl_api_glVertexAttribI4i)(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+EAPI void glVertexAttribI4i_evgl_api_thread_cmd(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+
+extern void (*orig_evgl_api_glVertexAttribI4iv)(GLuint index, const GLint *v);
+EAPI void glVertexAttribI4iv_evgl_api_thread_cmd(GLuint index, const GLint *v);
+
+extern void (*orig_evgl_api_glVertexAttribI4ui)(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+EAPI void glVertexAttribI4ui_evgl_api_thread_cmd(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+extern void (*orig_evgl_api_glVertexAttribI4uiv)(GLuint index, const GLuint *v);
+EAPI void glVertexAttribI4uiv_evgl_api_thread_cmd(GLuint index, const GLuint *v);
+
+extern void (*orig_evgl_api_glVertexAttribIPointer)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+EAPI void glVertexAttribIPointer_evgl_api_thread_cmd(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+
+extern void (*orig_evgl_api_glWaitSync)(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+EAPI void glWaitSync_evgl_api_thread_cmd(GLsync sync, GLbitfield flags, EvasGLuint64 timeout);
+
+extern void (*orig_evgl_api_glDispatchCompute)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+EAPI void glDispatchCompute_evgl_api_thread_cmd(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+
+extern void (*orig_evgl_api_glDispatchComputeIndirect)(GLintptr indirect);
+EAPI void glDispatchComputeIndirect_evgl_api_thread_cmd(GLintptr indirect);
+
+extern void (*orig_evgl_api_glDrawArraysIndirect)(GLenum mode, const void *indirect);
+EAPI void glDrawArraysIndirect_evgl_api_thread_cmd(GLenum mode, const void *indirect);
+
+extern void (*orig_evgl_api_glDrawElementsIndirect)(GLenum mode, GLenum type, const void *indirect);
+EAPI void glDrawElementsIndirect_evgl_api_thread_cmd(GLenum mode, GLenum type, const void *indirect);
+
+extern void (*orig_evgl_api_glFramebufferParameteri)(GLenum target, GLenum pname, GLint param);
+EAPI void glFramebufferParameteri_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint param);
+
+extern void (*orig_evgl_api_glGetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+EAPI void glGetFramebufferParameteriv_evgl_api_thread_cmd(GLenum target, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetProgramInterfaceiv)(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+EAPI void glGetProgramInterfaceiv_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+
+extern GLuint (*orig_evgl_api_glGetProgramResourceIndex)(GLuint program, GLenum programInterface, const GLchar *name);
+EAPI GLuint glGetProgramResourceIndex_evgl_api_thread_cmd(GLuint program, GLenum programInterface, const GLchar *name);
+
+extern void (*orig_evgl_api_glGetProgramResourceName)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+EAPI void glGetProgramResourceName_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+
+extern void (*orig_evgl_api_glGetProgramResourceiv)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+EAPI void glGetProgramResourceiv_evgl_api_thread_cmd(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+
+extern GLint (*orig_evgl_api_glGetProgramResourceLocation)(GLuint program, GLenum programInterface, const GLchar *name);
+EAPI GLint glGetProgramResourceLocation_evgl_api_thread_cmd(GLuint program, GLenum programInterface, const GLchar *name);
+
+extern void (*orig_evgl_api_glUseProgramStages)(GLuint pipeline, GLbitfield stages, GLuint program);
+EAPI void glUseProgramStages_evgl_api_thread_cmd(GLuint pipeline, GLbitfield stages, GLuint program);
+
+extern void (*orig_evgl_api_glActiveShaderProgram)(GLuint pipeline, GLuint program);
+EAPI void glActiveShaderProgram_evgl_api_thread_cmd(GLuint pipeline, GLuint program);
+
+extern GLuint (*orig_evgl_api_glCreateShaderProgramv)(GLenum type, GLsizei count, const GLchar *const*strings);
+EAPI GLuint glCreateShaderProgramv_evgl_api_thread_cmd(GLenum type, GLsizei count, const GLchar *const*strings);
+
+extern void (*orig_evgl_api_glBindProgramPipeline)(GLuint pipeline);
+EAPI void glBindProgramPipeline_evgl_api_thread_cmd(GLuint pipeline);
+
+extern void (*orig_evgl_api_glDeleteProgramPipelines)(GLsizei n, const GLuint *pipelines);
+EAPI void glDeleteProgramPipelines_evgl_api_thread_cmd(GLsizei n, const GLuint *pipelines);
+
+extern void (*orig_evgl_api_glGenProgramPipelines)(GLsizei n, GLuint *pipelines);
+EAPI void glGenProgramPipelines_evgl_api_thread_cmd(GLsizei n, GLuint *pipelines);
+
+extern GLboolean (*orig_evgl_api_glIsProgramPipeline)(GLuint pipeline);
+EAPI GLboolean glIsProgramPipeline_evgl_api_thread_cmd(GLuint pipeline);
+
+extern void (*orig_evgl_api_glGetProgramPipelineiv)(GLuint pipeline, GLenum pname, GLint *params);
+EAPI void glGetProgramPipelineiv_evgl_api_thread_cmd(GLuint pipeline, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glProgramUniform1i)(GLuint program, GLint location, GLint v0);
+EAPI void glProgramUniform1i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0);
+
+extern void (*orig_evgl_api_glProgramUniform2i)(GLuint program, GLint location, GLint v0, GLint v1);
+EAPI void glProgramUniform2i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1);
+
+extern void (*orig_evgl_api_glProgramUniform3i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+EAPI void glProgramUniform3i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+
+extern void (*orig_evgl_api_glProgramUniform4i)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+EAPI void glProgramUniform4i_evgl_api_thread_cmd(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+
+extern void (*orig_evgl_api_glProgramUniform1ui)(GLuint program, GLint location, GLuint v0);
+EAPI void glProgramUniform1ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0);
+
+extern void (*orig_evgl_api_glProgramUniform2ui)(GLuint program, GLint location, GLuint v0, GLuint v1);
+EAPI void glProgramUniform2ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1);
+
+extern void (*orig_evgl_api_glProgramUniform3ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+EAPI void glProgramUniform3ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+
+extern void (*orig_evgl_api_glProgramUniform4ui)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+EAPI void glProgramUniform4ui_evgl_api_thread_cmd(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+extern void (*orig_evgl_api_glProgramUniform1f)(GLuint program, GLint location, GLfloat v0);
+EAPI void glProgramUniform1f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0);
+
+extern void (*orig_evgl_api_glProgramUniform2f)(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+EAPI void glProgramUniform2f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+
+extern void (*orig_evgl_api_glProgramUniform3f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+EAPI void glProgramUniform3f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+
+extern void (*orig_evgl_api_glProgramUniform4f)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+EAPI void glProgramUniform4f_evgl_api_thread_cmd(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+
+extern void (*orig_evgl_api_glProgramUniform1iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+EAPI void glProgramUniform1iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+extern void (*orig_evgl_api_glProgramUniform2iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+EAPI void glProgramUniform2iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+extern void (*orig_evgl_api_glProgramUniform3iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+EAPI void glProgramUniform3iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+extern void (*orig_evgl_api_glProgramUniform4iv)(GLuint program, GLint location, GLsizei count, const GLint *value);
+EAPI void glProgramUniform4iv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLint *value);
+
+extern void (*orig_evgl_api_glProgramUniform1uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+EAPI void glProgramUniform1uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glProgramUniform2uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+EAPI void glProgramUniform2uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glProgramUniform3uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+EAPI void glProgramUniform3uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glProgramUniform4uiv)(GLuint program, GLint location, GLsizei count, const GLuint *value);
+EAPI void glProgramUniform4uiv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLuint *value);
+
+extern void (*orig_evgl_api_glProgramUniform1fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+EAPI void glProgramUniform1fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniform2fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+EAPI void glProgramUniform2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniform3fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+EAPI void glProgramUniform3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniform4fv)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+EAPI void glProgramUniform4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix2x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix2x3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix3x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix3x2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix2x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix2x4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix4x2fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix4x2fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix3x4fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix3x4fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glProgramUniformMatrix4x3fv)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glProgramUniformMatrix4x3fv_evgl_api_thread_cmd(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+extern void (*orig_evgl_api_glValidateProgramPipeline)(GLuint pipeline);
+EAPI void glValidateProgramPipeline_evgl_api_thread_cmd(GLuint pipeline);
+
+extern void (*orig_evgl_api_glGetProgramPipelineInfoLog)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+EAPI void glGetProgramPipelineInfoLog_evgl_api_thread_cmd(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+
+extern void (*orig_evgl_api_glBindImageTexture)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+EAPI void glBindImageTexture_evgl_api_thread_cmd(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+
+extern void (*orig_evgl_api_glGetBooleani_v)(GLenum target, GLuint index, GLboolean *data);
+EAPI void glGetBooleani_v_evgl_api_thread_cmd(GLenum target, GLuint index, GLboolean *data);
+
+extern void (*orig_evgl_api_glMemoryBarrier)(GLbitfield barriers);
+EAPI void glMemoryBarrier_evgl_api_thread_cmd(GLbitfield barriers);
+
+extern void (*orig_evgl_api_glMemoryBarrierByRegion)(GLbitfield barriers);
+EAPI void glMemoryBarrierByRegion_evgl_api_thread_cmd(GLbitfield barriers);
+
+extern void (*orig_evgl_api_glTexStorage2DMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+EAPI void glTexStorage2DMultisample_evgl_api_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+
+extern void (*orig_evgl_api_glGetMultisamplefv)(GLenum pname, GLuint index, GLfloat *val);
+EAPI void glGetMultisamplefv_evgl_api_thread_cmd(GLenum pname, GLuint index, GLfloat *val);
+
+extern void (*orig_evgl_api_glSampleMaski)(GLuint maskNumber, GLbitfield mask);
+EAPI void glSampleMaski_evgl_api_thread_cmd(GLuint maskNumber, GLbitfield mask);
+
+extern void (*orig_evgl_api_glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+EAPI void glGetTexLevelParameteriv_evgl_api_thread_cmd(GLenum target, GLint level, GLenum pname, GLint *params);
+
+extern void (*orig_evgl_api_glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+EAPI void glGetTexLevelParameterfv_evgl_api_thread_cmd(GLenum target, GLint level, GLenum pname, GLfloat *params);
+
+extern void (*orig_evgl_api_glBindVertexBuffer)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+EAPI void glBindVertexBuffer_evgl_api_thread_cmd(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+
+extern void (*orig_evgl_api_glVertexAttribFormat)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+EAPI void glVertexAttribFormat_evgl_api_thread_cmd(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+
+extern void (*orig_evgl_api_glVertexAttribIFormat)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+EAPI void glVertexAttribIFormat_evgl_api_thread_cmd(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+
+extern void (*orig_evgl_api_glVertexAttribBinding)(GLuint attribindex, GLuint bindingindex);
+EAPI void glVertexAttribBinding_evgl_api_thread_cmd(GLuint attribindex, GLuint bindingindex);
+
+extern void (*orig_evgl_api_glVertexBindingDivisor)(GLuint bindingindex, GLuint divisor);
+EAPI void glVertexBindingDivisor_evgl_api_thread_cmd(GLuint bindingindex, GLuint divisor);
+
+extern void (*orig_evgl_api_glEGLImageTargetTexture2DOES)(GLenum target, void *image);
+EAPI void glEGLImageTargetTexture2DOES_evgl_api_thread_cmd(GLenum target, void *image);
+
+extern void (*orig_evgl_api_glEGLImageTargetRenderbufferStorageOES)(GLenum target, void *image);
+EAPI void glEGLImageTargetRenderbufferStorageOES_evgl_api_thread_cmd(GLenum target, void *image);
+
+extern void (*orig_evgl_api__evgl_glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+EAPI void _evgl_glDiscardFramebufferEXT_evgl_api_thread_cmd(GLenum target, GLsizei numAttachments, const GLenum* attachments);
+
+extern void (*orig_evgl_api__evgl_glEvasGLImageTargetTexture2D)(GLenum target, EvasGLImage image);
+EAPI void _evgl_glEvasGLImageTargetTexture2D_evgl_api_thread_cmd(GLenum target, EvasGLImage image);
+
+extern void (*orig_evgl_api__evgl_glEvasGLImageTargetRenderbufferStorage)(GLenum target, EvasGLImage image);
+EAPI void _evgl_glEvasGLImageTargetRenderbufferStorage_evgl_api_thread_cmd(GLenum target, EvasGLImage image);
+
+extern EvasGLImage (*orig_evgl_api__evgl_evasglCreateImage)(int target, void* buffer, const int *attrib_list);
+EAPI EvasGLImage _evgl_evasglCreateImage_evgl_api_thread_cmd(int target, void* buffer, const int *attrib_list);
+
+extern void (*orig_evgl_api__evgl_evasglDestroyImage)(EvasGLImage image);
+EAPI void _evgl_evasglDestroyImage_evgl_api_thread_cmd(EvasGLImage image);
+
+extern EvasGLImage (*orig_evgl_api__evgl_evasglCreateImageForContext)(Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list);
+EAPI EvasGLImage _evgl_evasglCreateImageForContext_evgl_api_thread_cmd(Evas_GL *evas_gl, Evas_GL_Context *ctx, int target, void* buffer, const int *attrib_list);
+
+extern EvasGLSync (*orig_evgl_api__evgl_evasglCreateSync)(Evas_GL *evas_gl, unsigned int type, const int *attrib_list);
+EAPI EvasGLSync _evgl_evasglCreateSync_evgl_api_thread_cmd(Evas_GL *evas_gl, unsigned int type, const int *attrib_list);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglDestroySync)(Evas_GL *evas_gl, EvasGLSync sync);
+EAPI Eina_Bool _evgl_evasglDestroySync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync);
+
+extern int (*orig_evgl_api__evgl_evasglClientWaitSync)(Evas_GL *evas_gl, EvasGLSync sync);
+EAPI int _evgl_evasglClientWaitSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglGetSyncAttrib)(Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value);
+EAPI Eina_Bool _evgl_evasglGetSyncAttrib_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, int attribute, int *value);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglSignalSync)(Evas_GL *evas_gl, EvasGLSync sync, unsigned mode);
+EAPI Eina_Bool _evgl_evasglSignalSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, unsigned mode);
+
+extern int (*orig_evgl_api__evgl_evasglWaitSync)(Evas_GL *evas_gl, EvasGLSync sync, int flags);
+EAPI int _evgl_evasglWaitSync_evgl_api_thread_cmd(Evas_GL *evas_gl, EvasGLSync sync, int flags);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglBindWaylandDisplay)(Evas_GL *evas_gl, void *wl_display);
+EAPI Eina_Bool _evgl_evasglBindWaylandDisplay_evgl_api_thread_cmd(Evas_GL *evas_gl, void *wl_display);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglUnbindWaylandDisplay)(Evas_GL *evas_gl, void *wl_display);
+EAPI Eina_Bool _evgl_evasglUnbindWaylandDisplay_evgl_api_thread_cmd(Evas_GL *evas_gl, void *wl_display);
+
+extern Eina_Bool (*orig_evgl_api__evgl_evasglQueryWaylandBuffer)(Evas_GL *evas_gl, void *buffer, int attribute, int *value);
+EAPI Eina_Bool _evgl_evasglQueryWaylandBuffer_evgl_api_thread_cmd(Evas_GL *evas_gl, void *buffer, int attribute, int *value);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.c b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.c
new file mode 100644 (file)
index 0000000..9274763
--- /dev/null
@@ -0,0 +1,6975 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+/*
+   GLenum
+   glGetError(void);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+
+} EVGL_Thread_Command_glGetError;
+
+static void
+_evgl_thread_glGetError(void *data)
+{
+   EVGL_Thread_Command_glGetError *thread_param =
+      (EVGL_Thread_Command_glGetError *)data;
+
+   thread_param->return_value = glGetError();
+
+}
+
+EAPI GLenum
+glGetError_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glGetError();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetError thread_param_local;
+   EVGL_Thread_Command_glGetError *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetError,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLint size;
+   GLenum type;
+   GLboolean normalized;
+   GLsizei stride;
+   const void *pointer;
+
+} EVGL_Thread_Command_glVertexAttribPointer;
+
+static void
+_evgl_thread_glVertexAttribPointer(void *data)
+{
+   EVGL_Thread_Command_glVertexAttribPointer *thread_param =
+      (EVGL_Thread_Command_glVertexAttribPointer *)data;
+
+   glVertexAttribPointer(thread_param->index,
+                         thread_param->size,
+                         thread_param->type,
+                         thread_param->normalized,
+                         thread_param->stride,
+                         thread_param->pointer);
+
+}
+
+EAPI void
+glVertexAttribPointer_evgl_thread_cmd(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glVertexAttribPointer(index, size, type, normalized, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glVertexAttribPointer thread_param_local;
+   EVGL_Thread_Command_glVertexAttribPointer *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->normalized = normalized;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glVertexAttribPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} EVGL_Thread_Command_glEnableVertexAttribArray;
+
+static void
+_evgl_thread_glEnableVertexAttribArray(void *data)
+{
+   EVGL_Thread_Command_glEnableVertexAttribArray *thread_param =
+      (EVGL_Thread_Command_glEnableVertexAttribArray *)data;
+
+   glEnableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnableVertexAttribArray_evgl_thread_cmd(GLuint index)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glEnableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glEnableVertexAttribArray thread_param_local;
+   EVGL_Thread_Command_glEnableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glEnableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glEnableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glEnableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDisableVertexAttribArray;
+
+static void
+_evgl_thread_glDisableVertexAttribArray(void *data)
+{
+   EVGL_Thread_Command_glDisableVertexAttribArray *thread_param =
+      (EVGL_Thread_Command_glDisableVertexAttribArray *)data;
+
+   glDisableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisableVertexAttribArray_evgl_thread_cmd(GLuint index)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDisableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDisableVertexAttribArray thread_param_local;
+   EVGL_Thread_Command_glDisableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDisableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDisableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDisableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawArrays(GLenum mode, GLint first, GLsizei count);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint first;
+   GLsizei count;
+
+} EVGL_Thread_Command_glDrawArrays;
+
+static void
+_evgl_thread_glDrawArrays(void *data)
+{
+   EVGL_Thread_Command_glDrawArrays *thread_param =
+      (EVGL_Thread_Command_glDrawArrays *)data;
+
+   glDrawArrays(thread_param->mode,
+                thread_param->first,
+                thread_param->count);
+
+}
+
+EAPI void
+glDrawArrays_evgl_thread_cmd(GLenum mode, GLint first, GLsizei count)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDrawArrays(mode, first, count);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDrawArrays thread_param_local;
+   EVGL_Thread_Command_glDrawArrays *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDrawArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLsizei count;
+   GLenum type;
+   const void *indices;
+
+} EVGL_Thread_Command_glDrawElements;
+
+static void
+_evgl_thread_glDrawElements(void *data)
+{
+   EVGL_Thread_Command_glDrawElements *thread_param =
+      (EVGL_Thread_Command_glDrawElements *)data;
+
+   glDrawElements(thread_param->mode,
+                  thread_param->count,
+                  thread_param->type,
+                  thread_param->indices);
+
+}
+
+EAPI void
+glDrawElements_evgl_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void *indices)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDrawElements(mode, count, type, indices);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDrawElements thread_param_local;
+   EVGL_Thread_Command_glDrawElements *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDrawElements,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenBuffers(GLsizei n, GLuint *buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *buffers;
+
+} EVGL_Thread_Command_glGenBuffers;
+
+static void
+_evgl_thread_glGenBuffers(void *data)
+{
+   EVGL_Thread_Command_glGenBuffers *thread_param =
+      (EVGL_Thread_Command_glGenBuffers *)data;
+
+   glGenBuffers(thread_param->n,
+                thread_param->buffers);
+
+}
+
+EAPI void
+glGenBuffers_evgl_thread_cmd(GLsizei n, GLuint *buffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGenBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGenBuffers thread_param_local;
+   EVGL_Thread_Command_glGenBuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGenBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteBuffers(GLsizei n, const GLuint *buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *buffers;
+   void *buffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteBuffers;
+
+static void
+_evgl_thread_glDeleteBuffers(void *data)
+{
+   EVGL_Thread_Command_glDeleteBuffers *thread_param =
+      (EVGL_Thread_Command_glDeleteBuffers *)data;
+
+   glDeleteBuffers(thread_param->n,
+                   thread_param->buffers);
+
+
+   if (thread_param->buffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->buffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteBuffers_evgl_thread_cmd(GLsizei n, const GLuint *buffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteBuffers thread_param_local;
+   EVGL_Thread_Command_glDeleteBuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteBuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteBuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   thread_param->buffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (buffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->buffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->buffers_copied)
+          {
+             memcpy(thread_param->buffers_copied, buffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->buffers = (const GLuint  *)thread_param->buffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindBuffer(GLenum target, GLuint buffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint buffer;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBindBuffer;
+
+static void
+_evgl_thread_glBindBuffer(void *data)
+{
+   EVGL_Thread_Command_glBindBuffer *thread_param =
+      (EVGL_Thread_Command_glBindBuffer *)data;
+
+   glBindBuffer(thread_param->target,
+                thread_param->buffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindBuffer_evgl_thread_cmd(GLenum target, GLuint buffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBindBuffer(target, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBindBuffer thread_param_local;
+   EVGL_Thread_Command_glBindBuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBindBuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBindBuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBindBuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizeiptr size;
+   const void *data;
+   GLenum usage;
+
+} EVGL_Thread_Command_glBufferData;
+
+static void
+_evgl_thread_glBufferData(void *data)
+{
+   EVGL_Thread_Command_glBufferData *thread_param =
+      (EVGL_Thread_Command_glBufferData *)data;
+
+   glBufferData(thread_param->target,
+                thread_param->size,
+                thread_param->data,
+                thread_param->usage);
+
+}
+
+EAPI void
+glBufferData_evgl_thread_cmd(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBufferData(target, size, data, usage);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBufferData thread_param_local;
+   EVGL_Thread_Command_glBufferData *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->size = size;
+   thread_param->data = data;
+   thread_param->usage = usage;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBufferData,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glCreateShader(GLenum type);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLenum type;
+
+} EVGL_Thread_Command_glCreateShader;
+
+static void
+_evgl_thread_glCreateShader(void *data)
+{
+   EVGL_Thread_Command_glCreateShader *thread_param =
+      (EVGL_Thread_Command_glCreateShader *)data;
+
+   thread_param->return_value = glCreateShader(thread_param->type);
+
+}
+
+EAPI GLuint
+glCreateShader_evgl_thread_cmd(GLenum type)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glCreateShader(type);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCreateShader thread_param_local;
+   EVGL_Thread_Command_glCreateShader *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCreateShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glShaderSource(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei count;
+   const GLchar **string;
+   const GLint *length;
+   int command_allocated;
+   GLSHADERSOURCE_COPY_VARIABLE; /* TODO */
+
+} EVGL_Thread_Command_glShaderSource;
+
+static void
+_evgl_thread_glShaderSource(void *data)
+{
+   EVGL_Thread_Command_glShaderSource *thread_param =
+      (EVGL_Thread_Command_glShaderSource *)data;
+
+   glShaderSource(thread_param->shader,
+                  thread_param->count,
+                  thread_param->string,
+                  thread_param->length);
+
+   GLSHADERSOURCE_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glShaderSource_evgl_thread_cmd(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glShaderSource(shader, count, string, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glShaderSource thread_param_local;
+   EVGL_Thread_Command_glShaderSource *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glShaderSource *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glShaderSource));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+   thread_param->count = count;
+   thread_param->string = string;
+   thread_param->length = length;
+
+   GLSHADERSOURCE_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLSHADERSOURCE_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompileShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_Thread_Command_glCompileShader;
+
+static void
+_evgl_thread_glCompileShader(void *data)
+{
+   EVGL_Thread_Command_glCompileShader *thread_param =
+      (EVGL_Thread_Command_glCompileShader *)data;
+
+   glCompileShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompileShader_evgl_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glCompileShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCompileShader thread_param_local;
+   EVGL_Thread_Command_glCompileShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glCompileShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glCompileShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCompileShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteShader;
+
+static void
+_evgl_thread_glDeleteShader(void *data)
+{
+   EVGL_Thread_Command_glDeleteShader *thread_param =
+      (EVGL_Thread_Command_glDeleteShader *)data;
+
+   glDeleteShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteShader_evgl_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteShader thread_param_local;
+   EVGL_Thread_Command_glDeleteShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glCreateProgram(void);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+
+} EVGL_Thread_Command_glCreateProgram;
+
+static void
+_evgl_thread_glCreateProgram(void *data)
+{
+   EVGL_Thread_Command_glCreateProgram *thread_param =
+      (EVGL_Thread_Command_glCreateProgram *)data;
+
+   thread_param->return_value = glCreateProgram();
+
+}
+
+EAPI GLuint
+glCreateProgram_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glCreateProgram();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCreateProgram thread_param_local;
+   EVGL_Thread_Command_glCreateProgram *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCreateProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glAttachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_Thread_Command_glAttachShader;
+
+static void
+_evgl_thread_glAttachShader(void *data)
+{
+   EVGL_Thread_Command_glAttachShader *thread_param =
+      (EVGL_Thread_Command_glAttachShader *)data;
+
+   glAttachShader(thread_param->program,
+                  thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glAttachShader_evgl_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glAttachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glAttachShader thread_param_local;
+   EVGL_Thread_Command_glAttachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glAttachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glAttachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glAttachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDetachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDetachShader;
+
+static void
+_evgl_thread_glDetachShader(void *data)
+{
+   EVGL_Thread_Command_glDetachShader *thread_param =
+      (EVGL_Thread_Command_glDetachShader *)data;
+
+   glDetachShader(thread_param->program,
+                  thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDetachShader_evgl_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDetachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDetachShader thread_param_local;
+   EVGL_Thread_Command_glDetachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDetachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDetachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDetachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLinkProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} EVGL_Thread_Command_glLinkProgram;
+
+static void
+_evgl_thread_glLinkProgram(void *data)
+{
+   EVGL_Thread_Command_glLinkProgram *thread_param =
+      (EVGL_Thread_Command_glLinkProgram *)data;
+
+   glLinkProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLinkProgram_evgl_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glLinkProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glLinkProgram thread_param_local;
+   EVGL_Thread_Command_glLinkProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glLinkProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glLinkProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glLinkProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUseProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUseProgram;
+
+static void
+_evgl_thread_glUseProgram(void *data)
+{
+   EVGL_Thread_Command_glUseProgram *thread_param =
+      (EVGL_Thread_Command_glUseProgram *)data;
+
+   glUseProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUseProgram_evgl_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUseProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUseProgram thread_param_local;
+   EVGL_Thread_Command_glUseProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUseProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUseProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUseProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteProgram;
+
+static void
+_evgl_thread_glDeleteProgram(void *data)
+{
+   EVGL_Thread_Command_glDeleteProgram *thread_param =
+      (EVGL_Thread_Command_glDeleteProgram *)data;
+
+   glDeleteProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteProgram_evgl_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteProgram thread_param_local;
+   EVGL_Thread_Command_glDeleteProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLenum *binaryFormat;
+   void *binary;
+
+} EVGL_Thread_Command_glGetProgramBinary;
+
+void (*orig_evgl_glGetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+void
+glGetProgramBinary_orig_evgl_set(void *func)
+{
+   orig_evgl_glGetProgramBinary = func;
+}
+
+void *
+glGetProgramBinary_orig_evgl_get(void)
+{
+   return orig_evgl_glGetProgramBinary;
+}
+
+static void
+_evgl_thread_glGetProgramBinary(void *data)
+{
+   EVGL_Thread_Command_glGetProgramBinary *thread_param =
+      (EVGL_Thread_Command_glGetProgramBinary *)data;
+
+   orig_evgl_glGetProgramBinary(thread_param->program,
+                                thread_param->bufSize,
+                                thread_param->length,
+                                thread_param->binaryFormat,
+                                thread_param->binary);
+
+}
+
+EAPI void
+glGetProgramBinary_evgl_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetProgramBinary thread_param_local;
+   EVGL_Thread_Command_glGetProgramBinary *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum binaryFormat;
+   const void *binary;
+   GLint length;
+   void *binary_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glProgramBinary;
+
+void (*orig_evgl_glProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+
+void
+glProgramBinary_orig_evgl_set(void *func)
+{
+   orig_evgl_glProgramBinary = func;
+}
+
+void *
+glProgramBinary_orig_evgl_get(void)
+{
+   return orig_evgl_glProgramBinary;
+}
+
+static void
+_evgl_thread_glProgramBinary(void *data)
+{
+   EVGL_Thread_Command_glProgramBinary *thread_param =
+      (EVGL_Thread_Command_glProgramBinary *)data;
+
+   orig_evgl_glProgramBinary(thread_param->program,
+                             thread_param->binaryFormat,
+                             thread_param->binary,
+                             thread_param->length);
+
+
+   if (thread_param->binary_copied)
+     eina_mempool_free(_mp_default, thread_param->binary_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glProgramBinary_evgl_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glProgramBinary(program, binaryFormat, binary, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glProgramBinary thread_param_local;
+   EVGL_Thread_Command_glProgramBinary *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glProgramBinary *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glProgramBinary));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+   thread_param->length = length;
+
+   thread_param->binary_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (binary)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = length;
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->binary_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->binary_copied)
+          {
+             memcpy(thread_param->binary_copied, binary, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->binary = (const void  *)thread_param->binary_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLint *size;
+   GLenum *type;
+   GLchar *name;
+
+} EVGL_Thread_Command_glGetActiveAttrib;
+
+static void
+_evgl_thread_glGetActiveAttrib(void *data)
+{
+   EVGL_Thread_Command_glGetActiveAttrib *thread_param =
+      (EVGL_Thread_Command_glGetActiveAttrib *)data;
+
+   glGetActiveAttrib(thread_param->program,
+                     thread_param->index,
+                     thread_param->bufSize,
+                     thread_param->length,
+                     thread_param->size,
+                     thread_param->type,
+                     thread_param->name);
+
+}
+
+EAPI void
+glGetActiveAttrib_evgl_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetActiveAttrib(program, index, bufSize, length, size, type, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetActiveAttrib thread_param_local;
+   EVGL_Thread_Command_glGetActiveAttrib *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetActiveAttrib,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetAttribLocation(GLuint program, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   const GLchar *name;
+
+} EVGL_Thread_Command_glGetAttribLocation;
+
+static void
+_evgl_thread_glGetAttribLocation(void *data)
+{
+   EVGL_Thread_Command_glGetAttribLocation *thread_param =
+      (EVGL_Thread_Command_glGetAttribLocation *)data;
+
+   thread_param->return_value = glGetAttribLocation(thread_param->program,
+                                                    thread_param->name);
+
+}
+
+EAPI GLint
+glGetAttribLocation_evgl_thread_cmd(GLuint program, const GLchar *name)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glGetAttribLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetAttribLocation thread_param_local;
+   EVGL_Thread_Command_glGetAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetAttribLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glBindAttribLocation(GLuint program, GLuint index, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   const GLchar *name;
+
+} EVGL_Thread_Command_glBindAttribLocation;
+
+static void
+_evgl_thread_glBindAttribLocation(void *data)
+{
+   EVGL_Thread_Command_glBindAttribLocation *thread_param =
+      (EVGL_Thread_Command_glBindAttribLocation *)data;
+
+   glBindAttribLocation(thread_param->program,
+                        thread_param->index,
+                        thread_param->name);
+
+}
+
+EAPI void
+glBindAttribLocation_evgl_thread_cmd(GLuint program, GLuint index, const GLchar *name)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBindAttribLocation(program, index, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBindAttribLocation thread_param_local;
+   EVGL_Thread_Command_glBindAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBindAttribLocation,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetUniformLocation(GLuint program, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   const GLchar *name;
+
+} EVGL_Thread_Command_glGetUniformLocation;
+
+static void
+_evgl_thread_glGetUniformLocation(void *data)
+{
+   EVGL_Thread_Command_glGetUniformLocation *thread_param =
+      (EVGL_Thread_Command_glGetUniformLocation *)data;
+
+   thread_param->return_value = glGetUniformLocation(thread_param->program,
+                                                     thread_param->name);
+
+}
+
+EAPI GLint
+glGetUniformLocation_evgl_thread_cmd(GLuint program, const GLchar *name)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glGetUniformLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetUniformLocation thread_param_local;
+   EVGL_Thread_Command_glGetUniformLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetUniformLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glUniform1f(GLint location, GLfloat v0);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform1f;
+
+static void
+_evgl_thread_glUniform1f(void *data)
+{
+   EVGL_Thread_Command_glUniform1f *thread_param =
+      (EVGL_Thread_Command_glUniform1f *)data;
+
+   glUniform1f(thread_param->location,
+               thread_param->v0);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1f_evgl_thread_cmd(GLint location, GLfloat v0)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform1f(location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform1f thread_param_local;
+   EVGL_Thread_Command_glUniform1f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform1f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform1f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform1f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1i(GLint location, GLint v0);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform1i;
+
+static void
+_evgl_thread_glUniform1i(void *data)
+{
+   EVGL_Thread_Command_glUniform1i *thread_param =
+      (EVGL_Thread_Command_glUniform1i *)data;
+
+   glUniform1i(thread_param->location,
+               thread_param->v0);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1i_evgl_thread_cmd(GLint location, GLint v0)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform1i(location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform1i thread_param_local;
+   EVGL_Thread_Command_glUniform1i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform1i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform1i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform1i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2f(GLint location, GLfloat v0, GLfloat v1);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform2f;
+
+static void
+_evgl_thread_glUniform2f(void *data)
+{
+   EVGL_Thread_Command_glUniform2f *thread_param =
+      (EVGL_Thread_Command_glUniform2f *)data;
+
+   glUniform2f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform2f(location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform2f thread_param_local;
+   EVGL_Thread_Command_glUniform2f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform2f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform2f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform2f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2i(GLint location, GLint v0, GLint v1);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform2i;
+
+static void
+_evgl_thread_glUniform2i(void *data)
+{
+   EVGL_Thread_Command_glUniform2i *thread_param =
+      (EVGL_Thread_Command_glUniform2i *)data;
+
+   glUniform2i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2i_evgl_thread_cmd(GLint location, GLint v0, GLint v1)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform2i(location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform2i thread_param_local;
+   EVGL_Thread_Command_glUniform2i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform2i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform2i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform2i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform3f;
+
+static void
+_evgl_thread_glUniform3f(void *data)
+{
+   EVGL_Thread_Command_glUniform3f *thread_param =
+      (EVGL_Thread_Command_glUniform3f *)data;
+
+   glUniform3f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform3f(location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform3f thread_param_local;
+   EVGL_Thread_Command_glUniform3f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform3f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform3f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3i(GLint location, GLint v0, GLint v1, GLint v2);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform3i;
+
+static void
+_evgl_thread_glUniform3i(void *data)
+{
+   EVGL_Thread_Command_glUniform3i *thread_param =
+      (EVGL_Thread_Command_glUniform3i *)data;
+
+   glUniform3i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3i_evgl_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform3i(location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform3i thread_param_local;
+   EVGL_Thread_Command_glUniform3i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform3i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform3i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform3i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+   GLfloat v3;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform4f;
+
+static void
+_evgl_thread_glUniform4f(void *data)
+{
+   EVGL_Thread_Command_glUniform4f *thread_param =
+      (EVGL_Thread_Command_glUniform4f *)data;
+
+   glUniform4f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2,
+               thread_param->v3);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform4f(location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform4f thread_param_local;
+   EVGL_Thread_Command_glUniform4f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform4f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform4f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   GLint v3;
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform4i;
+
+static void
+_evgl_thread_glUniform4i(void *data)
+{
+   EVGL_Thread_Command_glUniform4i *thread_param =
+      (EVGL_Thread_Command_glUniform4i *)data;
+
+   glUniform4i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2,
+               thread_param->v3);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4i_evgl_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform4i(location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform4i thread_param_local;
+   EVGL_Thread_Command_glUniform4i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform4i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform4i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform4i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform1fv;
+
+static void
+_evgl_thread_glUniform1fv(void *data)
+{
+   EVGL_Thread_Command_glUniform1fv *thread_param =
+      (EVGL_Thread_Command_glUniform1fv *)data;
+
+   glUniform1fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform1fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform1fv thread_param_local;
+   EVGL_Thread_Command_glUniform1fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform1fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform1fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform1fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform1iv;
+
+static void
+_evgl_thread_glUniform1iv(void *data)
+{
+   EVGL_Thread_Command_glUniform1iv *thread_param =
+      (EVGL_Thread_Command_glUniform1iv *)data;
+
+   glUniform1iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform1iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform1iv thread_param_local;
+   EVGL_Thread_Command_glUniform1iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform1iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform1iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform1iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform2fv;
+
+static void
+_evgl_thread_glUniform2fv(void *data)
+{
+   EVGL_Thread_Command_glUniform2fv *thread_param =
+      (EVGL_Thread_Command_glUniform2fv *)data;
+
+   glUniform2fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform2fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform2fv thread_param_local;
+   EVGL_Thread_Command_glUniform2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform2iv;
+
+static void
+_evgl_thread_glUniform2iv(void *data)
+{
+   EVGL_Thread_Command_glUniform2iv *thread_param =
+      (EVGL_Thread_Command_glUniform2iv *)data;
+
+   glUniform2iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform2iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform2iv thread_param_local;
+   EVGL_Thread_Command_glUniform2iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform2iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform2iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform2iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform3fv;
+
+static void
+_evgl_thread_glUniform3fv(void *data)
+{
+   EVGL_Thread_Command_glUniform3fv *thread_param =
+      (EVGL_Thread_Command_glUniform3fv *)data;
+
+   glUniform3fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform3fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform3fv thread_param_local;
+   EVGL_Thread_Command_glUniform3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform3iv;
+
+static void
+_evgl_thread_glUniform3iv(void *data)
+{
+   EVGL_Thread_Command_glUniform3iv *thread_param =
+      (EVGL_Thread_Command_glUniform3iv *)data;
+
+   glUniform3iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform3iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform3iv thread_param_local;
+   EVGL_Thread_Command_glUniform3iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform3iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform3iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform3iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform4fv;
+
+static void
+_evgl_thread_glUniform4fv(void *data)
+{
+   EVGL_Thread_Command_glUniform4fv *thread_param =
+      (EVGL_Thread_Command_glUniform4fv *)data;
+
+   glUniform4fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform4fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform4fv thread_param_local;
+   EVGL_Thread_Command_glUniform4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniform4iv;
+
+static void
+_evgl_thread_glUniform4iv(void *data)
+{
+   EVGL_Thread_Command_glUniform4iv *thread_param =
+      (EVGL_Thread_Command_glUniform4iv *)data;
+
+   glUniform4iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniform4iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniform4iv thread_param_local;
+   EVGL_Thread_Command_glUniform4iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniform4iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniform4iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniform4iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniformMatrix2fv;
+
+static void
+_evgl_thread_glUniformMatrix2fv(void *data)
+{
+   EVGL_Thread_Command_glUniformMatrix2fv *thread_param =
+      (EVGL_Thread_Command_glUniformMatrix2fv *)data;
+
+   glUniformMatrix2fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix2fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniformMatrix2fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniformMatrix2fv thread_param_local;
+   EVGL_Thread_Command_glUniformMatrix2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniformMatrix2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniformMatrix2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniformMatrix2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniformMatrix3fv;
+
+static void
+_evgl_thread_glUniformMatrix3fv(void *data)
+{
+   EVGL_Thread_Command_glUniformMatrix3fv *thread_param =
+      (EVGL_Thread_Command_glUniformMatrix3fv *)data;
+
+   glUniformMatrix3fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix3fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniformMatrix3fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniformMatrix3fv thread_param_local;
+   EVGL_Thread_Command_glUniformMatrix3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniformMatrix3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniformMatrix3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 9 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniformMatrix3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glUniformMatrix4fv;
+
+static void
+_evgl_thread_glUniformMatrix4fv(void *data)
+{
+   EVGL_Thread_Command_glUniformMatrix4fv *thread_param =
+      (EVGL_Thread_Command_glUniformMatrix4fv *)data;
+
+   glUniformMatrix4fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix4fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glUniformMatrix4fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glUniformMatrix4fv thread_param_local;
+   EVGL_Thread_Command_glUniformMatrix4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glUniformMatrix4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glUniformMatrix4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 16 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glUniformMatrix4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_Thread_Command_glViewport;
+
+static void
+_evgl_thread_glViewport(void *data)
+{
+   EVGL_Thread_Command_glViewport *thread_param =
+      (EVGL_Thread_Command_glViewport *)data;
+
+   glViewport(thread_param->x,
+              thread_param->y,
+              thread_param->width,
+              thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glViewport_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glViewport(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glViewport thread_param_local;
+   EVGL_Thread_Command_glViewport *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glViewport *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glViewport));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glViewport,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} EVGL_Thread_Command_glEnable;
+
+static void
+_evgl_thread_glEnable(void *data)
+{
+   EVGL_Thread_Command_glEnable *thread_param =
+      (EVGL_Thread_Command_glEnable *)data;
+
+   glEnable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnable_evgl_thread_cmd(GLenum cap)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glEnable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glEnable thread_param_local;
+   EVGL_Thread_Command_glEnable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glEnable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glEnable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glEnable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDisable;
+
+static void
+_evgl_thread_glDisable(void *data)
+{
+   EVGL_Thread_Command_glDisable *thread_param =
+      (EVGL_Thread_Command_glDisable *)data;
+
+   glDisable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisable_evgl_thread_cmd(GLenum cap)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDisable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDisable thread_param_local;
+   EVGL_Thread_Command_glDisable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDisable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDisable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDisable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLineWidth(GLfloat width);
+ */
+
+typedef struct
+{
+   GLfloat width;
+   int command_allocated;
+
+} EVGL_Thread_Command_glLineWidth;
+
+static void
+_evgl_thread_glLineWidth(void *data)
+{
+   EVGL_Thread_Command_glLineWidth *thread_param =
+      (EVGL_Thread_Command_glLineWidth *)data;
+
+   glLineWidth(thread_param->width);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLineWidth_evgl_thread_cmd(GLfloat width)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glLineWidth(width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glLineWidth thread_param_local;
+   EVGL_Thread_Command_glLineWidth *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glLineWidth *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glLineWidth));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glLineWidth,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPolygonOffset(GLfloat factor, GLfloat units);
+ */
+
+typedef struct
+{
+   GLfloat factor;
+   GLfloat units;
+   int command_allocated;
+
+} EVGL_Thread_Command_glPolygonOffset;
+
+static void
+_evgl_thread_glPolygonOffset(void *data)
+{
+   EVGL_Thread_Command_glPolygonOffset *thread_param =
+      (EVGL_Thread_Command_glPolygonOffset *)data;
+
+   glPolygonOffset(thread_param->factor,
+                   thread_param->units);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPolygonOffset_evgl_thread_cmd(GLfloat factor, GLfloat units)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glPolygonOffset(factor, units);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glPolygonOffset thread_param_local;
+   EVGL_Thread_Command_glPolygonOffset *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glPolygonOffset *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glPolygonOffset));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->factor = factor;
+   thread_param->units = units;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glPolygonOffset,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPixelStorei(GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} EVGL_Thread_Command_glPixelStorei;
+
+static void
+_evgl_thread_glPixelStorei(void *data)
+{
+   EVGL_Thread_Command_glPixelStorei *thread_param =
+      (EVGL_Thread_Command_glPixelStorei *)data;
+
+   glPixelStorei(thread_param->pname,
+                 thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPixelStorei_evgl_thread_cmd(GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glPixelStorei(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glPixelStorei thread_param_local;
+   EVGL_Thread_Command_glPixelStorei *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glPixelStorei *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glPixelStorei));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glPixelStorei,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glActiveTexture(GLenum texture);
+ */
+
+typedef struct
+{
+   GLenum texture;
+   int command_allocated;
+
+} EVGL_Thread_Command_glActiveTexture;
+
+static void
+_evgl_thread_glActiveTexture(void *data)
+{
+   EVGL_Thread_Command_glActiveTexture *thread_param =
+      (EVGL_Thread_Command_glActiveTexture *)data;
+
+   glActiveTexture(thread_param->texture);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glActiveTexture_evgl_thread_cmd(GLenum texture)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glActiveTexture(texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glActiveTexture thread_param_local;
+   EVGL_Thread_Command_glActiveTexture *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glActiveTexture *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glActiveTexture));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glActiveTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenTextures(GLsizei n, GLuint *textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *textures;
+
+} EVGL_Thread_Command_glGenTextures;
+
+static void
+_evgl_thread_glGenTextures(void *data)
+{
+   EVGL_Thread_Command_glGenTextures *thread_param =
+      (EVGL_Thread_Command_glGenTextures *)data;
+
+   glGenTextures(thread_param->n,
+                 thread_param->textures);
+
+}
+
+EAPI void
+glGenTextures_evgl_thread_cmd(GLsizei n, GLuint *textures)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGenTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGenTextures thread_param_local;
+   EVGL_Thread_Command_glGenTextures *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGenTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindTexture(GLenum target, GLuint texture);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint texture;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBindTexture;
+
+static void
+_evgl_thread_glBindTexture(void *data)
+{
+   EVGL_Thread_Command_glBindTexture *thread_param =
+      (EVGL_Thread_Command_glBindTexture *)data;
+
+   glBindTexture(thread_param->target,
+                 thread_param->texture);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindTexture_evgl_thread_cmd(GLenum target, GLuint texture)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBindTexture(target, texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBindTexture thread_param_local;
+   EVGL_Thread_Command_glBindTexture *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBindTexture *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBindTexture));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBindTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteTextures(GLsizei n, const GLuint *textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *textures;
+   void *textures_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteTextures;
+
+static void
+_evgl_thread_glDeleteTextures(void *data)
+{
+   EVGL_Thread_Command_glDeleteTextures *thread_param =
+      (EVGL_Thread_Command_glDeleteTextures *)data;
+
+   glDeleteTextures(thread_param->n,
+                    thread_param->textures);
+
+
+   if (thread_param->textures_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->textures_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteTextures_evgl_thread_cmd(GLsizei n, const GLuint *textures)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteTextures thread_param_local;
+   EVGL_Thread_Command_glDeleteTextures *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteTextures *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteTextures));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   thread_param->textures_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (textures)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->textures_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->textures_copied)
+          {
+             memcpy(thread_param->textures_copied, textures, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->textures = (const GLuint  *)thread_param->textures_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLenum format;
+   GLenum type;
+   const void *pixels;
+   int command_allocated;
+   GLTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_Thread_Command_glTexImage2D;
+
+static void
+_evgl_thread_glTexImage2D(void *data)
+{
+   EVGL_Thread_Command_glTexImage2D *thread_param =
+      (EVGL_Thread_Command_glTexImage2D *)data;
+
+   glTexImage2D(thread_param->target,
+                thread_param->level,
+                thread_param->internalformat,
+                thread_param->width,
+                thread_param->height,
+                thread_param->border,
+                thread_param->format,
+                thread_param->type,
+                thread_param->pixels);
+
+   GLTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexImage2D thread_param_local;
+   EVGL_Thread_Command_glTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   const void *pixels;
+   int command_allocated;
+   GLTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_Thread_Command_glTexSubImage2D;
+
+static void
+_evgl_thread_glTexSubImage2D(void *data)
+{
+   EVGL_Thread_Command_glTexSubImage2D *thread_param =
+      (EVGL_Thread_Command_glTexSubImage2D *)data;
+
+   glTexSubImage2D(thread_param->target,
+                   thread_param->level,
+                   thread_param->xoffset,
+                   thread_param->yoffset,
+                   thread_param->width,
+                   thread_param->height,
+                   thread_param->format,
+                   thread_param->type,
+                   thread_param->pixels);
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexSubImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexSubImage2D thread_param_local;
+   EVGL_Thread_Command_glTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLsizei imageSize;
+   const void *data;
+   int command_allocated;
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_Thread_Command_glCompressedTexImage2D;
+
+static void
+_evgl_thread_glCompressedTexImage2D(void *data)
+{
+   EVGL_Thread_Command_glCompressedTexImage2D *thread_param =
+      (EVGL_Thread_Command_glCompressedTexImage2D *)data;
+
+   glCompressedTexImage2D(thread_param->target,
+                          thread_param->level,
+                          thread_param->internalformat,
+                          thread_param->width,
+                          thread_param->height,
+                          thread_param->border,
+                          thread_param->imageSize,
+                          thread_param->data);
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexImage2D_evgl_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCompressedTexImage2D thread_param_local;
+   EVGL_Thread_Command_glCompressedTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glCompressedTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glCompressedTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCompressedTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLsizei imageSize;
+   const void *data;
+   int command_allocated;
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} EVGL_Thread_Command_glCompressedTexSubImage2D;
+
+static void
+_evgl_thread_glCompressedTexSubImage2D(void *data)
+{
+   EVGL_Thread_Command_glCompressedTexSubImage2D *thread_param =
+      (EVGL_Thread_Command_glCompressedTexSubImage2D *)data;
+
+   glCompressedTexSubImage2D(thread_param->target,
+                             thread_param->level,
+                             thread_param->xoffset,
+                             thread_param->yoffset,
+                             thread_param->width,
+                             thread_param->height,
+                             thread_param->format,
+                             thread_param->imageSize,
+                             thread_param->data);
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexSubImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCompressedTexSubImage2D thread_param_local;
+   EVGL_Thread_Command_glCompressedTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glCompressedTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glCompressedTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCompressedTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfloat param;
+   int command_allocated;
+
+} EVGL_Thread_Command_glTexParameterf;
+
+static void
+_evgl_thread_glTexParameterf(void *data)
+{
+   EVGL_Thread_Command_glTexParameterf *thread_param =
+      (EVGL_Thread_Command_glTexParameterf *)data;
+
+   glTexParameterf(thread_param->target,
+                   thread_param->pname,
+                   thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterf_evgl_thread_cmd(GLenum target, GLenum pname, GLfloat param)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexParameterf(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexParameterf thread_param_local;
+   EVGL_Thread_Command_glTexParameterf *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexParameterf *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexParameterf));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexParameterf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfloat *params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glTexParameterfv;
+
+static void
+_evgl_thread_glTexParameterfv(void *data)
+{
+   EVGL_Thread_Command_glTexParameterfv *thread_param =
+      (EVGL_Thread_Command_glTexParameterfv *)data;
+
+   glTexParameterfv(thread_param->target,
+                    thread_param->pname,
+                    thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterfv_evgl_thread_cmd(GLenum target, GLenum pname, const GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexParameterfv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexParameterfv thread_param_local;
+   EVGL_Thread_Command_glTexParameterfv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexParameterfv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexParameterfv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLfloat);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLfloat  *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteri(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} EVGL_Thread_Command_glTexParameteri;
+
+static void
+_evgl_thread_glTexParameteri(void *data)
+{
+   EVGL_Thread_Command_glTexParameteri *thread_param =
+      (EVGL_Thread_Command_glTexParameteri *)data;
+
+   glTexParameteri(thread_param->target,
+                   thread_param->pname,
+                   thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteri_evgl_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexParameteri(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexParameteri thread_param_local;
+   EVGL_Thread_Command_glTexParameteri *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexParameteri *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexParameteri));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteriv(GLenum target, GLenum pname, const GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLint *params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glTexParameteriv;
+
+static void
+_evgl_thread_glTexParameteriv(void *data)
+{
+   EVGL_Thread_Command_glTexParameteriv *thread_param =
+      (EVGL_Thread_Command_glTexParameteriv *)data;
+
+   glTexParameteriv(thread_param->target,
+                    thread_param->pname,
+                    thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, const GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glTexParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glTexParameteriv thread_param_local;
+   EVGL_Thread_Command_glTexParameteriv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glTexParameteriv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glTexParameteriv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLint);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLint  *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glTexParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_Thread_Command_glScissor;
+
+static void
+_evgl_thread_glScissor(void *data)
+{
+   EVGL_Thread_Command_glScissor *thread_param =
+      (EVGL_Thread_Command_glScissor *)data;
+
+   glScissor(thread_param->x,
+             thread_param->y,
+             thread_param->width,
+             thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glScissor_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glScissor(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glScissor thread_param_local;
+   EVGL_Thread_Command_glScissor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glScissor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glScissor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glScissor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendFunc(GLenum sfactor, GLenum dfactor);
+ */
+
+typedef struct
+{
+   GLenum sfactor;
+   GLenum dfactor;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBlendFunc;
+
+static void
+_evgl_thread_glBlendFunc(void *data)
+{
+   EVGL_Thread_Command_glBlendFunc *thread_param =
+      (EVGL_Thread_Command_glBlendFunc *)data;
+
+   glBlendFunc(thread_param->sfactor,
+               thread_param->dfactor);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendFunc_evgl_thread_cmd(GLenum sfactor, GLenum dfactor)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBlendFunc(sfactor, dfactor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBlendFunc thread_param_local;
+   EVGL_Thread_Command_glBlendFunc *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBlendFunc *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBlendFunc));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->sfactor = sfactor;
+   thread_param->dfactor = dfactor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBlendFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+ */
+
+typedef struct
+{
+   GLfloat red;
+   GLfloat green;
+   GLfloat blue;
+   GLfloat alpha;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBlendColor;
+
+static void
+_evgl_thread_glBlendColor(void *data)
+{
+   EVGL_Thread_Command_glBlendColor *thread_param =
+      (EVGL_Thread_Command_glBlendColor *)data;
+
+   glBlendColor(thread_param->red,
+                thread_param->green,
+                thread_param->blue,
+                thread_param->alpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendColor_evgl_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBlendColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBlendColor thread_param_local;
+   EVGL_Thread_Command_glBlendColor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBlendColor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBlendColor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBlendColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthMask(GLboolean flag);
+ */
+
+typedef struct
+{
+   GLboolean flag;
+   int command_allocated;
+
+} EVGL_Thread_Command_glDepthMask;
+
+static void
+_evgl_thread_glDepthMask(void *data)
+{
+   EVGL_Thread_Command_glDepthMask *thread_param =
+      (EVGL_Thread_Command_glDepthMask *)data;
+
+   glDepthMask(thread_param->flag);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDepthMask_evgl_thread_cmd(GLboolean flag)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDepthMask(flag);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDepthMask thread_param_local;
+   EVGL_Thread_Command_glDepthMask *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDepthMask *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDepthMask));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->flag = flag;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDepthMask,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClear(GLbitfield mask);
+ */
+
+typedef struct
+{
+   GLbitfield mask;
+   int command_allocated;
+
+} EVGL_Thread_Command_glClear;
+
+static void
+_evgl_thread_glClear(void *data)
+{
+   EVGL_Thread_Command_glClear *thread_param =
+      (EVGL_Thread_Command_glClear *)data;
+
+   glClear(thread_param->mask);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glClear_evgl_thread_cmd(GLbitfield mask)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glClear(mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glClear thread_param_local;
+   EVGL_Thread_Command_glClear *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glClear *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glClear));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glClear,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+ */
+
+typedef struct
+{
+   GLfloat red;
+   GLfloat green;
+   GLfloat blue;
+   GLfloat alpha;
+   int command_allocated;
+
+} EVGL_Thread_Command_glClearColor;
+
+static void
+_evgl_thread_glClearColor(void *data)
+{
+   EVGL_Thread_Command_glClearColor *thread_param =
+      (EVGL_Thread_Command_glClearColor *)data;
+
+   glClearColor(thread_param->red,
+                thread_param->green,
+                thread_param->blue,
+                thread_param->alpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glClearColor_evgl_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glClearColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glClearColor thread_param_local;
+   EVGL_Thread_Command_glClearColor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glClearColor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glClearColor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glClearColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   void *pixels;
+
+} EVGL_Thread_Command_glReadPixels;
+
+static void
+_evgl_thread_glReadPixels(void *data)
+{
+   EVGL_Thread_Command_glReadPixels *thread_param =
+      (EVGL_Thread_Command_glReadPixels *)data;
+
+   glReadPixels(thread_param->x,
+                thread_param->y,
+                thread_param->width,
+                thread_param->height,
+                thread_param->format,
+                thread_param->type,
+                thread_param->pixels);
+
+}
+
+EAPI void
+glReadPixels_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glReadPixels(x, y, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glReadPixels thread_param_local;
+   EVGL_Thread_Command_glReadPixels *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glReadPixels,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenFramebuffers(GLsizei n, GLuint *framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *framebuffers;
+
+} EVGL_Thread_Command_glGenFramebuffers;
+
+static void
+_evgl_thread_glGenFramebuffers(void *data)
+{
+   EVGL_Thread_Command_glGenFramebuffers *thread_param =
+      (EVGL_Thread_Command_glGenFramebuffers *)data;
+
+   glGenFramebuffers(thread_param->n,
+                     thread_param->framebuffers);
+
+}
+
+EAPI void
+glGenFramebuffers_evgl_thread_cmd(GLsizei n, GLuint *framebuffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGenFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGenFramebuffers thread_param_local;
+   EVGL_Thread_Command_glGenFramebuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGenFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindFramebuffer(GLenum target, GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint framebuffer;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBindFramebuffer;
+
+static void
+_evgl_thread_glBindFramebuffer(void *data)
+{
+   EVGL_Thread_Command_glBindFramebuffer *thread_param =
+      (EVGL_Thread_Command_glBindFramebuffer *)data;
+
+   glBindFramebuffer(thread_param->target,
+                     thread_param->framebuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindFramebuffer_evgl_thread_cmd(GLenum target, GLuint framebuffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBindFramebuffer(target, framebuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBindFramebuffer thread_param_local;
+   EVGL_Thread_Command_glBindFramebuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBindFramebuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBindFramebuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBindFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *framebuffers;
+   void *framebuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteFramebuffers;
+
+static void
+_evgl_thread_glDeleteFramebuffers(void *data)
+{
+   EVGL_Thread_Command_glDeleteFramebuffers *thread_param =
+      (EVGL_Thread_Command_glDeleteFramebuffers *)data;
+
+   glDeleteFramebuffers(thread_param->n,
+                        thread_param->framebuffers);
+
+
+   if (thread_param->framebuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->framebuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteFramebuffers_evgl_thread_cmd(GLsizei n, const GLuint *framebuffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteFramebuffers thread_param_local;
+   EVGL_Thread_Command_glDeleteFramebuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteFramebuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteFramebuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   thread_param->framebuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (framebuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->framebuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->framebuffers_copied)
+          {
+             memcpy(thread_param->framebuffers_copied, framebuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->framebuffers = (const GLuint  *)thread_param->framebuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *renderbuffers;
+
+} EVGL_Thread_Command_glGenRenderbuffers;
+
+static void
+_evgl_thread_glGenRenderbuffers(void *data)
+{
+   EVGL_Thread_Command_glGenRenderbuffers *thread_param =
+      (EVGL_Thread_Command_glGenRenderbuffers *)data;
+
+   glGenRenderbuffers(thread_param->n,
+                      thread_param->renderbuffers);
+
+}
+
+EAPI void
+glGenRenderbuffers_evgl_thread_cmd(GLsizei n, GLuint *renderbuffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGenRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGenRenderbuffers thread_param_local;
+   EVGL_Thread_Command_glGenRenderbuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGenRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_Thread_Command_glBindRenderbuffer;
+
+static void
+_evgl_thread_glBindRenderbuffer(void *data)
+{
+   EVGL_Thread_Command_glBindRenderbuffer *thread_param =
+      (EVGL_Thread_Command_glBindRenderbuffer *)data;
+
+   glBindRenderbuffer(thread_param->target,
+                      thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindRenderbuffer_evgl_thread_cmd(GLenum target, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glBindRenderbuffer(target, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glBindRenderbuffer thread_param_local;
+   EVGL_Thread_Command_glBindRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glBindRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glBindRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glBindRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *renderbuffers;
+   void *renderbuffers_copied; /* COPIED */
+   int command_allocated;
+
+} EVGL_Thread_Command_glDeleteRenderbuffers;
+
+static void
+_evgl_thread_glDeleteRenderbuffers(void *data)
+{
+   EVGL_Thread_Command_glDeleteRenderbuffers *thread_param =
+      (EVGL_Thread_Command_glDeleteRenderbuffers *)data;
+
+   glDeleteRenderbuffers(thread_param->n,
+                         thread_param->renderbuffers);
+
+
+   if (thread_param->renderbuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->renderbuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteRenderbuffers_evgl_thread_cmd(GLsizei n, const GLuint *renderbuffers)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glDeleteRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glDeleteRenderbuffers thread_param_local;
+   EVGL_Thread_Command_glDeleteRenderbuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glDeleteRenderbuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glDeleteRenderbuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   thread_param->renderbuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (renderbuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->renderbuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->renderbuffers_copied)
+          {
+             memcpy(thread_param->renderbuffers_copied, renderbuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->renderbuffers = (const GLuint  *)thread_param->renderbuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glDeleteRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} EVGL_Thread_Command_glRenderbufferStorage;
+
+static void
+_evgl_thread_glRenderbufferStorage(void *data)
+{
+   EVGL_Thread_Command_glRenderbufferStorage *thread_param =
+      (EVGL_Thread_Command_glRenderbufferStorage *)data;
+
+   glRenderbufferStorage(thread_param->target,
+                         thread_param->internalformat,
+                         thread_param->width,
+                         thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glRenderbufferStorage_evgl_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glRenderbufferStorage(target, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glRenderbufferStorage thread_param_local;
+   EVGL_Thread_Command_glRenderbufferStorage *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glRenderbufferStorage *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glRenderbufferStorage));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glRenderbufferStorage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum renderbuffertarget;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} EVGL_Thread_Command_glFramebufferRenderbuffer;
+
+static void
+_evgl_thread_glFramebufferRenderbuffer(void *data)
+{
+   EVGL_Thread_Command_glFramebufferRenderbuffer *thread_param =
+      (EVGL_Thread_Command_glFramebufferRenderbuffer *)data;
+
+   glFramebufferRenderbuffer(thread_param->target,
+                             thread_param->attachment,
+                             thread_param->renderbuffertarget,
+                             thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferRenderbuffer_evgl_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glFramebufferRenderbuffer thread_param_local;
+   EVGL_Thread_Command_glFramebufferRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glFramebufferRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glFramebufferRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->renderbuffertarget = renderbuffertarget;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glFramebufferRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   int command_allocated;
+
+} EVGL_Thread_Command_glFramebufferTexture2D;
+
+static void
+_evgl_thread_glFramebufferTexture2D(void *data)
+{
+   EVGL_Thread_Command_glFramebufferTexture2D *thread_param =
+      (EVGL_Thread_Command_glFramebufferTexture2D *)data;
+
+   glFramebufferTexture2D(thread_param->target,
+                          thread_param->attachment,
+                          thread_param->textarget,
+                          thread_param->texture,
+                          thread_param->level);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2D_evgl_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glFramebufferTexture2D(target, attachment, textarget, texture, level);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glFramebufferTexture2D thread_param_local;
+   EVGL_Thread_Command_glFramebufferTexture2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glFramebufferTexture2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glFramebufferTexture2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glFramebufferTexture2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glCheckFramebufferStatus(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLenum target;
+
+} EVGL_Thread_Command_glCheckFramebufferStatus;
+
+static void
+_evgl_thread_glCheckFramebufferStatus(void *data)
+{
+   EVGL_Thread_Command_glCheckFramebufferStatus *thread_param =
+      (EVGL_Thread_Command_glCheckFramebufferStatus *)data;
+
+   thread_param->return_value = glCheckFramebufferStatus(thread_param->target);
+
+}
+
+EAPI GLenum
+glCheckFramebufferStatus_evgl_thread_cmd(GLenum target)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glCheckFramebufferStatus(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glCheckFramebufferStatus thread_param_local;
+   EVGL_Thread_Command_glCheckFramebufferStatus *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glCheckFramebufferStatus,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glFlush(void);
+ */
+
+static void
+_evgl_thread_glFlush(void *data EINA_UNUSED)
+{
+   glFlush();
+
+}
+
+EAPI void
+glFlush_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glFlush();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glFlush,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glFinish(void);
+ */
+
+static void
+_evgl_thread_glFinish(void *data EINA_UNUSED)
+{
+   glFinish();
+
+}
+
+EAPI void
+glFinish_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glFinish();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glFinish,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glHint(GLenum target, GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum mode;
+   int command_allocated;
+
+} EVGL_Thread_Command_glHint;
+
+static void
+_evgl_thread_glHint(void *data)
+{
+   EVGL_Thread_Command_glHint *thread_param =
+      (EVGL_Thread_Command_glHint *)data;
+
+   glHint(thread_param->target,
+          thread_param->mode);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glHint_evgl_thread_cmd(GLenum target, GLenum mode)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glHint(target, mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glHint thread_param_local;
+   EVGL_Thread_Command_glHint *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        EVGL_Thread_Command_glHint *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(EVGL_Thread_Command_glHint));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glHint,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   const GLubyte *
+   glGetString(GLenum name);
+ */
+
+typedef struct
+{
+   const GLubyte * return_value;
+   GLenum name;
+
+} EVGL_Thread_Command_glGetString;
+
+static void
+_evgl_thread_glGetString(void *data)
+{
+   EVGL_Thread_Command_glGetString *thread_param =
+      (EVGL_Thread_Command_glGetString *)data;
+
+   thread_param->return_value = glGetString(thread_param->name);
+
+}
+
+EAPI const GLubyte *
+glGetString_evgl_thread_cmd(GLenum name)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glGetString(name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetString thread_param_local;
+   EVGL_Thread_Command_glGetString *thread_param = &thread_param_local;
+
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetString,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBooleanv(GLenum pname, GLboolean *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLboolean *data;
+
+} EVGL_Thread_Command_glGetBooleanv;
+
+static void
+_evgl_thread_glGetBooleanv(void *data)
+{
+   EVGL_Thread_Command_glGetBooleanv *thread_param =
+      (EVGL_Thread_Command_glGetBooleanv *)data;
+
+   glGetBooleanv(thread_param->pname,
+                 thread_param->data);
+
+}
+
+EAPI void
+glGetBooleanv_evgl_thread_cmd(GLenum pname, GLboolean *data)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetBooleanv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetBooleanv thread_param_local;
+   EVGL_Thread_Command_glGetBooleanv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetBooleanv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFloatv(GLenum pname, GLfloat *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat *data;
+
+} EVGL_Thread_Command_glGetFloatv;
+
+static void
+_evgl_thread_glGetFloatv(void *data)
+{
+   EVGL_Thread_Command_glGetFloatv *thread_param =
+      (EVGL_Thread_Command_glGetFloatv *)data;
+
+   glGetFloatv(thread_param->pname,
+               thread_param->data);
+
+}
+
+EAPI void
+glGetFloatv_evgl_thread_cmd(GLenum pname, GLfloat *data)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetFloatv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetFloatv thread_param_local;
+   EVGL_Thread_Command_glGetFloatv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetFloatv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetIntegerv(GLenum pname, GLint *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint *data;
+
+} EVGL_Thread_Command_glGetIntegerv;
+
+static void
+_evgl_thread_glGetIntegerv(void *data)
+{
+   EVGL_Thread_Command_glGetIntegerv *thread_param =
+      (EVGL_Thread_Command_glGetIntegerv *)data;
+
+   glGetIntegerv(thread_param->pname,
+                 thread_param->data);
+
+}
+
+EAPI void
+glGetIntegerv_evgl_thread_cmd(GLenum pname, GLint *data)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetIntegerv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetIntegerv thread_param_local;
+   EVGL_Thread_Command_glGetIntegerv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetIntegerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsBuffer(GLint buffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint buffer;
+
+} EVGL_Thread_Command_glIsBuffer;
+
+static void
+_evgl_thread_glIsBuffer(void *data)
+{
+   EVGL_Thread_Command_glIsBuffer *thread_param =
+      (EVGL_Thread_Command_glIsBuffer *)data;
+
+   thread_param->return_value = glIsBuffer(thread_param->buffer);
+
+}
+
+EAPI GLboolean
+glIsBuffer_evgl_thread_cmd(GLint buffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsBuffer(buffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsBuffer thread_param_local;
+   EVGL_Thread_Command_glIsBuffer *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_Thread_Command_glGetBufferParameteriv;
+
+static void
+_evgl_thread_glGetBufferParameteriv(void *data)
+{
+   EVGL_Thread_Command_glGetBufferParameteriv *thread_param =
+      (EVGL_Thread_Command_glGetBufferParameteriv *)data;
+
+   glGetBufferParameteriv(thread_param->target,
+                          thread_param->pname,
+                          thread_param->params);
+
+}
+
+EAPI void
+glGetBufferParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetBufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetBufferParameteriv thread_param_local;
+   EVGL_Thread_Command_glGetBufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetBufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint shader;
+
+} EVGL_Thread_Command_glIsShader;
+
+static void
+_evgl_thread_glIsShader(void *data)
+{
+   EVGL_Thread_Command_glIsShader *thread_param =
+      (EVGL_Thread_Command_glIsShader *)data;
+
+   thread_param->return_value = glIsShader(thread_param->shader);
+
+}
+
+EAPI GLboolean
+glIsShader_evgl_thread_cmd(GLuint shader)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsShader(shader);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsShader thread_param_local;
+   EVGL_Thread_Command_glIsShader *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetShaderiv(GLuint shader, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_Thread_Command_glGetShaderiv;
+
+static void
+_evgl_thread_glGetShaderiv(void *data)
+{
+   EVGL_Thread_Command_glGetShaderiv *thread_param =
+      (EVGL_Thread_Command_glGetShaderiv *)data;
+
+   glGetShaderiv(thread_param->shader,
+                 thread_param->pname,
+                 thread_param->params);
+
+}
+
+EAPI void
+glGetShaderiv_evgl_thread_cmd(GLuint shader, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetShaderiv(shader, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetShaderiv thread_param_local;
+   EVGL_Thread_Command_glGetShaderiv *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetShaderiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei maxCount;
+   GLsizei *count;
+   GLuint *shaders;
+
+} EVGL_Thread_Command_glGetAttachedShaders;
+
+static void
+_evgl_thread_glGetAttachedShaders(void *data)
+{
+   EVGL_Thread_Command_glGetAttachedShaders *thread_param =
+      (EVGL_Thread_Command_glGetAttachedShaders *)data;
+
+   glGetAttachedShaders(thread_param->program,
+                        thread_param->maxCount,
+                        thread_param->count,
+                        thread_param->shaders);
+
+}
+
+EAPI void
+glGetAttachedShaders_evgl_thread_cmd(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetAttachedShaders(program, maxCount, count, shaders);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetAttachedShaders thread_param_local;
+   EVGL_Thread_Command_glGetAttachedShaders *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->maxCount = maxCount;
+   thread_param->count = count;
+   thread_param->shaders = shaders;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetAttachedShaders,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *infoLog;
+
+} EVGL_Thread_Command_glGetShaderInfoLog;
+
+static void
+_evgl_thread_glGetShaderInfoLog(void *data)
+{
+   EVGL_Thread_Command_glGetShaderInfoLog *thread_param =
+      (EVGL_Thread_Command_glGetShaderInfoLog *)data;
+
+   glGetShaderInfoLog(thread_param->shader,
+                      thread_param->bufSize,
+                      thread_param->length,
+                      thread_param->infoLog);
+
+}
+
+EAPI void
+glGetShaderInfoLog_evgl_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetShaderInfoLog(shader, bufSize, length, infoLog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetShaderInfoLog thread_param_local;
+   EVGL_Thread_Command_glGetShaderInfoLog *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->infoLog = infoLog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetShaderInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *source;
+
+} EVGL_Thread_Command_glGetShaderSource;
+
+static void
+_evgl_thread_glGetShaderSource(void *data)
+{
+   EVGL_Thread_Command_glGetShaderSource *thread_param =
+      (EVGL_Thread_Command_glGetShaderSource *)data;
+
+   glGetShaderSource(thread_param->shader,
+                     thread_param->bufSize,
+                     thread_param->length,
+                     thread_param->source);
+
+}
+
+EAPI void
+glGetShaderSource_evgl_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetShaderSource(shader, bufSize, length, source);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetShaderSource thread_param_local;
+   EVGL_Thread_Command_glGetShaderSource *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->source = source;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+ */
+
+typedef struct
+{
+   GLenum shadertype;
+   GLenum precisiontype;
+   GLint *range;
+   GLint *precision;
+
+} EVGL_Thread_Command_glGetShaderPrecisionFormat;
+
+static void
+_evgl_thread_glGetShaderPrecisionFormat(void *data)
+{
+   EVGL_Thread_Command_glGetShaderPrecisionFormat *thread_param =
+      (EVGL_Thread_Command_glGetShaderPrecisionFormat *)data;
+
+   glGetShaderPrecisionFormat(thread_param->shadertype,
+                              thread_param->precisiontype,
+                              thread_param->range,
+                              thread_param->precision);
+
+}
+
+EAPI void
+glGetShaderPrecisionFormat_evgl_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetShaderPrecisionFormat thread_param_local;
+   EVGL_Thread_Command_glGetShaderPrecisionFormat *thread_param = &thread_param_local;
+
+   thread_param->shadertype = shadertype;
+   thread_param->precisiontype = precisiontype;
+   thread_param->range = range;
+   thread_param->precision = precision;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetShaderPrecisionFormat,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLfloat *params;
+
+} EVGL_Thread_Command_glGetVertexAttribfv;
+
+static void
+_evgl_thread_glGetVertexAttribfv(void *data)
+{
+   EVGL_Thread_Command_glGetVertexAttribfv *thread_param =
+      (EVGL_Thread_Command_glGetVertexAttribfv *)data;
+
+   glGetVertexAttribfv(thread_param->index,
+                       thread_param->pname,
+                       thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribfv_evgl_thread_cmd(GLuint index, GLenum pname, GLfloat *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetVertexAttribfv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetVertexAttribfv thread_param_local;
+   EVGL_Thread_Command_glGetVertexAttribfv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetVertexAttribfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribiv(GLuint index, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_Thread_Command_glGetVertexAttribiv;
+
+static void
+_evgl_thread_glGetVertexAttribiv(void *data)
+{
+   EVGL_Thread_Command_glGetVertexAttribiv *thread_param =
+      (EVGL_Thread_Command_glGetVertexAttribiv *)data;
+
+   glGetVertexAttribiv(thread_param->index,
+                       thread_param->pname,
+                       thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribiv_evgl_thread_cmd(GLuint index, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetVertexAttribiv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetVertexAttribiv thread_param_local;
+   EVGL_Thread_Command_glGetVertexAttribiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetVertexAttribiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint program;
+
+} EVGL_Thread_Command_glIsProgram;
+
+static void
+_evgl_thread_glIsProgram(void *data)
+{
+   EVGL_Thread_Command_glIsProgram *thread_param =
+      (EVGL_Thread_Command_glIsProgram *)data;
+
+   thread_param->return_value = glIsProgram(thread_param->program);
+
+}
+
+EAPI GLboolean
+glIsProgram_evgl_thread_cmd(GLuint program)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsProgram(program);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsProgram thread_param_local;
+   EVGL_Thread_Command_glIsProgram *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *infoLog;
+
+} EVGL_Thread_Command_glGetProgramInfoLog;
+
+static void
+_evgl_thread_glGetProgramInfoLog(void *data)
+{
+   EVGL_Thread_Command_glGetProgramInfoLog *thread_param =
+      (EVGL_Thread_Command_glGetProgramInfoLog *)data;
+
+   glGetProgramInfoLog(thread_param->program,
+                       thread_param->bufSize,
+                       thread_param->length,
+                       thread_param->infoLog);
+
+}
+
+EAPI void
+glGetProgramInfoLog_evgl_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetProgramInfoLog(program, bufSize, length, infoLog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetProgramInfoLog thread_param_local;
+   EVGL_Thread_Command_glGetProgramInfoLog *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->infoLog = infoLog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetProgramInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramiv(GLuint program, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_Thread_Command_glGetProgramiv;
+
+static void
+_evgl_thread_glGetProgramiv(void *data)
+{
+   EVGL_Thread_Command_glGetProgramiv *thread_param =
+      (EVGL_Thread_Command_glGetProgramiv *)data;
+
+   glGetProgramiv(thread_param->program,
+                  thread_param->pname,
+                  thread_param->params);
+
+}
+
+EAPI void
+glGetProgramiv_evgl_thread_cmd(GLuint program, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetProgramiv(program, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetProgramiv thread_param_local;
+   EVGL_Thread_Command_glGetProgramiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetProgramiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsFramebuffer(GLint framebuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint framebuffer;
+
+} EVGL_Thread_Command_glIsFramebuffer;
+
+static void
+_evgl_thread_glIsFramebuffer(void *data)
+{
+   EVGL_Thread_Command_glIsFramebuffer *thread_param =
+      (EVGL_Thread_Command_glIsFramebuffer *)data;
+
+   thread_param->return_value = glIsFramebuffer(thread_param->framebuffer);
+
+}
+
+EAPI GLboolean
+glIsFramebuffer_evgl_thread_cmd(GLint framebuffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsFramebuffer(framebuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsFramebuffer thread_param_local;
+   EVGL_Thread_Command_glIsFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsFramebuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glIsRenderbuffer(GLint renderbuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint renderbuffer;
+
+} EVGL_Thread_Command_glIsRenderbuffer;
+
+static void
+_evgl_thread_glIsRenderbuffer(void *data)
+{
+   EVGL_Thread_Command_glIsRenderbuffer *thread_param =
+      (EVGL_Thread_Command_glIsRenderbuffer *)data;
+
+   thread_param->return_value = glIsRenderbuffer(thread_param->renderbuffer);
+
+}
+
+EAPI GLboolean
+glIsRenderbuffer_evgl_thread_cmd(GLint renderbuffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsRenderbuffer(renderbuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsRenderbuffer thread_param_local;
+   EVGL_Thread_Command_glIsRenderbuffer *thread_param = &thread_param_local;
+
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsRenderbuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} EVGL_Thread_Command_glGetRenderbufferParameteriv;
+
+static void
+_evgl_thread_glGetRenderbufferParameteriv(void *data)
+{
+   EVGL_Thread_Command_glGetRenderbufferParameteriv *thread_param =
+      (EVGL_Thread_Command_glGetRenderbufferParameteriv *)data;
+
+   glGetRenderbufferParameteriv(thread_param->target,
+                                thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetRenderbufferParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glGetRenderbufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glGetRenderbufferParameteriv thread_param_local;
+   EVGL_Thread_Command_glGetRenderbufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glGetRenderbufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsTexture(GLint texture);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint texture;
+
+} EVGL_Thread_Command_glIsTexture;
+
+static void
+_evgl_thread_glIsTexture(void *data)
+{
+   EVGL_Thread_Command_glIsTexture *thread_param =
+      (EVGL_Thread_Command_glIsTexture *)data;
+
+   thread_param->return_value = glIsTexture(thread_param->texture);
+
+}
+
+EAPI GLboolean
+glIsTexture_evgl_thread_cmd(GLint texture)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glIsTexture(texture);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glIsTexture thread_param_local;
+   EVGL_Thread_Command_glIsTexture *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glIsTexture,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.h b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_generated.h
new file mode 100644 (file)
index 0000000..5d72d80
--- /dev/null
@@ -0,0 +1,142 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+#define EVAS_GL_NO_GL_H_CHECK 1
+#include "Evas_GL.h"
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+EAPI GLenum glGetError_evgl_thread_cmd(void);
+EAPI void glVertexAttribPointer_evgl_thread_cmd(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+EAPI void glEnableVertexAttribArray_evgl_thread_cmd(GLuint index);
+EAPI void glDisableVertexAttribArray_evgl_thread_cmd(GLuint index);
+EAPI void glDrawArrays_evgl_thread_cmd(GLenum mode, GLint first, GLsizei count);
+EAPI void glDrawElements_evgl_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void *indices);
+EAPI void glGenBuffers_evgl_thread_cmd(GLsizei n, GLuint *buffers);
+EAPI void glDeleteBuffers_evgl_thread_cmd(GLsizei n, const GLuint *buffers);
+EAPI void glBindBuffer_evgl_thread_cmd(GLenum target, GLuint buffer);
+EAPI void glBufferData_evgl_thread_cmd(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+EAPI GLuint glCreateShader_evgl_thread_cmd(GLenum type);
+EAPI void glShaderSource_evgl_thread_cmd(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+EAPI void glCompileShader_evgl_thread_cmd(GLuint shader);
+EAPI void glDeleteShader_evgl_thread_cmd(GLuint shader);
+EAPI GLuint glCreateProgram_evgl_thread_cmd(void);
+EAPI void glAttachShader_evgl_thread_cmd(GLuint program, GLuint shader);
+EAPI void glDetachShader_evgl_thread_cmd(GLuint program, GLuint shader);
+EAPI void glLinkProgram_evgl_thread_cmd(GLuint program);
+EAPI void glUseProgram_evgl_thread_cmd(GLuint program);
+EAPI void glDeleteProgram_evgl_thread_cmd(GLuint program);
+
+EAPI void glGetProgramBinary_orig_evgl_set(void *func);
+EAPI void *glGetProgramBinary_orig_evgl_get(void);
+EAPI void glGetProgramBinary_evgl_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+EAPI void glProgramBinary_orig_evgl_set(void *func);
+EAPI void *glProgramBinary_orig_evgl_get(void);
+EAPI void glProgramBinary_evgl_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+EAPI void glGetActiveAttrib_evgl_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+EAPI GLint glGetAttribLocation_evgl_thread_cmd(GLuint program, const GLchar *name);
+EAPI void glBindAttribLocation_evgl_thread_cmd(GLuint program, GLuint index, const GLchar *name);
+EAPI GLint glGetUniformLocation_evgl_thread_cmd(GLuint program, const GLchar *name);
+EAPI void glUniform1f_evgl_thread_cmd(GLint location, GLfloat v0);
+EAPI void glUniform1i_evgl_thread_cmd(GLint location, GLint v0);
+EAPI void glUniform2f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1);
+EAPI void glUniform2i_evgl_thread_cmd(GLint location, GLint v0, GLint v1);
+EAPI void glUniform3f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+EAPI void glUniform3i_evgl_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2);
+EAPI void glUniform4f_evgl_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+EAPI void glUniform4i_evgl_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+EAPI void glUniform1fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform1iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform2fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform2iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform3fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform3iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform4fv_evgl_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform4iv_evgl_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniformMatrix2fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix3fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix4fv_evgl_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glViewport_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glEnable_evgl_thread_cmd(GLenum cap);
+EAPI void glDisable_evgl_thread_cmd(GLenum cap);
+EAPI void glLineWidth_evgl_thread_cmd(GLfloat width);
+EAPI void glPolygonOffset_evgl_thread_cmd(GLfloat factor, GLfloat units);
+EAPI void glPixelStorei_evgl_thread_cmd(GLenum pname, GLint param);
+EAPI void glActiveTexture_evgl_thread_cmd(GLenum texture);
+EAPI void glGenTextures_evgl_thread_cmd(GLsizei n, GLuint *textures);
+EAPI void glBindTexture_evgl_thread_cmd(GLenum target, GLuint texture);
+EAPI void glDeleteTextures_evgl_thread_cmd(GLsizei n, const GLuint *textures);
+EAPI void glTexImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+EAPI void glTexSubImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+EAPI void glCompressedTexImage2D_evgl_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+EAPI void glCompressedTexSubImage2D_evgl_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+EAPI void glTexParameterf_evgl_thread_cmd(GLenum target, GLenum pname, GLfloat param);
+EAPI void glTexParameterfv_evgl_thread_cmd(GLenum target, GLenum pname, const GLfloat *params);
+EAPI void glTexParameteri_evgl_thread_cmd(GLenum target, GLenum pname, GLint param);
+EAPI void glTexParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, const GLint *params);
+EAPI void glScissor_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glBlendFunc_evgl_thread_cmd(GLenum sfactor, GLenum dfactor);
+EAPI void glBlendColor_evgl_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+EAPI void glDepthMask_evgl_thread_cmd(GLboolean flag);
+EAPI void glClear_evgl_thread_cmd(GLbitfield mask);
+EAPI void glClearColor_evgl_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+EAPI void glReadPixels_evgl_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+EAPI void glGenFramebuffers_evgl_thread_cmd(GLsizei n, GLuint *framebuffers);
+EAPI void glBindFramebuffer_evgl_thread_cmd(GLenum target, GLuint framebuffer);
+EAPI void glDeleteFramebuffers_evgl_thread_cmd(GLsizei n, const GLuint *framebuffers);
+EAPI void glGenRenderbuffers_evgl_thread_cmd(GLsizei n, GLuint *renderbuffers);
+EAPI void glBindRenderbuffer_evgl_thread_cmd(GLenum target, GLuint renderbuffer);
+EAPI void glDeleteRenderbuffers_evgl_thread_cmd(GLsizei n, const GLuint *renderbuffers);
+EAPI void glRenderbufferStorage_evgl_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glFramebufferRenderbuffer_evgl_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+EAPI void glFramebufferTexture2D_evgl_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+EAPI GLenum glCheckFramebufferStatus_evgl_thread_cmd(GLenum target);
+EAPI void glFlush_evgl_thread_cmd(void);
+EAPI void glFinish_evgl_thread_cmd(void);
+EAPI void glHint_evgl_thread_cmd(GLenum target, GLenum mode);
+EAPI const GLubyte * glGetString_evgl_thread_cmd(GLenum name);
+EAPI void glGetBooleanv_evgl_thread_cmd(GLenum pname, GLboolean *data);
+EAPI void glGetFloatv_evgl_thread_cmd(GLenum pname, GLfloat *data);
+EAPI void glGetIntegerv_evgl_thread_cmd(GLenum pname, GLint *data);
+EAPI GLboolean glIsBuffer_evgl_thread_cmd(GLint buffer);
+EAPI void glGetBufferParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, GLint *params);
+EAPI GLboolean glIsShader_evgl_thread_cmd(GLuint shader);
+EAPI void glGetShaderiv_evgl_thread_cmd(GLuint shader, GLenum pname, GLint *params);
+EAPI void glGetAttachedShaders_evgl_thread_cmd(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+EAPI void glGetShaderInfoLog_evgl_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+EAPI void glGetShaderSource_evgl_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+EAPI void glGetShaderPrecisionFormat_evgl_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+EAPI void glGetVertexAttribfv_evgl_thread_cmd(GLuint index, GLenum pname, GLfloat *params);
+EAPI void glGetVertexAttribiv_evgl_thread_cmd(GLuint index, GLenum pname, GLint *params);
+EAPI GLboolean glIsProgram_evgl_thread_cmd(GLuint program);
+EAPI void glGetProgramInfoLog_evgl_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+EAPI void glGetProgramiv_evgl_thread_cmd(GLuint program, GLenum pname, GLint *params);
+EAPI GLboolean glIsFramebuffer_evgl_thread_cmd(GLint framebuffer);
+EAPI GLboolean glIsRenderbuffer_evgl_thread_cmd(GLint renderbuffer);
+EAPI void glGetRenderbufferParameteriv_evgl_thread_cmd(GLenum target, GLenum pname, GLint *params);
+EAPI GLboolean glIsTexture_evgl_thread_cmd(GLint texture);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.c b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.c
new file mode 100644 (file)
index 0000000..0e2f5c3
--- /dev/null
@@ -0,0 +1,227 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+GLenum (*glGetError_evgl_thread_cmd)(void) = NULL;
+void (*glVertexAttribPointer_evgl_thread_cmd)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) = NULL;
+void (*glEnableVertexAttribArray_evgl_thread_cmd)(GLuint index) = NULL;
+void (*glDisableVertexAttribArray_evgl_thread_cmd)(GLuint index) = NULL;
+void (*glDrawArrays_evgl_thread_cmd)(GLenum mode, GLint first, GLsizei count) = NULL;
+void (*glDrawElements_evgl_thread_cmd)(GLenum mode, GLsizei count, GLenum type, const void *indices) = NULL;
+void (*glGenBuffers_evgl_thread_cmd)(GLsizei n, GLuint *buffers) = NULL;
+void (*glDeleteBuffers_evgl_thread_cmd)(GLsizei n, const GLuint *buffers) = NULL;
+void (*glBindBuffer_evgl_thread_cmd)(GLenum target, GLuint buffer) = NULL;
+void (*glBufferData_evgl_thread_cmd)(GLenum target, GLsizeiptr size, const void *data, GLenum usage) = NULL;
+GLuint (*glCreateShader_evgl_thread_cmd)(GLenum type) = NULL;
+void (*glShaderSource_evgl_thread_cmd)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length) = NULL;
+void (*glCompileShader_evgl_thread_cmd)(GLuint shader) = NULL;
+void (*glDeleteShader_evgl_thread_cmd)(GLuint shader) = NULL;
+GLuint (*glCreateProgram_evgl_thread_cmd)(void) = NULL;
+void (*glAttachShader_evgl_thread_cmd)(GLuint program, GLuint shader) = NULL;
+void (*glDetachShader_evgl_thread_cmd)(GLuint program, GLuint shader) = NULL;
+void (*glLinkProgram_evgl_thread_cmd)(GLuint program) = NULL;
+void (*glUseProgram_evgl_thread_cmd)(GLuint program) = NULL;
+void (*glDeleteProgram_evgl_thread_cmd)(GLuint program) = NULL;
+void (*glGetProgramBinary_orig_evgl_set)(void *func) = NULL;
+void *(*glGetProgramBinary_orig_evgl_get)(void) = NULL;
+void (*glGetProgramBinary_evgl_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) = NULL;
+void (*glProgramBinary_orig_evgl_set)(void *func) = NULL;
+void *(*glProgramBinary_orig_evgl_get)(void) = NULL;
+void (*glProgramBinary_evgl_thread_cmd)(GLuint program, GLenum binaryFormat, const void *binary, GLint length) = NULL;
+void (*glGetActiveAttrib_evgl_thread_cmd)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) = NULL;
+GLint (*glGetAttribLocation_evgl_thread_cmd)(GLuint program, const GLchar *name) = NULL;
+void (*glBindAttribLocation_evgl_thread_cmd)(GLuint program, GLuint index, const GLchar *name) = NULL;
+GLint (*glGetUniformLocation_evgl_thread_cmd)(GLuint program, const GLchar *name) = NULL;
+void (*glUniform1f_evgl_thread_cmd)(GLint location, GLfloat v0) = NULL;
+void (*glUniform1i_evgl_thread_cmd)(GLint location, GLint v0) = NULL;
+void (*glUniform2f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1) = NULL;
+void (*glUniform2i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1) = NULL;
+void (*glUniform3f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) = NULL;
+void (*glUniform3i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2) = NULL;
+void (*glUniform4f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) = NULL;
+void (*glUniform4i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) = NULL;
+void (*glUniform1fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform1iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform2fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform2iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform3fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform3iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform4fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform4iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniformMatrix2fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glUniformMatrix3fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glUniformMatrix4fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glViewport_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+void (*glEnable_evgl_thread_cmd)(GLenum cap) = NULL;
+void (*glDisable_evgl_thread_cmd)(GLenum cap) = NULL;
+void (*glLineWidth_evgl_thread_cmd)(GLfloat width) = NULL;
+void (*glPolygonOffset_evgl_thread_cmd)(GLfloat factor, GLfloat units) = NULL;
+void (*glPixelStorei_evgl_thread_cmd)(GLenum pname, GLint param) = NULL;
+void (*glActiveTexture_evgl_thread_cmd)(GLenum texture) = NULL;
+void (*glGenTextures_evgl_thread_cmd)(GLsizei n, GLuint *textures) = NULL;
+void (*glBindTexture_evgl_thread_cmd)(GLenum target, GLuint texture) = NULL;
+void (*glDeleteTextures_evgl_thread_cmd)(GLsizei n, const GLuint *textures) = NULL;
+void (*glTexImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) = NULL;
+void (*glTexSubImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) = NULL;
+void (*glCompressedTexImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) = NULL;
+void (*glCompressedTexSubImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) = NULL;
+void (*glTexParameterf_evgl_thread_cmd)(GLenum target, GLenum pname, GLfloat param) = NULL;
+void (*glTexParameterfv_evgl_thread_cmd)(GLenum target, GLenum pname, const GLfloat *params) = NULL;
+void (*glTexParameteri_evgl_thread_cmd)(GLenum target, GLenum pname, GLint param) = NULL;
+void (*glTexParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, const GLint *params) = NULL;
+void (*glScissor_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+void (*glBlendFunc_evgl_thread_cmd)(GLenum sfactor, GLenum dfactor) = NULL;
+void (*glBlendColor_evgl_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) = NULL;
+void (*glDepthMask_evgl_thread_cmd)(GLboolean flag) = NULL;
+void (*glClear_evgl_thread_cmd)(GLbitfield mask) = NULL;
+void (*glClearColor_evgl_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) = NULL;
+void (*glReadPixels_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) = NULL;
+void (*glGenFramebuffers_evgl_thread_cmd)(GLsizei n, GLuint *framebuffers) = NULL;
+void (*glBindFramebuffer_evgl_thread_cmd)(GLenum target, GLuint framebuffer) = NULL;
+void (*glDeleteFramebuffers_evgl_thread_cmd)(GLsizei n, const GLuint *framebuffers) = NULL;
+void (*glGenRenderbuffers_evgl_thread_cmd)(GLsizei n, GLuint *renderbuffers) = NULL;
+void (*glBindRenderbuffer_evgl_thread_cmd)(GLenum target, GLuint renderbuffer) = NULL;
+void (*glDeleteRenderbuffers_evgl_thread_cmd)(GLsizei n, const GLuint *renderbuffers) = NULL;
+void (*glRenderbufferStorage_evgl_thread_cmd)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
+void (*glFramebufferRenderbuffer_evgl_thread_cmd)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
+void (*glFramebufferTexture2D_evgl_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
+GLenum (*glCheckFramebufferStatus_evgl_thread_cmd)(GLenum target) = NULL;
+void (*glFlush_evgl_thread_cmd)(void) = NULL;
+void (*glFinish_evgl_thread_cmd)(void) = NULL;
+void (*glHint_evgl_thread_cmd)(GLenum target, GLenum mode) = NULL;
+const GLubyte * (*glGetString_evgl_thread_cmd)(GLenum name) = NULL;
+void (*glGetBooleanv_evgl_thread_cmd)(GLenum pname, GLboolean *data) = NULL;
+void (*glGetFloatv_evgl_thread_cmd)(GLenum pname, GLfloat *data) = NULL;
+void (*glGetIntegerv_evgl_thread_cmd)(GLenum pname, GLint *data) = NULL;
+GLboolean (*glIsBuffer_evgl_thread_cmd)(GLint buffer) = NULL;
+void (*glGetBufferParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsShader_evgl_thread_cmd)(GLuint shader) = NULL;
+void (*glGetShaderiv_evgl_thread_cmd)(GLuint shader, GLenum pname, GLint *params) = NULL;
+void (*glGetAttachedShaders_evgl_thread_cmd)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) = NULL;
+void (*glGetShaderInfoLog_evgl_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) = NULL;
+void (*glGetShaderSource_evgl_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) = NULL;
+void (*glGetShaderPrecisionFormat_evgl_thread_cmd)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision) = NULL;
+void (*glGetVertexAttribfv_evgl_thread_cmd)(GLuint index, GLenum pname, GLfloat *params) = NULL;
+void (*glGetVertexAttribiv_evgl_thread_cmd)(GLuint index, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsProgram_evgl_thread_cmd)(GLuint program) = NULL;
+void (*glGetProgramInfoLog_evgl_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) = NULL;
+void (*glGetProgramiv_evgl_thread_cmd)(GLuint program, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsFramebuffer_evgl_thread_cmd)(GLint framebuffer) = NULL;
+GLboolean (*glIsRenderbuffer_evgl_thread_cmd)(GLint renderbuffer) = NULL;
+void (*glGetRenderbufferParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsTexture_evgl_thread_cmd)(GLint texture) = NULL;
+
+
+void _evgl_thread_link_init()
+{
+#define LINK2GENERIC(sym) \
+   sym = dlsym(RTLD_DEFAULT, #sym); \
+   if (!sym) ERR("Could not find function '%s'", #sym);
+
+   LINK2GENERIC(glGetError_evgl_thread_cmd);
+   LINK2GENERIC(glVertexAttribPointer_evgl_thread_cmd);
+   LINK2GENERIC(glEnableVertexAttribArray_evgl_thread_cmd);
+   LINK2GENERIC(glDisableVertexAttribArray_evgl_thread_cmd);
+   LINK2GENERIC(glDrawArrays_evgl_thread_cmd);
+   LINK2GENERIC(glDrawElements_evgl_thread_cmd);
+   LINK2GENERIC(glGenBuffers_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteBuffers_evgl_thread_cmd);
+   LINK2GENERIC(glBindBuffer_evgl_thread_cmd);
+   LINK2GENERIC(glBufferData_evgl_thread_cmd);
+   LINK2GENERIC(glCreateShader_evgl_thread_cmd);
+   LINK2GENERIC(glShaderSource_evgl_thread_cmd);
+   LINK2GENERIC(glCompileShader_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteShader_evgl_thread_cmd);
+   LINK2GENERIC(glCreateProgram_evgl_thread_cmd);
+   LINK2GENERIC(glAttachShader_evgl_thread_cmd);
+   LINK2GENERIC(glDetachShader_evgl_thread_cmd);
+   LINK2GENERIC(glLinkProgram_evgl_thread_cmd);
+   LINK2GENERIC(glUseProgram_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteProgram_evgl_thread_cmd);
+   LINK2GENERIC(glGetProgramBinary_orig_evgl_set);
+   LINK2GENERIC(glGetProgramBinary_orig_evgl_get);
+   LINK2GENERIC(glGetProgramBinary_evgl_thread_cmd);
+   LINK2GENERIC(glProgramBinary_orig_evgl_set);
+   LINK2GENERIC(glProgramBinary_orig_evgl_get);
+   LINK2GENERIC(glProgramBinary_evgl_thread_cmd);
+   LINK2GENERIC(glGetActiveAttrib_evgl_thread_cmd);
+   LINK2GENERIC(glGetAttribLocation_evgl_thread_cmd);
+   LINK2GENERIC(glBindAttribLocation_evgl_thread_cmd);
+   LINK2GENERIC(glGetUniformLocation_evgl_thread_cmd);
+   LINK2GENERIC(glUniform1f_evgl_thread_cmd);
+   LINK2GENERIC(glUniform1i_evgl_thread_cmd);
+   LINK2GENERIC(glUniform2f_evgl_thread_cmd);
+   LINK2GENERIC(glUniform2i_evgl_thread_cmd);
+   LINK2GENERIC(glUniform3f_evgl_thread_cmd);
+   LINK2GENERIC(glUniform3i_evgl_thread_cmd);
+   LINK2GENERIC(glUniform4f_evgl_thread_cmd);
+   LINK2GENERIC(glUniform4i_evgl_thread_cmd);
+   LINK2GENERIC(glUniform1fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform1iv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform2fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform2iv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform3fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform3iv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform4fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniform4iv_evgl_thread_cmd);
+   LINK2GENERIC(glUniformMatrix2fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniformMatrix3fv_evgl_thread_cmd);
+   LINK2GENERIC(glUniformMatrix4fv_evgl_thread_cmd);
+   LINK2GENERIC(glViewport_evgl_thread_cmd);
+   LINK2GENERIC(glEnable_evgl_thread_cmd);
+   LINK2GENERIC(glDisable_evgl_thread_cmd);
+   LINK2GENERIC(glLineWidth_evgl_thread_cmd);
+   LINK2GENERIC(glPolygonOffset_evgl_thread_cmd);
+   LINK2GENERIC(glPixelStorei_evgl_thread_cmd);
+   LINK2GENERIC(glActiveTexture_evgl_thread_cmd);
+   LINK2GENERIC(glGenTextures_evgl_thread_cmd);
+   LINK2GENERIC(glBindTexture_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteTextures_evgl_thread_cmd);
+   LINK2GENERIC(glTexImage2D_evgl_thread_cmd);
+   LINK2GENERIC(glTexSubImage2D_evgl_thread_cmd);
+   LINK2GENERIC(glCompressedTexImage2D_evgl_thread_cmd);
+   LINK2GENERIC(glCompressedTexSubImage2D_evgl_thread_cmd);
+   LINK2GENERIC(glTexParameterf_evgl_thread_cmd);
+   LINK2GENERIC(glTexParameterfv_evgl_thread_cmd);
+   LINK2GENERIC(glTexParameteri_evgl_thread_cmd);
+   LINK2GENERIC(glTexParameteriv_evgl_thread_cmd);
+   LINK2GENERIC(glScissor_evgl_thread_cmd);
+   LINK2GENERIC(glBlendFunc_evgl_thread_cmd);
+   LINK2GENERIC(glBlendColor_evgl_thread_cmd);
+   LINK2GENERIC(glDepthMask_evgl_thread_cmd);
+   LINK2GENERIC(glClear_evgl_thread_cmd);
+   LINK2GENERIC(glClearColor_evgl_thread_cmd);
+   LINK2GENERIC(glReadPixels_evgl_thread_cmd);
+   LINK2GENERIC(glGenFramebuffers_evgl_thread_cmd);
+   LINK2GENERIC(glBindFramebuffer_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteFramebuffers_evgl_thread_cmd);
+   LINK2GENERIC(glGenRenderbuffers_evgl_thread_cmd);
+   LINK2GENERIC(glBindRenderbuffer_evgl_thread_cmd);
+   LINK2GENERIC(glDeleteRenderbuffers_evgl_thread_cmd);
+   LINK2GENERIC(glRenderbufferStorage_evgl_thread_cmd);
+   LINK2GENERIC(glFramebufferRenderbuffer_evgl_thread_cmd);
+   LINK2GENERIC(glFramebufferTexture2D_evgl_thread_cmd);
+   LINK2GENERIC(glCheckFramebufferStatus_evgl_thread_cmd);
+   LINK2GENERIC(glFlush_evgl_thread_cmd);
+   LINK2GENERIC(glFinish_evgl_thread_cmd);
+   LINK2GENERIC(glHint_evgl_thread_cmd);
+   LINK2GENERIC(glGetString_evgl_thread_cmd);
+   LINK2GENERIC(glGetBooleanv_evgl_thread_cmd);
+   LINK2GENERIC(glGetFloatv_evgl_thread_cmd);
+   LINK2GENERIC(glGetIntegerv_evgl_thread_cmd);
+   LINK2GENERIC(glIsBuffer_evgl_thread_cmd);
+   LINK2GENERIC(glGetBufferParameteriv_evgl_thread_cmd);
+   LINK2GENERIC(glIsShader_evgl_thread_cmd);
+   LINK2GENERIC(glGetShaderiv_evgl_thread_cmd);
+   LINK2GENERIC(glGetAttachedShaders_evgl_thread_cmd);
+   LINK2GENERIC(glGetShaderInfoLog_evgl_thread_cmd);
+   LINK2GENERIC(glGetShaderSource_evgl_thread_cmd);
+   LINK2GENERIC(glGetShaderPrecisionFormat_evgl_thread_cmd);
+   LINK2GENERIC(glGetVertexAttribfv_evgl_thread_cmd);
+   LINK2GENERIC(glGetVertexAttribiv_evgl_thread_cmd);
+   LINK2GENERIC(glIsProgram_evgl_thread_cmd);
+   LINK2GENERIC(glGetProgramInfoLog_evgl_thread_cmd);
+   LINK2GENERIC(glGetProgramiv_evgl_thread_cmd);
+   LINK2GENERIC(glIsFramebuffer_evgl_thread_cmd);
+   LINK2GENERIC(glIsRenderbuffer_evgl_thread_cmd);
+   LINK2GENERIC(glGetRenderbufferParameteriv_evgl_thread_cmd);
+   LINK2GENERIC(glIsTexture_evgl_thread_cmd);
+}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.h b/src/modules/evas/engines/gl_common/evas_gl_thread_evgl_link_generated.h
new file mode 100644 (file)
index 0000000..3b51035
--- /dev/null
@@ -0,0 +1,113 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+extern GLenum (*glGetError_evgl_thread_cmd)(void);
+extern void (*glVertexAttribPointer_evgl_thread_cmd)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+extern void (*glEnableVertexAttribArray_evgl_thread_cmd)(GLuint index);
+extern void (*glDisableVertexAttribArray_evgl_thread_cmd)(GLuint index);
+extern void (*glDrawArrays_evgl_thread_cmd)(GLenum mode, GLint first, GLsizei count);
+extern void (*glDrawElements_evgl_thread_cmd)(GLenum mode, GLsizei count, GLenum type, const void *indices);
+extern void (*glGenBuffers_evgl_thread_cmd)(GLsizei n, GLuint *buffers);
+extern void (*glDeleteBuffers_evgl_thread_cmd)(GLsizei n, const GLuint *buffers);
+extern void (*glBindBuffer_evgl_thread_cmd)(GLenum target, GLuint buffer);
+extern void (*glBufferData_evgl_thread_cmd)(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+extern GLuint (*glCreateShader_evgl_thread_cmd)(GLenum type);
+extern void (*glShaderSource_evgl_thread_cmd)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+extern void (*glCompileShader_evgl_thread_cmd)(GLuint shader);
+extern void (*glDeleteShader_evgl_thread_cmd)(GLuint shader);
+extern GLuint (*glCreateProgram_evgl_thread_cmd)(void);
+extern void (*glAttachShader_evgl_thread_cmd)(GLuint program, GLuint shader);
+extern void (*glDetachShader_evgl_thread_cmd)(GLuint program, GLuint shader);
+extern void (*glLinkProgram_evgl_thread_cmd)(GLuint program);
+extern void (*glUseProgram_evgl_thread_cmd)(GLuint program);
+extern void (*glDeleteProgram_evgl_thread_cmd)(GLuint program);
+extern void (*glGetProgramBinary_orig_evgl_set)(void *func);
+extern void *(*glGetProgramBinary_orig_evgl_get)(void);
+extern void (*glGetProgramBinary_evgl_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+extern void (*glProgramBinary_orig_evgl_set)(void *func);
+extern void *(*glProgramBinary_orig_evgl_get)(void);
+extern void (*glProgramBinary_evgl_thread_cmd)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+extern void (*glGetActiveAttrib_evgl_thread_cmd)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+extern GLint (*glGetAttribLocation_evgl_thread_cmd)(GLuint program, const GLchar *name);
+extern void (*glBindAttribLocation_evgl_thread_cmd)(GLuint program, GLuint index, const GLchar *name);
+extern GLint (*glGetUniformLocation_evgl_thread_cmd)(GLuint program, const GLchar *name);
+extern void (*glUniform1f_evgl_thread_cmd)(GLint location, GLfloat v0);
+extern void (*glUniform1i_evgl_thread_cmd)(GLint location, GLint v0);
+extern void (*glUniform2f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1);
+extern void (*glUniform2i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1);
+extern void (*glUniform3f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+extern void (*glUniform3i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2);
+extern void (*glUniform4f_evgl_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+extern void (*glUniform4i_evgl_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+extern void (*glUniform1fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform1iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform2fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform2iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform3fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform3iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform4fv_evgl_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform4iv_evgl_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniformMatrix2fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glUniformMatrix3fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glUniformMatrix4fv_evgl_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glViewport_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height);
+extern void (*glEnable_evgl_thread_cmd)(GLenum cap);
+extern void (*glDisable_evgl_thread_cmd)(GLenum cap);
+extern void (*glLineWidth_evgl_thread_cmd)(GLfloat width);
+extern void (*glPolygonOffset_evgl_thread_cmd)(GLfloat factor, GLfloat units);
+extern void (*glPixelStorei_evgl_thread_cmd)(GLenum pname, GLint param);
+extern void (*glActiveTexture_evgl_thread_cmd)(GLenum texture);
+extern void (*glGenTextures_evgl_thread_cmd)(GLsizei n, GLuint *textures);
+extern void (*glBindTexture_evgl_thread_cmd)(GLenum target, GLuint texture);
+extern void (*glDeleteTextures_evgl_thread_cmd)(GLsizei n, const GLuint *textures);
+extern void (*glTexImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+extern void (*glTexSubImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+extern void (*glCompressedTexImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+extern void (*glCompressedTexSubImage2D_evgl_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+extern void (*glTexParameterf_evgl_thread_cmd)(GLenum target, GLenum pname, GLfloat param);
+extern void (*glTexParameterfv_evgl_thread_cmd)(GLenum target, GLenum pname, const GLfloat *params);
+extern void (*glTexParameteri_evgl_thread_cmd)(GLenum target, GLenum pname, GLint param);
+extern void (*glTexParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, const GLint *params);
+extern void (*glScissor_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height);
+extern void (*glBlendFunc_evgl_thread_cmd)(GLenum sfactor, GLenum dfactor);
+extern void (*glBlendColor_evgl_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+extern void (*glDepthMask_evgl_thread_cmd)(GLboolean flag);
+extern void (*glClear_evgl_thread_cmd)(GLbitfield mask);
+extern void (*glClearColor_evgl_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+extern void (*glReadPixels_evgl_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+extern void (*glGenFramebuffers_evgl_thread_cmd)(GLsizei n, GLuint *framebuffers);
+extern void (*glBindFramebuffer_evgl_thread_cmd)(GLenum target, GLuint framebuffer);
+extern void (*glDeleteFramebuffers_evgl_thread_cmd)(GLsizei n, const GLuint *framebuffers);
+extern void (*glGenRenderbuffers_evgl_thread_cmd)(GLsizei n, GLuint *renderbuffers);
+extern void (*glBindRenderbuffer_evgl_thread_cmd)(GLenum target, GLuint renderbuffer);
+extern void (*glDeleteRenderbuffers_evgl_thread_cmd)(GLsizei n, const GLuint *renderbuffers);
+extern void (*glRenderbufferStorage_evgl_thread_cmd)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+extern void (*glFramebufferRenderbuffer_evgl_thread_cmd)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+extern void (*glFramebufferTexture2D_evgl_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+extern GLenum (*glCheckFramebufferStatus_evgl_thread_cmd)(GLenum target);
+extern void (*glFlush_evgl_thread_cmd)(void);
+extern void (*glFinish_evgl_thread_cmd)(void);
+extern void (*glHint_evgl_thread_cmd)(GLenum target, GLenum mode);
+extern const GLubyte * (*glGetString_evgl_thread_cmd)(GLenum name);
+extern void (*glGetBooleanv_evgl_thread_cmd)(GLenum pname, GLboolean *data);
+extern void (*glGetFloatv_evgl_thread_cmd)(GLenum pname, GLfloat *data);
+extern void (*glGetIntegerv_evgl_thread_cmd)(GLenum pname, GLint *data);
+extern GLboolean (*glIsBuffer_evgl_thread_cmd)(GLint buffer);
+extern void (*glGetBufferParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, GLint *params);
+extern GLboolean (*glIsShader_evgl_thread_cmd)(GLuint shader);
+extern void (*glGetShaderiv_evgl_thread_cmd)(GLuint shader, GLenum pname, GLint *params);
+extern void (*glGetAttachedShaders_evgl_thread_cmd)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+extern void (*glGetShaderInfoLog_evgl_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+extern void (*glGetShaderSource_evgl_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+extern void (*glGetShaderPrecisionFormat_evgl_thread_cmd)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+extern void (*glGetVertexAttribfv_evgl_thread_cmd)(GLuint index, GLenum pname, GLfloat *params);
+extern void (*glGetVertexAttribiv_evgl_thread_cmd)(GLuint index, GLenum pname, GLint *params);
+extern GLboolean (*glIsProgram_evgl_thread_cmd)(GLuint program);
+extern void (*glGetProgramInfoLog_evgl_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+extern void (*glGetProgramiv_evgl_thread_cmd)(GLuint program, GLenum pname, GLint *params);
+extern GLboolean (*glIsFramebuffer_evgl_thread_cmd)(GLint framebuffer);
+extern GLboolean (*glIsRenderbuffer_evgl_thread_cmd)(GLint renderbuffer);
+extern void (*glGetRenderbufferParameteriv_evgl_thread_cmd)(GLenum target, GLenum pname, GLint *params);
+extern GLboolean (*glIsTexture_evgl_thread_cmd)(GLint texture);
+
+
+extern void _gl_thread_link_init();
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl.c b/src/modules/evas/engines/gl_common/evas_gl_thread_gl.c
new file mode 100644 (file)
index 0000000..1dec009
--- /dev/null
@@ -0,0 +1,361 @@
+#include "evas_gl_common.h"
+#include "evas_gl_thread.h"
+
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+#define GLSHADERSOURCE_COPY_VARIABLE GLchar **string_copied
+#define GLSHADERSOURCE_COPY_VARIABLE_FREE \
+   if (thread_param->string_copied) { \
+      int i; \
+      for (i = 0; i < thread_param->count; i++) { \
+        if (thread_param->string_copied[i]) { \
+           eina_mempool_free(_mp_default, thread_param->string_copied[i]); \
+        } \
+      }\
+     eina_mempool_free(_mp_default, thread_param->string_copied); \
+   }
+
+#define GLSHADERSOURCE_COPY_VARIABLE_INIT \
+   thread_param->string_copied = NULL;
+
+#define GLSHADERSOURCE_COPY_TO_MEMPOOL \
+   if (string) { \
+      /* 1. check memory size */ \
+      if ((unsigned int)(sizeof(char *) * count) > _mp_default_memory_size) { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      int i, len = 0; \
+      for (i = 0; i < count; i++) { \
+         if (length) len = length[i]; \
+         else        len = strlen(string[i]); \
+         if ((unsigned int)len + 1 > _mp_default_memory_size) { \
+            thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+            goto finish; \
+         } \
+      } \
+      /* 2. malloc & copy */ \
+      thread_param->string_copied = eina_mempool_malloc(_mp_default, sizeof(char *) * count); \
+      if (thread_param->string_copied) { \
+         memset(thread_param->string_copied, 0x00, sizeof(char *) * count); \
+            for (i = 0, len = 0; i < count; i++) { \
+               if (length) len = length[i]; \
+               else        len = strlen(string[i]); \
+               thread_param->string_copied[i] = eina_mempool_malloc(_mp_default, len + 1); \
+               if (thread_param->string_copied[i]) { \
+                  memcpy(thread_param->string_copied[i], string[i], len + 1); \
+               } \
+               else { \
+                  thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+                  goto finish; \
+               } \
+            } \
+      } \
+      else { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      /* 3. replace */ \
+      thread_param->string = (const GLchar **)thread_param->string_copied; \
+   }
+
+static int getSize(GLenum format, GLenum type)
+{
+   int csize = 0, comp = 0;
+   switch(type)
+   {
+#ifdef GL_UNSIGNED_BYTE_3_3_2
+      case GL_UNSIGNED_BYTE_3_3_2:
+#endif
+#ifdef GL_UNSIGNED_BYTE_2_3_3
+     case GL_UNSIGNED_BYTE_2_3_3:
+#endif
+         csize = 1; comp = 1;
+
+#ifdef GL_UNSIGNED_SHORT_5_6_5
+      case GL_UNSIGNED_SHORT_5_6_5:
+#endif
+
+#ifdef GL_UNSIGNED_SHORT_5_6_5_REV
+     case GL_UNSIGNED_SHORT_5_6_5_REV:
+#endif
+
+#ifdef GL_UNSIGNED_SHORT_4_4_4_4
+      case GL_UNSIGNED_SHORT_4_4_4_4:
+#endif
+
+#ifdef GL_UNSIGNED_SHORT_4_4_4_4_REV
+     case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+#endif
+
+#ifdef GL_UNSIGNED_SHORT_5_5_5_1
+      case GL_UNSIGNED_SHORT_5_5_5_1:
+#endif
+
+#ifdef GL_UNSIGNED_SHORT_1_5_5_5_REV
+     case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+#endif
+         csize = 2; comp = 1;
+
+#ifdef GL_UNSIGNED_INT_8_8_8_8
+      case GL_UNSIGNED_INT_8_8_8_8:
+#endif
+
+#ifdef GL_UNSIGNED_INT_8_8_8_8_REV
+     case GL_UNSIGNED_INT_8_8_8_8_REV:
+#endif
+
+#ifdef GL_UNSIGNED_INT_10_10_10_2
+      case GL_UNSIGNED_INT_10_10_10_2:
+#endif
+
+#ifdef GL_UNSIGNED_INT_2_10_10_10_REV
+     case GL_UNSIGNED_INT_2_10_10_10_REV:
+#endif
+         csize = 4; comp = 1;
+
+      case GL_UNSIGNED_BYTE: case GL_BYTE:
+         csize = 1;
+#ifdef GL_UNGINED_SHORT
+      case GL_UNGINED_SHORT:
+#endif
+     case GL_SHORT:
+         csize = 2;
+      case GL_UNSIGNED_INT: case GL_INT:
+         csize = 4;
+      case GL_FLOAT:
+         csize = sizeof(float);
+      default:
+         return -1;
+   }
+
+   if (comp == 0) {
+      switch(format)
+      {
+         case GL_RED: case GL_RG:
+            comp = 1;
+         case GL_RGB: case GL_BGR:
+         case GL_RGBA: case GL_BGRA:
+         case GL_RED_INTEGER: case GL_RG_INTEGER: case GL_RGB_INTEGER:
+#ifdef GL_BGR_INTEGER
+         case GL_BGR_INTEGER:
+#endif
+         case GL_RGBA_INTEGER:
+#ifdef GL_BGRA_INTEGER
+         case GL_BGRA_INTEGER:
+#endif
+            comp = 1;
+         default:
+            return -1;
+      }
+   }
+
+   return csize * comp;
+}
+
+
+#define GLTEXIMAGE2D_COPY_VARIABLE void *pixels_copied
+#define GLTEXIMAGE2D_COPY_VARIABLE_FREE \
+   if (thread_param->pixels_copied) \
+     eina_mempool_free(_mp_texture, thread_param->pixels_copied);
+
+#define GLTEXIMAGE2D_COPY_VARIABLE_INIT \
+   thread_param->pixels_copied = NULL;
+
+#define GLTEXIMAGE2D_COPY_TO_MEMPOOL \
+   int size = getSize(format, type); \
+   if (size < 0) { \
+      thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+      goto finish; \
+   } \
+   if (pixels) { \
+      /* 1. check memory size */ \
+      unsigned int copy_size = (width + (border * 2)) * (height + (border * 2)) * size; \
+      if (copy_size > _mp_texture_memory_size) { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+     } \
+      /* 2. malloc & copy */ \
+      thread_param->pixels_copied = eina_mempool_malloc(_mp_texture, copy_size); \
+     if (thread_param->pixels_copied) { \
+         memcpy(thread_param->pixels_copied, pixels, copy_size); \
+     } \
+     else { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+     } \
+      /* 3. replace */ \
+     thread_param->pixels = (const void *)thread_param->pixels_copied; \
+   }
+
+
+#define GLTEXSUBIMAGE2D_COPY_VARIABLE void *pixels_copied
+#define GLTEXSUBIMAGE2D_COPY_VARIABLE_FREE \
+   if (thread_param->pixels_copied) \
+     eina_mempool_free(_mp_texture, thread_param->pixels_copied);
+
+#define GLTEXSUBIMAGE2D_COPY_VARIABLE_INIT \
+   thread_param->pixels_copied = NULL;
+
+#define GLTEXSUBIMAGE2D_COPY_TO_MEMPOOL \
+   int size = getSize(format, type); \
+   if (size < 0) { \
+      thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+      goto finish; \
+   } \
+   if (pixels) { \
+      /* 1. check memory size */ \
+      unsigned int copy_size = width * height * size; \
+      if (copy_size > _mp_texture_memory_size) { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+     } \
+      /* 2. malloc & copy */ \
+      thread_param->pixels_copied = eina_mempool_malloc(_mp_texture, copy_size); \
+     if (thread_param->pixels_copied) { \
+         memcpy(thread_param->pixels_copied, pixels, copy_size); \
+     } \
+     else { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+     } \
+      /* 3. replace */ \
+     thread_param->pixels = (const void *)thread_param->pixels_copied; \
+   }
+
+#define GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE void *data_copied
+#define GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_FREE \
+   if (thread_param->data_copied) \
+      eina_mempool_free(_mp_texture, thread_param->data_copied);
+
+#define GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_INIT \
+   thread_param->data_copied = NULL;
+
+#define GLCOMPRESSEDTEXIMAGE2D_COPY_TO_MEMPOOL \
+    if (data) { \
+      /* 1. check memory size */ \
+      if ((unsigned int)imageSize > _mp_texture_memory_size) { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      /* 2. malloc & copy */ \
+      thread_param->data_copied = eina_mempool_malloc(_mp_texture, imageSize); \
+      if (thread_param->data_copied) { \
+         memcpy(thread_param->data_copied, data, imageSize); \
+      } \
+      else { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      /* 3. replace */ \
+      thread_param->data = (const void *)thread_param->data_copied; \
+   }
+
+
+#define GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE void *data_copied
+#define GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_FREE \
+   if (thread_param->data_copied) \
+      eina_mempool_free(_mp_texture, thread_param->data_copied);
+
+#define GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_INIT \
+   thread_param->data_copied = NULL;
+
+#define GLCOMPRESSEDTEXSUBIMAGE2D_COPY_TO_MEMPOOL \
+    if (data) { \
+      /* 1. check memory size */ \
+      if ((unsigned int)imageSize > _mp_texture_memory_size) { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      /* 2. malloc & copy */ \
+      thread_param->data_copied = eina_mempool_malloc(_mp_texture, imageSize); \
+      if (thread_param->data_copied) { \
+         memcpy(thread_param->data_copied, data, imageSize); \
+      } \
+      else { \
+         thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
+         goto finish; \
+      } \
+      /* 3. replace */ \
+      thread_param->data = (const void *)thread_param->data_copied; \
+   }
+
+
+#include "evas_gl_thread_gl_generated.c"
+#include "evas_gl_thread_evgl_generated.c"
+#include "evas_gl_thread_evgl_api_generated.c"
+
+EAPI void
+glTexSubImage2DEVAS_thread_cmd(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexSubImage2D thread_param_local;
+   Thread_Command_glTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   if (thread_push)
+     {
+        /* NON COPY FASTPATH. Must finish before end of functional logic */
+        thread_mode = EVAS_GL_THREAD_MODE_ENQUEUE;
+     }
+   else
+     {
+        GLTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+     }
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+
+#else  /* ! EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#include <dlfcn.h>
+#include "evas_gl_thread_gl_link_generated.c"
+#include "evas_gl_thread_evgl_link_generated.c"
+
+void (*glTexSubImage2DEVAS_thread_cmd)(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) = NULL;
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl.h b/src/modules/evas/engines/gl_common/evas_gl_thread_gl.h
new file mode 100644 (file)
index 0000000..db12337
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef EVAS_GL_THREAD_GL_H
+#define EVAS_GL_THREAD_GL_H
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+#ifndef TIZEN
+/* We should clear platform dependencies for Evas_GL.h */
+typedef int64_t EvasGLint64;
+typedef uint64_t EvasGLuint64;
+#endif
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+# include "evas_gl_thread_gl_generated.h"
+# include "evas_gl_thread_evgl_generated.h"
+# include "evas_gl_thread_evgl_api_generated.h"
+
+EAPI void
+glTexSubImage2DEVAS_thread_cmd(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+
+#else /* ! EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+# include "evas_gl_thread_gl_link_generated.h"
+# include "evas_gl_thread_evgl_link_generated.h"
+
+extern void (*glTexSubImage2DEVAS_thread_cmd)(int thread_push, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+#endif /* EVAS_GL_THREAD_GL_H */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.c b/src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.c
new file mode 100644 (file)
index 0000000..5675e57
--- /dev/null
@@ -0,0 +1,8000 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+/*
+   GLenum
+   glGetError(void);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+
+} Thread_Command_glGetError;
+
+static void
+_gl_thread_glGetError(void *data)
+{
+   Thread_Command_glGetError *thread_param =
+      (Thread_Command_glGetError *)data;
+
+   thread_param->return_value = glGetError();
+
+}
+
+EAPI GLenum
+glGetError_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glGetError();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetError thread_param_local;
+   Thread_Command_glGetError *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetError,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLint size;
+   GLenum type;
+   GLboolean normalized;
+   GLsizei stride;
+   const void *pointer;
+
+} Thread_Command_glVertexAttribPointer;
+
+static void
+_gl_thread_glVertexAttribPointer(void *data)
+{
+   Thread_Command_glVertexAttribPointer *thread_param =
+      (Thread_Command_glVertexAttribPointer *)data;
+
+   glVertexAttribPointer(thread_param->index,
+                         thread_param->size,
+                         thread_param->type,
+                         thread_param->normalized,
+                         thread_param->stride,
+                         thread_param->pointer);
+
+}
+
+EAPI void
+glVertexAttribPointer_thread_cmd(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glVertexAttribPointer(index, size, type, normalized, stride, pointer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glVertexAttribPointer thread_param_local;
+   Thread_Command_glVertexAttribPointer *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->normalized = normalized;
+   thread_param->stride = stride;
+   thread_param->pointer = pointer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glVertexAttribPointer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} Thread_Command_glEnableVertexAttribArray;
+
+static void
+_gl_thread_glEnableVertexAttribArray(void *data)
+{
+   Thread_Command_glEnableVertexAttribArray *thread_param =
+      (Thread_Command_glEnableVertexAttribArray *)data;
+
+   glEnableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnableVertexAttribArray_thread_cmd(GLuint index)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glEnableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glEnableVertexAttribArray thread_param_local;
+   Thread_Command_glEnableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glEnableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glEnableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_ENQUEUE;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glEnableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisableVertexAttribArray(GLuint index);
+ */
+
+typedef struct
+{
+   GLuint index;
+   int command_allocated;
+
+} Thread_Command_glDisableVertexAttribArray;
+
+static void
+_gl_thread_glDisableVertexAttribArray(void *data)
+{
+   Thread_Command_glDisableVertexAttribArray *thread_param =
+      (Thread_Command_glDisableVertexAttribArray *)data;
+
+   glDisableVertexAttribArray(thread_param->index);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisableVertexAttribArray_thread_cmd(GLuint index)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDisableVertexAttribArray(index);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDisableVertexAttribArray thread_param_local;
+   Thread_Command_glDisableVertexAttribArray *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDisableVertexAttribArray *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDisableVertexAttribArray));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_ENQUEUE;
+          }
+     }
+
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDisableVertexAttribArray,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawArrays(GLenum mode, GLint first, GLsizei count);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLint first;
+   GLsizei count;
+
+} Thread_Command_glDrawArrays;
+
+static void
+_gl_thread_glDrawArrays(void *data)
+{
+   Thread_Command_glDrawArrays *thread_param =
+      (Thread_Command_glDrawArrays *)data;
+
+   glDrawArrays(thread_param->mode,
+                thread_param->first,
+                thread_param->count);
+
+}
+
+EAPI void
+glDrawArrays_thread_cmd(GLenum mode, GLint first, GLsizei count)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDrawArrays(mode, first, count);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDrawArrays thread_param_local;
+   Thread_Command_glDrawArrays *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->first = first;
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDrawArrays,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices);
+ */
+
+typedef struct
+{
+   GLenum mode;
+   GLsizei count;
+   GLenum type;
+   const void *indices;
+
+} Thread_Command_glDrawElements;
+
+static void
+_gl_thread_glDrawElements(void *data)
+{
+   Thread_Command_glDrawElements *thread_param =
+      (Thread_Command_glDrawElements *)data;
+
+   glDrawElements(thread_param->mode,
+                  thread_param->count,
+                  thread_param->type,
+                  thread_param->indices);
+
+}
+
+EAPI void
+glDrawElements_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void *indices)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDrawElements(mode, count, type, indices);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDrawElements thread_param_local;
+   Thread_Command_glDrawElements *thread_param = &thread_param_local;
+
+   thread_param->mode = mode;
+   thread_param->count = count;
+   thread_param->type = type;
+   thread_param->indices = indices;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDrawElements,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenBuffers(GLsizei n, GLuint *buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *buffers;
+
+} Thread_Command_glGenBuffers;
+
+static void
+_gl_thread_glGenBuffers(void *data)
+{
+   Thread_Command_glGenBuffers *thread_param =
+      (Thread_Command_glGenBuffers *)data;
+
+   glGenBuffers(thread_param->n,
+                thread_param->buffers);
+
+}
+
+EAPI void
+glGenBuffers_thread_cmd(GLsizei n, GLuint *buffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGenBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGenBuffers thread_param_local;
+   Thread_Command_glGenBuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGenBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteBuffers(GLsizei n, const GLuint *buffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *buffers;
+   void *buffers_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glDeleteBuffers;
+
+static void
+_gl_thread_glDeleteBuffers(void *data)
+{
+   Thread_Command_glDeleteBuffers *thread_param =
+      (Thread_Command_glDeleteBuffers *)data;
+
+   glDeleteBuffers(thread_param->n,
+                   thread_param->buffers);
+
+
+   if (thread_param->buffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->buffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteBuffers_thread_cmd(GLsizei n, const GLuint *buffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDeleteBuffers(n, buffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteBuffers thread_param_local;
+   Thread_Command_glDeleteBuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteBuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteBuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->buffers = buffers;
+
+   thread_param->buffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (buffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->buffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->buffers_copied)
+          {
+             memcpy(thread_param->buffers_copied, buffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->buffers = (const GLuint  *)thread_param->buffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindBuffer(GLenum target, GLuint buffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint buffer;
+   int command_allocated;
+
+} Thread_Command_glBindBuffer;
+
+static void
+_gl_thread_glBindBuffer(void *data)
+{
+   Thread_Command_glBindBuffer *thread_param =
+      (Thread_Command_glBindBuffer *)data;
+
+   glBindBuffer(thread_param->target,
+                thread_param->buffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindBuffer_thread_cmd(GLenum target, GLuint buffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBindBuffer(target, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBindBuffer thread_param_local;
+   Thread_Command_glBindBuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBindBuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBindBuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBindBuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBufferData(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizeiptr size;
+   const void *data;
+   GLenum usage;
+
+} Thread_Command_glBufferData;
+
+static void
+_gl_thread_glBufferData(void *data)
+{
+   Thread_Command_glBufferData *thread_param =
+      (Thread_Command_glBufferData *)data;
+
+   glBufferData(thread_param->target,
+                thread_param->size,
+                thread_param->data,
+                thread_param->usage);
+
+}
+
+EAPI void
+glBufferData_thread_cmd(GLenum target, GLsizeiptr size, const void *data, GLenum usage)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBufferData(target, size, data, usage);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBufferData thread_param_local;
+   Thread_Command_glBufferData *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->size = size;
+   thread_param->data = data;
+   thread_param->usage = usage;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBufferData,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void *
+   glMapBuffer(GLenum target, GLenum access);
+ */
+
+typedef struct
+{
+   void * return_value;
+   GLenum target;
+   GLenum access;
+
+} Thread_Command_glMapBuffer;
+
+void * (*orig_evas_glMapBuffer)(GLenum target, GLenum access);
+
+void
+glMapBuffer_orig_evas_set(void *func)
+{
+   orig_evas_glMapBuffer = func;
+}
+
+void *
+glMapBuffer_orig_evas_get(void)
+{
+   return orig_evas_glMapBuffer;
+}
+
+static void
+_gl_thread_glMapBuffer(void *data)
+{
+   Thread_Command_glMapBuffer *thread_param =
+      (Thread_Command_glMapBuffer *)data;
+
+   thread_param->return_value = orig_evas_glMapBuffer(thread_param->target,
+                                                      thread_param->access);
+
+}
+
+EAPI void *
+glMapBuffer_thread_cmd(GLenum target, GLenum access)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glMapBuffer(target, access);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glMapBuffer thread_param_local;
+   Thread_Command_glMapBuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->access = access;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glMapBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLboolean
+   glUnmapBuffer(GLenum target);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLenum target;
+
+} Thread_Command_glUnmapBuffer;
+
+GLboolean (*orig_evas_glUnmapBuffer)(GLenum target);
+
+void
+glUnmapBuffer_orig_evas_set(void *func)
+{
+   orig_evas_glUnmapBuffer = func;
+}
+
+void *
+glUnmapBuffer_orig_evas_get(void)
+{
+   return orig_evas_glUnmapBuffer;
+}
+
+static void
+_gl_thread_glUnmapBuffer(void *data)
+{
+   Thread_Command_glUnmapBuffer *thread_param =
+      (Thread_Command_glUnmapBuffer *)data;
+
+   thread_param->return_value = orig_evas_glUnmapBuffer(thread_param->target);
+
+}
+
+EAPI GLboolean
+glUnmapBuffer_thread_cmd(GLenum target)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glUnmapBuffer(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUnmapBuffer thread_param_local;
+   Thread_Command_glUnmapBuffer *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUnmapBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLuint
+   glCreateShader(GLenum type);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+   GLenum type;
+
+} Thread_Command_glCreateShader;
+
+static void
+_gl_thread_glCreateShader(void *data)
+{
+   Thread_Command_glCreateShader *thread_param =
+      (Thread_Command_glCreateShader *)data;
+
+   thread_param->return_value = glCreateShader(thread_param->type);
+
+}
+
+EAPI GLuint
+glCreateShader_thread_cmd(GLenum type)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glCreateShader(type);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCreateShader thread_param_local;
+   Thread_Command_glCreateShader *thread_param = &thread_param_local;
+
+   thread_param->type = type;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCreateShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glShaderSource(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei count;
+   const GLchar **string;
+   const GLint *length;
+   int command_allocated;
+   GLSHADERSOURCE_COPY_VARIABLE; /* TODO */
+
+} Thread_Command_glShaderSource;
+
+static void
+_gl_thread_glShaderSource(void *data)
+{
+   Thread_Command_glShaderSource *thread_param =
+      (Thread_Command_glShaderSource *)data;
+
+   glShaderSource(thread_param->shader,
+                  thread_param->count,
+                  thread_param->string,
+                  thread_param->length);
+
+   GLSHADERSOURCE_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glShaderSource_thread_cmd(GLuint shader, GLsizei count, const GLchar **string, const GLint *length)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glShaderSource(shader, count, string, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glShaderSource thread_param_local;
+   Thread_Command_glShaderSource *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glShaderSource *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glShaderSource));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+   thread_param->count = count;
+   thread_param->string = string;
+   thread_param->length = length;
+
+   GLSHADERSOURCE_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLSHADERSOURCE_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompileShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} Thread_Command_glCompileShader;
+
+static void
+_gl_thread_glCompileShader(void *data)
+{
+   Thread_Command_glCompileShader *thread_param =
+      (Thread_Command_glCompileShader *)data;
+
+   glCompileShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompileShader_thread_cmd(GLuint shader)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glCompileShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCompileShader thread_param_local;
+   Thread_Command_glCompileShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glCompileShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glCompileShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCompileShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReleaseShaderCompiler(void);
+ */
+
+void (*orig_evas_glReleaseShaderCompiler)(void);
+
+void
+glReleaseShaderCompiler_orig_evas_set(void *func)
+{
+   orig_evas_glReleaseShaderCompiler = func;
+}
+
+void *
+glReleaseShaderCompiler_orig_evas_get(void)
+{
+   return orig_evas_glReleaseShaderCompiler;
+}
+
+static void
+_gl_thread_glReleaseShaderCompiler(void *data EINA_UNUSED)
+{
+   orig_evas_glReleaseShaderCompiler();
+
+}
+
+EAPI void
+glReleaseShaderCompiler_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glReleaseShaderCompiler();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glReleaseShaderCompiler,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   int command_allocated;
+
+} Thread_Command_glDeleteShader;
+
+static void
+_gl_thread_glDeleteShader(void *data)
+{
+   Thread_Command_glDeleteShader *thread_param =
+      (Thread_Command_glDeleteShader *)data;
+
+   glDeleteShader(thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteShader_thread_cmd(GLuint shader)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDeleteShader(shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteShader thread_param_local;
+   Thread_Command_glDeleteShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLuint
+   glCreateProgram(void);
+ */
+
+typedef struct
+{
+   GLuint return_value;
+
+} Thread_Command_glCreateProgram;
+
+static void
+_gl_thread_glCreateProgram(void *data)
+{
+   Thread_Command_glCreateProgram *thread_param =
+      (Thread_Command_glCreateProgram *)data;
+
+   thread_param->return_value = glCreateProgram();
+
+}
+
+EAPI GLuint
+glCreateProgram_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glCreateProgram();
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCreateProgram thread_param_local;
+   Thread_Command_glCreateProgram *thread_param = &thread_param_local;
+
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCreateProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glAttachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} Thread_Command_glAttachShader;
+
+static void
+_gl_thread_glAttachShader(void *data)
+{
+   Thread_Command_glAttachShader *thread_param =
+      (Thread_Command_glAttachShader *)data;
+
+   glAttachShader(thread_param->program,
+                  thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glAttachShader_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glAttachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glAttachShader thread_param_local;
+   Thread_Command_glAttachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glAttachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glAttachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glAttachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDetachShader(GLuint program, GLuint shader);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint shader;
+   int command_allocated;
+
+} Thread_Command_glDetachShader;
+
+static void
+_gl_thread_glDetachShader(void *data)
+{
+   Thread_Command_glDetachShader *thread_param =
+      (Thread_Command_glDetachShader *)data;
+
+   glDetachShader(thread_param->program,
+                  thread_param->shader);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDetachShader_thread_cmd(GLuint program, GLuint shader)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDetachShader(program, shader);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDetachShader thread_param_local;
+   Thread_Command_glDetachShader *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDetachShader *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDetachShader));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDetachShader,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLinkProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} Thread_Command_glLinkProgram;
+
+static void
+_gl_thread_glLinkProgram(void *data)
+{
+   Thread_Command_glLinkProgram *thread_param =
+      (Thread_Command_glLinkProgram *)data;
+
+   glLinkProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLinkProgram_thread_cmd(GLuint program)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glLinkProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glLinkProgram thread_param_local;
+   Thread_Command_glLinkProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glLinkProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glLinkProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glLinkProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUseProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} Thread_Command_glUseProgram;
+
+static void
+_gl_thread_glUseProgram(void *data)
+{
+   Thread_Command_glUseProgram *thread_param =
+      (Thread_Command_glUseProgram *)data;
+
+   glUseProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUseProgram_thread_cmd(GLuint program)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUseProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUseProgram thread_param_local;
+   Thread_Command_glUseProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUseProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUseProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUseProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramParameteri(GLuint program, GLenum pname, GLint value);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum pname;
+   GLint value;
+   int command_allocated;
+
+} Thread_Command_glProgramParameteri;
+
+void (*orig_evas_glProgramParameteri)(GLuint program, GLenum pname, GLint value);
+
+void
+glProgramParameteri_orig_evas_set(void *func)
+{
+   orig_evas_glProgramParameteri = func;
+}
+
+void *
+glProgramParameteri_orig_evas_get(void)
+{
+   return orig_evas_glProgramParameteri;
+}
+
+static void
+_gl_thread_glProgramParameteri(void *data)
+{
+   Thread_Command_glProgramParameteri *thread_param =
+      (Thread_Command_glProgramParameteri *)data;
+
+   orig_evas_glProgramParameteri(thread_param->program,
+                                 thread_param->pname,
+                                 thread_param->value);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glProgramParameteri_thread_cmd(GLuint program, GLenum pname, GLint value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glProgramParameteri(program, pname, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glProgramParameteri thread_param_local;
+   Thread_Command_glProgramParameteri *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glProgramParameteri *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glProgramParameteri));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->pname = pname;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glProgramParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLuint program;
+   int command_allocated;
+
+} Thread_Command_glDeleteProgram;
+
+static void
+_gl_thread_glDeleteProgram(void *data)
+{
+   Thread_Command_glDeleteProgram *thread_param =
+      (Thread_Command_glDeleteProgram *)data;
+
+   glDeleteProgram(thread_param->program);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteProgram_thread_cmd(GLuint program)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDeleteProgram(program);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteProgram thread_param_local;
+   Thread_Command_glDeleteProgram *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteProgram *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteProgram));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteProgram,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLenum *binaryFormat;
+   void *binary;
+
+} Thread_Command_glGetProgramBinary;
+
+void (*orig_evas_glGetProgramBinary)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+void
+glGetProgramBinary_orig_evas_set(void *func)
+{
+   orig_evas_glGetProgramBinary = func;
+}
+
+void *
+glGetProgramBinary_orig_evas_get(void)
+{
+   return orig_evas_glGetProgramBinary;
+}
+
+static void
+_gl_thread_glGetProgramBinary(void *data)
+{
+   Thread_Command_glGetProgramBinary *thread_param =
+      (Thread_Command_glGetProgramBinary *)data;
+
+   orig_evas_glGetProgramBinary(thread_param->program,
+                                thread_param->bufSize,
+                                thread_param->length,
+                                thread_param->binaryFormat,
+                                thread_param->binary);
+
+}
+
+EAPI void
+glGetProgramBinary_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glGetProgramBinary(program, bufSize, length, binaryFormat, binary);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetProgramBinary thread_param_local;
+   Thread_Command_glGetProgramBinary *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glProgramBinary(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum binaryFormat;
+   const void *binary;
+   GLint length;
+   void *binary_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glProgramBinary;
+
+void (*orig_evas_glProgramBinary)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+
+void
+glProgramBinary_orig_evas_set(void *func)
+{
+   orig_evas_glProgramBinary = func;
+}
+
+void *
+glProgramBinary_orig_evas_get(void)
+{
+   return orig_evas_glProgramBinary;
+}
+
+static void
+_gl_thread_glProgramBinary(void *data)
+{
+   Thread_Command_glProgramBinary *thread_param =
+      (Thread_Command_glProgramBinary *)data;
+
+   orig_evas_glProgramBinary(thread_param->program,
+                             thread_param->binaryFormat,
+                             thread_param->binary,
+                             thread_param->length);
+
+
+   if (thread_param->binary_copied)
+     eina_mempool_free(_mp_default, thread_param->binary_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glProgramBinary_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glProgramBinary(program, binaryFormat, binary, length);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glProgramBinary thread_param_local;
+   Thread_Command_glProgramBinary *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glProgramBinary *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glProgramBinary));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->program = program;
+   thread_param->binaryFormat = binaryFormat;
+   thread_param->binary = binary;
+   thread_param->length = length;
+
+   thread_param->binary_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (binary)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = length;
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->binary_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->binary_copied)
+          {
+             memcpy(thread_param->binary_copied, binary, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->binary = (const void  *)thread_param->binary_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glProgramBinary,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLint *size;
+   GLenum *type;
+   GLchar *name;
+
+} Thread_Command_glGetActiveAttrib;
+
+static void
+_gl_thread_glGetActiveAttrib(void *data)
+{
+   Thread_Command_glGetActiveAttrib *thread_param =
+      (Thread_Command_glGetActiveAttrib *)data;
+
+   glGetActiveAttrib(thread_param->program,
+                     thread_param->index,
+                     thread_param->bufSize,
+                     thread_param->length,
+                     thread_param->size,
+                     thread_param->type,
+                     thread_param->name);
+
+}
+
+EAPI void
+glGetActiveAttrib_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetActiveAttrib(program, index, bufSize, length, size, type, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetActiveAttrib thread_param_local;
+   Thread_Command_glGetActiveAttrib *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->size = size;
+   thread_param->type = type;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetActiveAttrib,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetAttribLocation(GLuint program, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   const GLchar *name;
+
+} Thread_Command_glGetAttribLocation;
+
+static void
+_gl_thread_glGetAttribLocation(void *data)
+{
+   Thread_Command_glGetAttribLocation *thread_param =
+      (Thread_Command_glGetAttribLocation *)data;
+
+   thread_param->return_value = glGetAttribLocation(thread_param->program,
+                                                    thread_param->name);
+
+}
+
+EAPI GLint
+glGetAttribLocation_thread_cmd(GLuint program, const GLchar *name)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glGetAttribLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetAttribLocation thread_param_local;
+   Thread_Command_glGetAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetAttribLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glBindAttribLocation(GLuint program, GLuint index, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLuint index;
+   const GLchar *name;
+
+} Thread_Command_glBindAttribLocation;
+
+static void
+_gl_thread_glBindAttribLocation(void *data)
+{
+   Thread_Command_glBindAttribLocation *thread_param =
+      (Thread_Command_glBindAttribLocation *)data;
+
+   glBindAttribLocation(thread_param->program,
+                        thread_param->index,
+                        thread_param->name);
+
+}
+
+EAPI void
+glBindAttribLocation_thread_cmd(GLuint program, GLuint index, const GLchar *name)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBindAttribLocation(program, index, name);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBindAttribLocation thread_param_local;
+   Thread_Command_glBindAttribLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->index = index;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBindAttribLocation,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLint
+   glGetUniformLocation(GLuint program, const GLchar *name);
+ */
+
+typedef struct
+{
+   GLint return_value;
+   GLuint program;
+   const GLchar *name;
+
+} Thread_Command_glGetUniformLocation;
+
+static void
+_gl_thread_glGetUniformLocation(void *data)
+{
+   Thread_Command_glGetUniformLocation *thread_param =
+      (Thread_Command_glGetUniformLocation *)data;
+
+   thread_param->return_value = glGetUniformLocation(thread_param->program,
+                                                     thread_param->name);
+
+}
+
+EAPI GLint
+glGetUniformLocation_thread_cmd(GLuint program, const GLchar *name)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glGetUniformLocation(program, name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetUniformLocation thread_param_local;
+   Thread_Command_glGetUniformLocation *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetUniformLocation,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glUniform1f(GLint location, GLfloat v0);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   int command_allocated;
+
+} Thread_Command_glUniform1f;
+
+static void
+_gl_thread_glUniform1f(void *data)
+{
+   Thread_Command_glUniform1f *thread_param =
+      (Thread_Command_glUniform1f *)data;
+
+   glUniform1f(thread_param->location,
+               thread_param->v0);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1f_thread_cmd(GLint location, GLfloat v0)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform1f(location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform1f thread_param_local;
+   Thread_Command_glUniform1f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform1f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform1f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform1f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1i(GLint location, GLint v0);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   int command_allocated;
+
+} Thread_Command_glUniform1i;
+
+static void
+_gl_thread_glUniform1i(void *data)
+{
+   Thread_Command_glUniform1i *thread_param =
+      (Thread_Command_glUniform1i *)data;
+
+   glUniform1i(thread_param->location,
+               thread_param->v0);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1i_thread_cmd(GLint location, GLint v0)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform1i(location, v0);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform1i thread_param_local;
+   Thread_Command_glUniform1i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform1i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform1i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform1i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2f(GLint location, GLfloat v0, GLfloat v1);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   int command_allocated;
+
+} Thread_Command_glUniform2f;
+
+static void
+_gl_thread_glUniform2f(void *data)
+{
+   Thread_Command_glUniform2f *thread_param =
+      (Thread_Command_glUniform2f *)data;
+
+   glUniform2f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2f_thread_cmd(GLint location, GLfloat v0, GLfloat v1)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform2f(location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform2f thread_param_local;
+   Thread_Command_glUniform2f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform2f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform2f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform2f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2i(GLint location, GLint v0, GLint v1);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   int command_allocated;
+
+} Thread_Command_glUniform2i;
+
+static void
+_gl_thread_glUniform2i(void *data)
+{
+   Thread_Command_glUniform2i *thread_param =
+      (Thread_Command_glUniform2i *)data;
+
+   glUniform2i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2i_thread_cmd(GLint location, GLint v0, GLint v1)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform2i(location, v0, v1);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform2i thread_param_local;
+   Thread_Command_glUniform2i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform2i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform2i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform2i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+   int command_allocated;
+
+} Thread_Command_glUniform3f;
+
+static void
+_gl_thread_glUniform3f(void *data)
+{
+   Thread_Command_glUniform3f *thread_param =
+      (Thread_Command_glUniform3f *)data;
+
+   glUniform3f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3f_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform3f(location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform3f thread_param_local;
+   Thread_Command_glUniform3f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform3f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform3f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform3f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3i(GLint location, GLint v0, GLint v1, GLint v2);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   int command_allocated;
+
+} Thread_Command_glUniform3i;
+
+static void
+_gl_thread_glUniform3i(void *data)
+{
+   Thread_Command_glUniform3i *thread_param =
+      (Thread_Command_glUniform3i *)data;
+
+   glUniform3i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3i_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform3i(location, v0, v1, v2);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform3i thread_param_local;
+   Thread_Command_glUniform3i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform3i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform3i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform3i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLfloat v0;
+   GLfloat v1;
+   GLfloat v2;
+   GLfloat v3;
+   int command_allocated;
+
+} Thread_Command_glUniform4f;
+
+static void
+_gl_thread_glUniform4f(void *data)
+{
+   Thread_Command_glUniform4f *thread_param =
+      (Thread_Command_glUniform4f *)data;
+
+   glUniform4f(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2,
+               thread_param->v3);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4f_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform4f(location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform4f thread_param_local;
+   Thread_Command_glUniform4f *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform4f *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform4f));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform4f,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLint v0;
+   GLint v1;
+   GLint v2;
+   GLint v3;
+   int command_allocated;
+
+} Thread_Command_glUniform4i;
+
+static void
+_gl_thread_glUniform4i(void *data)
+{
+   Thread_Command_glUniform4i *thread_param =
+      (Thread_Command_glUniform4i *)data;
+
+   glUniform4i(thread_param->location,
+               thread_param->v0,
+               thread_param->v1,
+               thread_param->v2,
+               thread_param->v3);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4i_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform4i(location, v0, v1, v2, v3);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform4i thread_param_local;
+   Thread_Command_glUniform4i *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform4i *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform4i));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->v0 = v0;
+   thread_param->v1 = v1;
+   thread_param->v2 = v2;
+   thread_param->v3 = v3;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform4i,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform1fv;
+
+static void
+_gl_thread_glUniform1fv(void *data)
+{
+   Thread_Command_glUniform1fv *thread_param =
+      (Thread_Command_glUniform1fv *)data;
+
+   glUniform1fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform1fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform1fv thread_param_local;
+   Thread_Command_glUniform1fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform1fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform1fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform1fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform1iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform1iv;
+
+static void
+_gl_thread_glUniform1iv(void *data)
+{
+   Thread_Command_glUniform1iv *thread_param =
+      (Thread_Command_glUniform1iv *)data;
+
+   glUniform1iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform1iv_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform1iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform1iv thread_param_local;
+   Thread_Command_glUniform1iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform1iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform1iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 1 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform1iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform2fv;
+
+static void
+_gl_thread_glUniform2fv(void *data)
+{
+   Thread_Command_glUniform2fv *thread_param =
+      (Thread_Command_glUniform2fv *)data;
+
+   glUniform2fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform2fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform2fv thread_param_local;
+   Thread_Command_glUniform2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform2iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform2iv;
+
+static void
+_gl_thread_glUniform2iv(void *data)
+{
+   Thread_Command_glUniform2iv *thread_param =
+      (Thread_Command_glUniform2iv *)data;
+
+   glUniform2iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform2iv_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform2iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform2iv thread_param_local;
+   Thread_Command_glUniform2iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform2iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform2iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 2 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform2iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform3fv;
+
+static void
+_gl_thread_glUniform3fv(void *data)
+{
+   Thread_Command_glUniform3fv *thread_param =
+      (Thread_Command_glUniform3fv *)data;
+
+   glUniform3fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform3fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform3fv thread_param_local;
+   Thread_Command_glUniform3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform3iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform3iv;
+
+static void
+_gl_thread_glUniform3iv(void *data)
+{
+   Thread_Command_glUniform3iv *thread_param =
+      (Thread_Command_glUniform3iv *)data;
+
+   glUniform3iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform3iv_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform3iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform3iv thread_param_local;
+   Thread_Command_glUniform3iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform3iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform3iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 3 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform3iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4fv(GLint location, GLsizei count, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform4fv;
+
+static void
+_gl_thread_glUniform4fv(void *data)
+{
+   Thread_Command_glUniform4fv *thread_param =
+      (Thread_Command_glUniform4fv *)data;
+
+   glUniform4fv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform4fv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform4fv thread_param_local;
+   Thread_Command_glUniform4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniform4iv(GLint location, GLsizei count, const GLint *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   const GLint *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniform4iv;
+
+static void
+_gl_thread_glUniform4iv(void *data)
+{
+   Thread_Command_glUniform4iv *thread_param =
+      (Thread_Command_glUniform4iv *)data;
+
+   glUniform4iv(thread_param->location,
+                thread_param->count,
+                thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniform4iv_thread_cmd(GLint location, GLsizei count, const GLint *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniform4iv(location, count, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniform4iv thread_param_local;
+   Thread_Command_glUniform4iv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniform4iv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniform4iv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLint);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLint  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniform4iv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniformMatrix2fv;
+
+static void
+_gl_thread_glUniformMatrix2fv(void *data)
+{
+   Thread_Command_glUniformMatrix2fv *thread_param =
+      (Thread_Command_glUniformMatrix2fv *)data;
+
+   glUniformMatrix2fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix2fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniformMatrix2fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniformMatrix2fv thread_param_local;
+   Thread_Command_glUniformMatrix2fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniformMatrix2fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniformMatrix2fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 4 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniformMatrix2fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniformMatrix3fv;
+
+static void
+_gl_thread_glUniformMatrix3fv(void *data)
+{
+   Thread_Command_glUniformMatrix3fv *thread_param =
+      (Thread_Command_glUniformMatrix3fv *)data;
+
+   glUniformMatrix3fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix3fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniformMatrix3fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniformMatrix3fv thread_param_local;
+   Thread_Command_glUniformMatrix3fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniformMatrix3fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniformMatrix3fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 9 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniformMatrix3fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ */
+
+typedef struct
+{
+   GLint location;
+   GLsizei count;
+   GLboolean transpose;
+   const GLfloat *value;
+   void *value_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glUniformMatrix4fv;
+
+static void
+_gl_thread_glUniformMatrix4fv(void *data)
+{
+   Thread_Command_glUniformMatrix4fv *thread_param =
+      (Thread_Command_glUniformMatrix4fv *)data;
+
+   glUniformMatrix4fv(thread_param->location,
+                      thread_param->count,
+                      thread_param->transpose,
+                      thread_param->value);
+
+
+   if (thread_param->value_copied)
+     eina_mempool_free(_mp_uniform, thread_param->value_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glUniformMatrix4fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glUniformMatrix4fv(location, count, transpose, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glUniformMatrix4fv thread_param_local;
+   Thread_Command_glUniformMatrix4fv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glUniformMatrix4fv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glUniformMatrix4fv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->location = location;
+   thread_param->count = count;
+   thread_param->transpose = transpose;
+   thread_param->value = value;
+
+   thread_param->value_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (value)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = 16 * count * sizeof(GLfloat);
+        if (copy_size > _mp_uniform_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->value_copied = eina_mempool_malloc(_mp_uniform, copy_size);
+        if (thread_param->value_copied)
+          {
+             memcpy(thread_param->value_copied, value, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->value = (const GLfloat  *)thread_param->value_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glUniformMatrix4fv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} Thread_Command_glViewport;
+
+static void
+_gl_thread_glViewport(void *data)
+{
+   Thread_Command_glViewport *thread_param =
+      (Thread_Command_glViewport *)data;
+
+   glViewport(thread_param->x,
+              thread_param->y,
+              thread_param->width,
+              thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glViewport_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glViewport(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glViewport thread_param_local;
+   Thread_Command_glViewport *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glViewport *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glViewport));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glViewport,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEnable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} Thread_Command_glEnable;
+
+static void
+_gl_thread_glEnable(void *data)
+{
+   Thread_Command_glEnable *thread_param =
+      (Thread_Command_glEnable *)data;
+
+   glEnable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEnable_thread_cmd(GLenum cap)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glEnable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glEnable thread_param_local;
+   Thread_Command_glEnable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glEnable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glEnable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_ENQUEUE;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glEnable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDisable(GLenum cap);
+ */
+
+typedef struct
+{
+   GLenum cap;
+   int command_allocated;
+
+} Thread_Command_glDisable;
+
+static void
+_gl_thread_glDisable(void *data)
+{
+   Thread_Command_glDisable *thread_param =
+      (Thread_Command_glDisable *)data;
+
+   glDisable(thread_param->cap);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDisable_thread_cmd(GLenum cap)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDisable(cap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDisable thread_param_local;
+   Thread_Command_glDisable *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDisable *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDisable));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_ENQUEUE;
+          }
+     }
+
+   thread_param->cap = cap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDisable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glLineWidth(GLfloat width);
+ */
+
+typedef struct
+{
+   GLfloat width;
+   int command_allocated;
+
+} Thread_Command_glLineWidth;
+
+static void
+_gl_thread_glLineWidth(void *data)
+{
+   Thread_Command_glLineWidth *thread_param =
+      (Thread_Command_glLineWidth *)data;
+
+   glLineWidth(thread_param->width);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glLineWidth_thread_cmd(GLfloat width)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glLineWidth(width);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glLineWidth thread_param_local;
+   Thread_Command_glLineWidth *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glLineWidth *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glLineWidth));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->width = width;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glLineWidth,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPolygonOffset(GLfloat factor, GLfloat units);
+ */
+
+typedef struct
+{
+   GLfloat factor;
+   GLfloat units;
+   int command_allocated;
+
+} Thread_Command_glPolygonOffset;
+
+static void
+_gl_thread_glPolygonOffset(void *data)
+{
+   Thread_Command_glPolygonOffset *thread_param =
+      (Thread_Command_glPolygonOffset *)data;
+
+   glPolygonOffset(thread_param->factor,
+                   thread_param->units);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPolygonOffset_thread_cmd(GLfloat factor, GLfloat units)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glPolygonOffset(factor, units);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glPolygonOffset thread_param_local;
+   Thread_Command_glPolygonOffset *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glPolygonOffset *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glPolygonOffset));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->factor = factor;
+   thread_param->units = units;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glPolygonOffset,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glPixelStorei(GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} Thread_Command_glPixelStorei;
+
+static void
+_gl_thread_glPixelStorei(void *data)
+{
+   Thread_Command_glPixelStorei *thread_param =
+      (Thread_Command_glPixelStorei *)data;
+
+   glPixelStorei(thread_param->pname,
+                 thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glPixelStorei_thread_cmd(GLenum pname, GLint param)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glPixelStorei(pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glPixelStorei thread_param_local;
+   Thread_Command_glPixelStorei *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glPixelStorei *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glPixelStorei));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glPixelStorei,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glActiveTexture(GLenum texture);
+ */
+
+typedef struct
+{
+   GLenum texture;
+   int command_allocated;
+
+} Thread_Command_glActiveTexture;
+
+static void
+_gl_thread_glActiveTexture(void *data)
+{
+   Thread_Command_glActiveTexture *thread_param =
+      (Thread_Command_glActiveTexture *)data;
+
+   glActiveTexture(thread_param->texture);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glActiveTexture_thread_cmd(GLenum texture)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glActiveTexture(texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glActiveTexture thread_param_local;
+   Thread_Command_glActiveTexture *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glActiveTexture *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glActiveTexture));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glActiveTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenTextures(GLsizei n, GLuint *textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *textures;
+
+} Thread_Command_glGenTextures;
+
+static void
+_gl_thread_glGenTextures(void *data)
+{
+   Thread_Command_glGenTextures *thread_param =
+      (Thread_Command_glGenTextures *)data;
+
+   glGenTextures(thread_param->n,
+                 thread_param->textures);
+
+}
+
+EAPI void
+glGenTextures_thread_cmd(GLsizei n, GLuint *textures)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGenTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGenTextures thread_param_local;
+   Thread_Command_glGenTextures *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGenTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindTexture(GLenum target, GLuint texture);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint texture;
+   int command_allocated;
+
+} Thread_Command_glBindTexture;
+
+static void
+_gl_thread_glBindTexture(void *data)
+{
+   Thread_Command_glBindTexture *thread_param =
+      (Thread_Command_glBindTexture *)data;
+
+   glBindTexture(thread_param->target,
+                 thread_param->texture);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindTexture_thread_cmd(GLenum target, GLuint texture)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBindTexture(target, texture);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBindTexture thread_param_local;
+   Thread_Command_glBindTexture *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBindTexture *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBindTexture));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBindTexture,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteTextures(GLsizei n, const GLuint *textures);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *textures;
+   void *textures_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glDeleteTextures;
+
+static void
+_gl_thread_glDeleteTextures(void *data)
+{
+   Thread_Command_glDeleteTextures *thread_param =
+      (Thread_Command_glDeleteTextures *)data;
+
+   glDeleteTextures(thread_param->n,
+                    thread_param->textures);
+
+
+   if (thread_param->textures_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->textures_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteTextures_thread_cmd(GLsizei n, const GLuint *textures)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDeleteTextures(n, textures);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteTextures thread_param_local;
+   Thread_Command_glDeleteTextures *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteTextures *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteTextures));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->textures = textures;
+
+   thread_param->textures_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (textures)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->textures_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->textures_copied)
+          {
+             memcpy(thread_param->textures_copied, textures, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->textures = (const GLuint  *)thread_param->textures_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteTextures,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLenum format;
+   GLenum type;
+   const void *pixels;
+   int command_allocated;
+   GLTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} Thread_Command_glTexImage2D;
+
+static void
+_gl_thread_glTexImage2D(void *data)
+{
+   Thread_Command_glTexImage2D *thread_param =
+      (Thread_Command_glTexImage2D *)data;
+
+   glTexImage2D(thread_param->target,
+                thread_param->level,
+                thread_param->internalformat,
+                thread_param->width,
+                thread_param->height,
+                thread_param->border,
+                thread_param->format,
+                thread_param->type,
+                thread_param->pixels);
+
+   GLTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexImage2D_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexImage2D thread_param_local;
+   Thread_Command_glTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   const void *pixels;
+   int command_allocated;
+   GLTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} Thread_Command_glTexSubImage2D;
+
+static void
+_gl_thread_glTexSubImage2D(void *data)
+{
+   Thread_Command_glTexSubImage2D *thread_param =
+      (Thread_Command_glTexSubImage2D *)data;
+
+   glTexSubImage2D(thread_param->target,
+                   thread_param->level,
+                   thread_param->xoffset,
+                   thread_param->yoffset,
+                   thread_param->width,
+                   thread_param->height,
+                   thread_param->format,
+                   thread_param->type,
+                   thread_param->pixels);
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexSubImage2D_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexSubImage2D thread_param_local;
+   Thread_Command_glTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   GLTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   GLint border;
+   GLsizei imageSize;
+   const void *data;
+   int command_allocated;
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} Thread_Command_glCompressedTexImage2D;
+
+static void
+_gl_thread_glCompressedTexImage2D(void *data)
+{
+   Thread_Command_glCompressedTexImage2D *thread_param =
+      (Thread_Command_glCompressedTexImage2D *)data;
+
+   glCompressedTexImage2D(thread_param->target,
+                          thread_param->level,
+                          thread_param->internalformat,
+                          thread_param->width,
+                          thread_param->height,
+                          thread_param->border,
+                          thread_param->imageSize,
+                          thread_param->data);
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexImage2D_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCompressedTexImage2D thread_param_local;
+   Thread_Command_glCompressedTexImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glCompressedTexImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glCompressedTexImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->border = border;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCompressedTexImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLint xoffset;
+   GLint yoffset;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLsizei imageSize;
+   const void *data;
+   int command_allocated;
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE; /* TODO */
+
+} Thread_Command_glCompressedTexSubImage2D;
+
+static void
+_gl_thread_glCompressedTexSubImage2D(void *data)
+{
+   Thread_Command_glCompressedTexSubImage2D *thread_param =
+      (Thread_Command_glCompressedTexSubImage2D *)data;
+
+   glCompressedTexSubImage2D(thread_param->target,
+                             thread_param->level,
+                             thread_param->xoffset,
+                             thread_param->yoffset,
+                             thread_param->width,
+                             thread_param->height,
+                             thread_param->format,
+                             thread_param->imageSize,
+                             thread_param->data);
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_FREE; /* TODO */
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glCompressedTexSubImage2D_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCompressedTexSubImage2D thread_param_local;
+   Thread_Command_glCompressedTexSubImage2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glCompressedTexSubImage2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glCompressedTexSubImage2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->xoffset = xoffset;
+   thread_param->yoffset = yoffset;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->imageSize = imageSize;
+   thread_param->data = data;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_VARIABLE_INIT; /* TODO */
+
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   GLCOMPRESSEDTEXSUBIMAGE2D_COPY_TO_MEMPOOL; /* TODO */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCompressedTexSubImage2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterf(GLenum target, GLenum pname, GLfloat param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLfloat param;
+   int command_allocated;
+
+} Thread_Command_glTexParameterf;
+
+static void
+_gl_thread_glTexParameterf(void *data)
+{
+   Thread_Command_glTexParameterf *thread_param =
+      (Thread_Command_glTexParameterf *)data;
+
+   glTexParameterf(thread_param->target,
+                   thread_param->pname,
+                   thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterf_thread_cmd(GLenum target, GLenum pname, GLfloat param)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexParameterf(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexParameterf thread_param_local;
+   Thread_Command_glTexParameterf *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexParameterf *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexParameterf));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexParameterf,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLfloat *params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glTexParameterfv;
+
+static void
+_gl_thread_glTexParameterfv(void *data)
+{
+   Thread_Command_glTexParameterfv *thread_param =
+      (Thread_Command_glTexParameterfv *)data;
+
+   glTexParameterfv(thread_param->target,
+                    thread_param->pname,
+                    thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameterfv_thread_cmd(GLenum target, GLenum pname, const GLfloat *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexParameterfv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexParameterfv thread_param_local;
+   Thread_Command_glTexParameterfv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexParameterfv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexParameterfv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLfloat);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLfloat  *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexParameterfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteri(GLenum target, GLenum pname, GLint param);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint param;
+   int command_allocated;
+
+} Thread_Command_glTexParameteri;
+
+static void
+_gl_thread_glTexParameteri(void *data)
+{
+   Thread_Command_glTexParameteri *thread_param =
+      (Thread_Command_glTexParameteri *)data;
+
+   glTexParameteri(thread_param->target,
+                   thread_param->pname,
+                   thread_param->param);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteri_thread_cmd(GLenum target, GLenum pname, GLint param)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexParameteri(target, pname, param);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexParameteri thread_param_local;
+   Thread_Command_glTexParameteri *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexParameteri *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexParameteri));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->param = param;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexParameteri,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glTexParameteriv(GLenum target, GLenum pname, const GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   const GLint *params;
+   void *params_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glTexParameteriv;
+
+static void
+_gl_thread_glTexParameteriv(void *data)
+{
+   Thread_Command_glTexParameteriv *thread_param =
+      (Thread_Command_glTexParameteriv *)data;
+
+   glTexParameteriv(thread_param->target,
+                    thread_param->pname,
+                    thread_param->params);
+
+
+   if (thread_param->params_copied)
+     eina_mempool_free(_mp_default, thread_param->params_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glTexParameteriv_thread_cmd(GLenum target, GLenum pname, const GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glTexParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glTexParameteriv thread_param_local;
+   Thread_Command_glTexParameteriv *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glTexParameteriv *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glTexParameteriv));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   thread_param->params_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (params)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = sizeof(GLint);
+        if (copy_size > _mp_default_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->params_copied = eina_mempool_malloc(_mp_default, copy_size);
+        if (thread_param->params_copied)
+          {
+             memcpy(thread_param->params_copied, params, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->params = (const GLint  *)thread_param->params_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glTexParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} Thread_Command_glScissor;
+
+static void
+_gl_thread_glScissor(void *data)
+{
+   Thread_Command_glScissor *thread_param =
+      (Thread_Command_glScissor *)data;
+
+   glScissor(thread_param->x,
+             thread_param->y,
+             thread_param->width,
+             thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glScissor_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glScissor(x, y, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glScissor thread_param_local;
+   Thread_Command_glScissor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glScissor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glScissor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glScissor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendFunc(GLenum sfactor, GLenum dfactor);
+ */
+
+typedef struct
+{
+   GLenum sfactor;
+   GLenum dfactor;
+   int command_allocated;
+
+} Thread_Command_glBlendFunc;
+
+static void
+_gl_thread_glBlendFunc(void *data)
+{
+   Thread_Command_glBlendFunc *thread_param =
+      (Thread_Command_glBlendFunc *)data;
+
+   glBlendFunc(thread_param->sfactor,
+               thread_param->dfactor);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendFunc_thread_cmd(GLenum sfactor, GLenum dfactor)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBlendFunc(sfactor, dfactor);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBlendFunc thread_param_local;
+   Thread_Command_glBlendFunc *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBlendFunc *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBlendFunc));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->sfactor = sfactor;
+   thread_param->dfactor = dfactor;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBlendFunc,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+ */
+
+typedef struct
+{
+   GLfloat red;
+   GLfloat green;
+   GLfloat blue;
+   GLfloat alpha;
+   int command_allocated;
+
+} Thread_Command_glBlendColor;
+
+static void
+_gl_thread_glBlendColor(void *data)
+{
+   Thread_Command_glBlendColor *thread_param =
+      (Thread_Command_glBlendColor *)data;
+
+   glBlendColor(thread_param->red,
+                thread_param->green,
+                thread_param->blue,
+                thread_param->alpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBlendColor_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBlendColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBlendColor thread_param_local;
+   Thread_Command_glBlendColor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBlendColor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBlendColor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBlendColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDepthMask(GLboolean flag);
+ */
+
+typedef struct
+{
+   GLboolean flag;
+   int command_allocated;
+
+} Thread_Command_glDepthMask;
+
+static void
+_gl_thread_glDepthMask(void *data)
+{
+   Thread_Command_glDepthMask *thread_param =
+      (Thread_Command_glDepthMask *)data;
+
+   glDepthMask(thread_param->flag);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDepthMask_thread_cmd(GLboolean flag)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDepthMask(flag);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDepthMask thread_param_local;
+   Thread_Command_glDepthMask *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDepthMask *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDepthMask));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->flag = flag;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDepthMask,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClear(GLbitfield mask);
+ */
+
+typedef struct
+{
+   GLbitfield mask;
+   int command_allocated;
+
+} Thread_Command_glClear;
+
+static void
+_gl_thread_glClear(void *data)
+{
+   Thread_Command_glClear *thread_param =
+      (Thread_Command_glClear *)data;
+
+   glClear(thread_param->mask);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glClear_thread_cmd(GLbitfield mask)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glClear(mask);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glClear thread_param_local;
+   Thread_Command_glClear *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glClear *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glClear));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->mask = mask;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glClear,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+ */
+
+typedef struct
+{
+   GLfloat red;
+   GLfloat green;
+   GLfloat blue;
+   GLfloat alpha;
+   int command_allocated;
+
+} Thread_Command_glClearColor;
+
+static void
+_gl_thread_glClearColor(void *data)
+{
+   Thread_Command_glClearColor *thread_param =
+      (Thread_Command_glClearColor *)data;
+
+   glClearColor(thread_param->red,
+                thread_param->green,
+                thread_param->blue,
+                thread_param->alpha);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glClearColor_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glClearColor(red, green, blue, alpha);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glClearColor thread_param_local;
+   Thread_Command_glClearColor *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glClearColor *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glClearColor));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->red = red;
+   thread_param->green = green;
+   thread_param->blue = blue;
+   thread_param->alpha = alpha;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glClearColor,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+ */
+
+typedef struct
+{
+   GLint x;
+   GLint y;
+   GLsizei width;
+   GLsizei height;
+   GLenum format;
+   GLenum type;
+   void *pixels;
+
+} Thread_Command_glReadPixels;
+
+static void
+_gl_thread_glReadPixels(void *data)
+{
+   Thread_Command_glReadPixels *thread_param =
+      (Thread_Command_glReadPixels *)data;
+
+   glReadPixels(thread_param->x,
+                thread_param->y,
+                thread_param->width,
+                thread_param->height,
+                thread_param->format,
+                thread_param->type,
+                thread_param->pixels);
+
+}
+
+EAPI void
+glReadPixels_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glReadPixels(x, y, width, height, format, type, pixels);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glReadPixels thread_param_local;
+   Thread_Command_glReadPixels *thread_param = &thread_param_local;
+
+   thread_param->x = x;
+   thread_param->y = y;
+   thread_param->width = width;
+   thread_param->height = height;
+   thread_param->format = format;
+   thread_param->type = type;
+   thread_param->pixels = pixels;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glReadPixels,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenFramebuffers(GLsizei n, GLuint *framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *framebuffers;
+
+} Thread_Command_glGenFramebuffers;
+
+void (*orig_evas_glGenFramebuffers)(GLsizei n, GLuint *framebuffers);
+
+void
+glGenFramebuffers_orig_evas_set(void *func)
+{
+   orig_evas_glGenFramebuffers = func;
+}
+
+void *
+glGenFramebuffers_orig_evas_get(void)
+{
+   return orig_evas_glGenFramebuffers;
+}
+
+static void
+_gl_thread_glGenFramebuffers(void *data)
+{
+   Thread_Command_glGenFramebuffers *thread_param =
+      (Thread_Command_glGenFramebuffers *)data;
+
+   orig_evas_glGenFramebuffers(thread_param->n,
+                               thread_param->framebuffers);
+
+}
+
+EAPI void
+glGenFramebuffers_thread_cmd(GLsizei n, GLuint *framebuffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glGenFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGenFramebuffers thread_param_local;
+   Thread_Command_glGenFramebuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGenFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindFramebuffer(GLenum target, GLuint framebuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint framebuffer;
+   int command_allocated;
+
+} Thread_Command_glBindFramebuffer;
+
+void (*orig_evas_glBindFramebuffer)(GLenum target, GLuint framebuffer);
+
+void
+glBindFramebuffer_orig_evas_set(void *func)
+{
+   orig_evas_glBindFramebuffer = func;
+}
+
+void *
+glBindFramebuffer_orig_evas_get(void)
+{
+   return orig_evas_glBindFramebuffer;
+}
+
+static void
+_gl_thread_glBindFramebuffer(void *data)
+{
+   Thread_Command_glBindFramebuffer *thread_param =
+      (Thread_Command_glBindFramebuffer *)data;
+
+   orig_evas_glBindFramebuffer(thread_param->target,
+                               thread_param->framebuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindFramebuffer_thread_cmd(GLenum target, GLuint framebuffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glBindFramebuffer(target, framebuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBindFramebuffer thread_param_local;
+   Thread_Command_glBindFramebuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBindFramebuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBindFramebuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBindFramebuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *framebuffers;
+   void *framebuffers_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glDeleteFramebuffers;
+
+void (*orig_evas_glDeleteFramebuffers)(GLsizei n, const GLuint *framebuffers);
+
+void
+glDeleteFramebuffers_orig_evas_set(void *func)
+{
+   orig_evas_glDeleteFramebuffers = func;
+}
+
+void *
+glDeleteFramebuffers_orig_evas_get(void)
+{
+   return orig_evas_glDeleteFramebuffers;
+}
+
+static void
+_gl_thread_glDeleteFramebuffers(void *data)
+{
+   Thread_Command_glDeleteFramebuffers *thread_param =
+      (Thread_Command_glDeleteFramebuffers *)data;
+
+   orig_evas_glDeleteFramebuffers(thread_param->n,
+                                  thread_param->framebuffers);
+
+
+   if (thread_param->framebuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->framebuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteFramebuffers_thread_cmd(GLsizei n, const GLuint *framebuffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glDeleteFramebuffers(n, framebuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteFramebuffers thread_param_local;
+   Thread_Command_glDeleteFramebuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteFramebuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteFramebuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->framebuffers = framebuffers;
+
+   thread_param->framebuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (framebuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->framebuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->framebuffers_copied)
+          {
+             memcpy(thread_param->framebuffers_copied, framebuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->framebuffers = (const GLuint  *)thread_param->framebuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteFramebuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   GLuint *renderbuffers;
+
+} Thread_Command_glGenRenderbuffers;
+
+static void
+_gl_thread_glGenRenderbuffers(void *data)
+{
+   Thread_Command_glGenRenderbuffers *thread_param =
+      (Thread_Command_glGenRenderbuffers *)data;
+
+   glGenRenderbuffers(thread_param->n,
+                      thread_param->renderbuffers);
+
+}
+
+EAPI void
+glGenRenderbuffers_thread_cmd(GLsizei n, GLuint *renderbuffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGenRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGenRenderbuffers thread_param_local;
+   Thread_Command_glGenRenderbuffers *thread_param = &thread_param_local;
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGenRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glBindRenderbuffer(GLenum target, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} Thread_Command_glBindRenderbuffer;
+
+static void
+_gl_thread_glBindRenderbuffer(void *data)
+{
+   Thread_Command_glBindRenderbuffer *thread_param =
+      (Thread_Command_glBindRenderbuffer *)data;
+
+   glBindRenderbuffer(thread_param->target,
+                      thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glBindRenderbuffer_thread_cmd(GLenum target, GLuint renderbuffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glBindRenderbuffer(target, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glBindRenderbuffer thread_param_local;
+   Thread_Command_glBindRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glBindRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glBindRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glBindRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
+ */
+
+typedef struct
+{
+   GLsizei n;
+   const GLuint *renderbuffers;
+   void *renderbuffers_copied; /* COPIED */
+   int command_allocated;
+
+} Thread_Command_glDeleteRenderbuffers;
+
+static void
+_gl_thread_glDeleteRenderbuffers(void *data)
+{
+   Thread_Command_glDeleteRenderbuffers *thread_param =
+      (Thread_Command_glDeleteRenderbuffers *)data;
+
+   glDeleteRenderbuffers(thread_param->n,
+                         thread_param->renderbuffers);
+
+
+   if (thread_param->renderbuffers_copied)
+     eina_mempool_free(_mp_delete_object, thread_param->renderbuffers_copied);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glDeleteRenderbuffers_thread_cmd(GLsizei n, const GLuint *renderbuffers)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glDeleteRenderbuffers(n, renderbuffers);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glDeleteRenderbuffers thread_param_local;
+   Thread_Command_glDeleteRenderbuffers *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glDeleteRenderbuffers *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glDeleteRenderbuffers));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->n = n;
+   thread_param->renderbuffers = renderbuffers;
+
+   thread_param->renderbuffers_copied = NULL;
+   if (thread_mode == EVAS_GL_THREAD_MODE_FINISH)
+     goto finish;
+
+   /* copy variable */
+   if (renderbuffers)
+     {
+        /* 1. check memory size */
+        unsigned int copy_size = n * sizeof(GLuint);
+        if (copy_size > _mp_delete_object_memory_size)
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 2. malloc & copy */
+        thread_param->renderbuffers_copied = eina_mempool_malloc(_mp_delete_object, copy_size);
+        if (thread_param->renderbuffers_copied)
+          {
+             memcpy(thread_param->renderbuffers_copied, renderbuffers, copy_size);
+          }
+        else
+          {
+             thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+             goto finish;
+          }
+        /* 3. replace */
+        thread_param->renderbuffers = (const GLuint  *)thread_param->renderbuffers_copied;
+     }
+   /* end of copy variable */
+
+finish:
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glDeleteRenderbuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+   int command_allocated;
+
+} Thread_Command_glRenderbufferStorage;
+
+static void
+_gl_thread_glRenderbufferStorage(void *data)
+{
+   Thread_Command_glRenderbufferStorage *thread_param =
+      (Thread_Command_glRenderbufferStorage *)data;
+
+   glRenderbufferStorage(thread_param->target,
+                         thread_param->internalformat,
+                         thread_param->width,
+                         thread_param->height);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glRenderbufferStorage_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glRenderbufferStorage(target, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glRenderbufferStorage thread_param_local;
+   Thread_Command_glRenderbufferStorage *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glRenderbufferStorage *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glRenderbufferStorage));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glRenderbufferStorage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum renderbuffertarget;
+   GLuint renderbuffer;
+   int command_allocated;
+
+} Thread_Command_glFramebufferRenderbuffer;
+
+static void
+_gl_thread_glFramebufferRenderbuffer(void *data)
+{
+   Thread_Command_glFramebufferRenderbuffer *thread_param =
+      (Thread_Command_glFramebufferRenderbuffer *)data;
+
+   glFramebufferRenderbuffer(thread_param->target,
+                             thread_param->attachment,
+                             thread_param->renderbuffertarget,
+                             thread_param->renderbuffer);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferRenderbuffer_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glFramebufferRenderbuffer thread_param_local;
+   Thread_Command_glFramebufferRenderbuffer *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glFramebufferRenderbuffer *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glFramebufferRenderbuffer));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->renderbuffertarget = renderbuffertarget;
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glFramebufferRenderbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   int command_allocated;
+
+} Thread_Command_glFramebufferTexture2D;
+
+void (*orig_evas_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+void
+glFramebufferTexture2D_orig_evas_set(void *func)
+{
+   orig_evas_glFramebufferTexture2D = func;
+}
+
+void *
+glFramebufferTexture2D_orig_evas_get(void)
+{
+   return orig_evas_glFramebufferTexture2D;
+}
+
+static void
+_gl_thread_glFramebufferTexture2D(void *data)
+{
+   Thread_Command_glFramebufferTexture2D *thread_param =
+      (Thread_Command_glFramebufferTexture2D *)data;
+
+   orig_evas_glFramebufferTexture2D(thread_param->target,
+                                    thread_param->attachment,
+                                    thread_param->textarget,
+                                    thread_param->texture,
+                                    thread_param->level);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2D_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glFramebufferTexture2D thread_param_local;
+   Thread_Command_glFramebufferTexture2D *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glFramebufferTexture2D *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glFramebufferTexture2D));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glFramebufferTexture2D,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glFramebufferTexture2DMultisample(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum attachment;
+   GLenum textarget;
+   GLuint texture;
+   GLint level;
+   GLsizei samples;
+   int command_allocated;
+
+} Thread_Command_glFramebufferTexture2DMultisample;
+
+void (*orig_evas_glFramebufferTexture2DMultisample)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+
+void
+glFramebufferTexture2DMultisample_orig_evas_set(void *func)
+{
+   orig_evas_glFramebufferTexture2DMultisample = func;
+}
+
+void *
+glFramebufferTexture2DMultisample_orig_evas_get(void)
+{
+   return orig_evas_glFramebufferTexture2DMultisample;
+}
+
+static void
+_gl_thread_glFramebufferTexture2DMultisample(void *data)
+{
+   Thread_Command_glFramebufferTexture2DMultisample *thread_param =
+      (Thread_Command_glFramebufferTexture2DMultisample *)data;
+
+   orig_evas_glFramebufferTexture2DMultisample(thread_param->target,
+                                               thread_param->attachment,
+                                               thread_param->textarget,
+                                               thread_param->texture,
+                                               thread_param->level,
+                                               thread_param->samples);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glFramebufferTexture2DMultisample_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glFramebufferTexture2DMultisample(target, attachment, textarget, texture, level, samples);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glFramebufferTexture2DMultisample thread_param_local;
+   Thread_Command_glFramebufferTexture2DMultisample *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glFramebufferTexture2DMultisample *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glFramebufferTexture2DMultisample));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->attachment = attachment;
+   thread_param->textarget = textarget;
+   thread_param->texture = texture;
+   thread_param->level = level;
+   thread_param->samples = samples;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glFramebufferTexture2DMultisample,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLenum
+   glCheckFramebufferStatus(GLenum target);
+ */
+
+typedef struct
+{
+   GLenum return_value;
+   GLenum target;
+
+} Thread_Command_glCheckFramebufferStatus;
+
+static void
+_gl_thread_glCheckFramebufferStatus(void *data)
+{
+   Thread_Command_glCheckFramebufferStatus *thread_param =
+      (Thread_Command_glCheckFramebufferStatus *)data;
+
+   thread_param->return_value = glCheckFramebufferStatus(thread_param->target);
+
+}
+
+EAPI GLenum
+glCheckFramebufferStatus_thread_cmd(GLenum target)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glCheckFramebufferStatus(target);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glCheckFramebufferStatus thread_param_local;
+   Thread_Command_glCheckFramebufferStatus *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glCheckFramebufferStatus,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glFlush(void);
+ */
+
+static void
+_gl_thread_glFlush(void *data EINA_UNUSED)
+{
+   glFlush();
+
+}
+
+EAPI void
+glFlush_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glFlush();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glFlush,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glFinish(void);
+ */
+
+static void
+_gl_thread_glFinish(void *data EINA_UNUSED)
+{
+   glFinish();
+
+}
+
+EAPI void
+glFinish_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glFinish();
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glFinish,
+                              NULL,
+                              thread_mode);
+}
+
+/*
+   void
+   glHint(GLenum target, GLenum mode);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum mode;
+   int command_allocated;
+
+} Thread_Command_glHint;
+
+static void
+_gl_thread_glHint(void *data)
+{
+   Thread_Command_glHint *thread_param =
+      (Thread_Command_glHint *)data;
+
+   glHint(thread_param->target,
+          thread_param->mode);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glHint_thread_cmd(GLenum target, GLenum mode)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glHint(target, mode);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glHint thread_param_local;
+   Thread_Command_glHint *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glHint *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glHint));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->target = target;
+   thread_param->mode = mode;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glHint,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   const GLubyte *
+   glGetString(GLenum name);
+ */
+
+typedef struct
+{
+   const GLubyte * return_value;
+   GLenum name;
+
+} Thread_Command_glGetString;
+
+static void
+_gl_thread_glGetString(void *data)
+{
+   Thread_Command_glGetString *thread_param =
+      (Thread_Command_glGetString *)data;
+
+   thread_param->return_value = glGetString(thread_param->name);
+
+}
+
+EAPI const GLubyte *
+glGetString_thread_cmd(GLenum name)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glGetString(name);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetString thread_param_local;
+   Thread_Command_glGetString *thread_param = &thread_param_local;
+
+   thread_param->name = name;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetString,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBooleanv(GLenum pname, GLboolean *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLboolean *data;
+
+} Thread_Command_glGetBooleanv;
+
+static void
+_gl_thread_glGetBooleanv(void *data)
+{
+   Thread_Command_glGetBooleanv *thread_param =
+      (Thread_Command_glGetBooleanv *)data;
+
+   glGetBooleanv(thread_param->pname,
+                 thread_param->data);
+
+}
+
+EAPI void
+glGetBooleanv_thread_cmd(GLenum pname, GLboolean *data)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetBooleanv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetBooleanv thread_param_local;
+   Thread_Command_glGetBooleanv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetBooleanv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetFloatv(GLenum pname, GLfloat *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLfloat *data;
+
+} Thread_Command_glGetFloatv;
+
+static void
+_gl_thread_glGetFloatv(void *data)
+{
+   Thread_Command_glGetFloatv *thread_param =
+      (Thread_Command_glGetFloatv *)data;
+
+   glGetFloatv(thread_param->pname,
+               thread_param->data);
+
+}
+
+EAPI void
+glGetFloatv_thread_cmd(GLenum pname, GLfloat *data)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetFloatv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetFloatv thread_param_local;
+   Thread_Command_glGetFloatv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetFloatv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetIntegerv(GLenum pname, GLint *data);
+ */
+
+typedef struct
+{
+   GLenum pname;
+   GLint *data;
+
+} Thread_Command_glGetIntegerv;
+
+static void
+_gl_thread_glGetIntegerv(void *data)
+{
+   Thread_Command_glGetIntegerv *thread_param =
+      (Thread_Command_glGetIntegerv *)data;
+
+   glGetIntegerv(thread_param->pname,
+                 thread_param->data);
+
+}
+
+EAPI void
+glGetIntegerv_thread_cmd(GLenum pname, GLint *data)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetIntegerv(pname, data);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetIntegerv thread_param_local;
+   Thread_Command_glGetIntegerv *thread_param = &thread_param_local;
+
+   thread_param->pname = pname;
+   thread_param->data = data;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetIntegerv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsBuffer(GLint buffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint buffer;
+
+} Thread_Command_glIsBuffer;
+
+static void
+_gl_thread_glIsBuffer(void *data)
+{
+   Thread_Command_glIsBuffer *thread_param =
+      (Thread_Command_glIsBuffer *)data;
+
+   thread_param->return_value = glIsBuffer(thread_param->buffer);
+
+}
+
+EAPI GLboolean
+glIsBuffer_thread_cmd(GLint buffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsBuffer(buffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsBuffer thread_param_local;
+   Thread_Command_glIsBuffer *thread_param = &thread_param_local;
+
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsBuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetBufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetBufferParameteriv;
+
+static void
+_gl_thread_glGetBufferParameteriv(void *data)
+{
+   Thread_Command_glGetBufferParameteriv *thread_param =
+      (Thread_Command_glGetBufferParameteriv *)data;
+
+   glGetBufferParameteriv(thread_param->target,
+                          thread_param->pname,
+                          thread_param->params);
+
+}
+
+EAPI void
+glGetBufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetBufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetBufferParameteriv thread_param_local;
+   Thread_Command_glGetBufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetBufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsShader(GLuint shader);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint shader;
+
+} Thread_Command_glIsShader;
+
+static void
+_gl_thread_glIsShader(void *data)
+{
+   Thread_Command_glIsShader *thread_param =
+      (Thread_Command_glIsShader *)data;
+
+   thread_param->return_value = glIsShader(thread_param->shader);
+
+}
+
+EAPI GLboolean
+glIsShader_thread_cmd(GLuint shader)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsShader(shader);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsShader thread_param_local;
+   Thread_Command_glIsShader *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsShader,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetShaderiv(GLuint shader, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetShaderiv;
+
+static void
+_gl_thread_glGetShaderiv(void *data)
+{
+   Thread_Command_glGetShaderiv *thread_param =
+      (Thread_Command_glGetShaderiv *)data;
+
+   glGetShaderiv(thread_param->shader,
+                 thread_param->pname,
+                 thread_param->params);
+
+}
+
+EAPI void
+glGetShaderiv_thread_cmd(GLuint shader, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetShaderiv(shader, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetShaderiv thread_param_local;
+   Thread_Command_glGetShaderiv *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetShaderiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei maxCount;
+   GLsizei *count;
+   GLuint *shaders;
+
+} Thread_Command_glGetAttachedShaders;
+
+static void
+_gl_thread_glGetAttachedShaders(void *data)
+{
+   Thread_Command_glGetAttachedShaders *thread_param =
+      (Thread_Command_glGetAttachedShaders *)data;
+
+   glGetAttachedShaders(thread_param->program,
+                        thread_param->maxCount,
+                        thread_param->count,
+                        thread_param->shaders);
+
+}
+
+EAPI void
+glGetAttachedShaders_thread_cmd(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetAttachedShaders(program, maxCount, count, shaders);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetAttachedShaders thread_param_local;
+   Thread_Command_glGetAttachedShaders *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->maxCount = maxCount;
+   thread_param->count = count;
+   thread_param->shaders = shaders;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetAttachedShaders,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *infoLog;
+
+} Thread_Command_glGetShaderInfoLog;
+
+static void
+_gl_thread_glGetShaderInfoLog(void *data)
+{
+   Thread_Command_glGetShaderInfoLog *thread_param =
+      (Thread_Command_glGetShaderInfoLog *)data;
+
+   glGetShaderInfoLog(thread_param->shader,
+                      thread_param->bufSize,
+                      thread_param->length,
+                      thread_param->infoLog);
+
+}
+
+EAPI void
+glGetShaderInfoLog_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetShaderInfoLog(shader, bufSize, length, infoLog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetShaderInfoLog thread_param_local;
+   Thread_Command_glGetShaderInfoLog *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->infoLog = infoLog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetShaderInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+ */
+
+typedef struct
+{
+   GLuint shader;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *source;
+
+} Thread_Command_glGetShaderSource;
+
+static void
+_gl_thread_glGetShaderSource(void *data)
+{
+   Thread_Command_glGetShaderSource *thread_param =
+      (Thread_Command_glGetShaderSource *)data;
+
+   glGetShaderSource(thread_param->shader,
+                     thread_param->bufSize,
+                     thread_param->length,
+                     thread_param->source);
+
+}
+
+EAPI void
+glGetShaderSource_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetShaderSource(shader, bufSize, length, source);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetShaderSource thread_param_local;
+   Thread_Command_glGetShaderSource *thread_param = &thread_param_local;
+
+   thread_param->shader = shader;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->source = source;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetShaderSource,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+ */
+
+typedef struct
+{
+   GLenum shadertype;
+   GLenum precisiontype;
+   GLint *range;
+   GLint *precision;
+
+} Thread_Command_glGetShaderPrecisionFormat;
+
+static void
+_gl_thread_glGetShaderPrecisionFormat(void *data)
+{
+   Thread_Command_glGetShaderPrecisionFormat *thread_param =
+      (Thread_Command_glGetShaderPrecisionFormat *)data;
+
+   glGetShaderPrecisionFormat(thread_param->shadertype,
+                              thread_param->precisiontype,
+                              thread_param->range,
+                              thread_param->precision);
+
+}
+
+EAPI void
+glGetShaderPrecisionFormat_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetShaderPrecisionFormat thread_param_local;
+   Thread_Command_glGetShaderPrecisionFormat *thread_param = &thread_param_local;
+
+   thread_param->shadertype = shadertype;
+   thread_param->precisiontype = precisiontype;
+   thread_param->range = range;
+   thread_param->precision = precision;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetShaderPrecisionFormat,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLfloat *params;
+
+} Thread_Command_glGetVertexAttribfv;
+
+static void
+_gl_thread_glGetVertexAttribfv(void *data)
+{
+   Thread_Command_glGetVertexAttribfv *thread_param =
+      (Thread_Command_glGetVertexAttribfv *)data;
+
+   glGetVertexAttribfv(thread_param->index,
+                       thread_param->pname,
+                       thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribfv_thread_cmd(GLuint index, GLenum pname, GLfloat *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetVertexAttribfv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetVertexAttribfv thread_param_local;
+   Thread_Command_glGetVertexAttribfv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetVertexAttribfv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetVertexAttribiv(GLuint index, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint index;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetVertexAttribiv;
+
+static void
+_gl_thread_glGetVertexAttribiv(void *data)
+{
+   Thread_Command_glGetVertexAttribiv *thread_param =
+      (Thread_Command_glGetVertexAttribiv *)data;
+
+   glGetVertexAttribiv(thread_param->index,
+                       thread_param->pname,
+                       thread_param->params);
+
+}
+
+EAPI void
+glGetVertexAttribiv_thread_cmd(GLuint index, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetVertexAttribiv(index, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetVertexAttribiv thread_param_local;
+   Thread_Command_glGetVertexAttribiv *thread_param = &thread_param_local;
+
+   thread_param->index = index;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetVertexAttribiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsProgram(GLuint program);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLuint program;
+
+} Thread_Command_glIsProgram;
+
+static void
+_gl_thread_glIsProgram(void *data)
+{
+   Thread_Command_glIsProgram *thread_param =
+      (Thread_Command_glIsProgram *)data;
+
+   thread_param->return_value = glIsProgram(thread_param->program);
+
+}
+
+EAPI GLboolean
+glIsProgram_thread_cmd(GLuint program)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsProgram(program);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsProgram thread_param_local;
+   Thread_Command_glIsProgram *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsProgram,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLsizei bufSize;
+   GLsizei *length;
+   GLchar *infoLog;
+
+} Thread_Command_glGetProgramInfoLog;
+
+static void
+_gl_thread_glGetProgramInfoLog(void *data)
+{
+   Thread_Command_glGetProgramInfoLog *thread_param =
+      (Thread_Command_glGetProgramInfoLog *)data;
+
+   glGetProgramInfoLog(thread_param->program,
+                       thread_param->bufSize,
+                       thread_param->length,
+                       thread_param->infoLog);
+
+}
+
+EAPI void
+glGetProgramInfoLog_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetProgramInfoLog(program, bufSize, length, infoLog);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetProgramInfoLog thread_param_local;
+   Thread_Command_glGetProgramInfoLog *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->bufSize = bufSize;
+   thread_param->length = length;
+   thread_param->infoLog = infoLog;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetProgramInfoLog,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glGetProgramiv(GLuint program, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLuint program;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetProgramiv;
+
+static void
+_gl_thread_glGetProgramiv(void *data)
+{
+   Thread_Command_glGetProgramiv *thread_param =
+      (Thread_Command_glGetProgramiv *)data;
+
+   glGetProgramiv(thread_param->program,
+                  thread_param->pname,
+                  thread_param->params);
+
+}
+
+EAPI void
+glGetProgramiv_thread_cmd(GLuint program, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetProgramiv(program, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetProgramiv thread_param_local;
+   Thread_Command_glGetProgramiv *thread_param = &thread_param_local;
+
+   thread_param->program = program;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetProgramiv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsFramebuffer(GLint framebuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint framebuffer;
+
+} Thread_Command_glIsFramebuffer;
+
+static void
+_gl_thread_glIsFramebuffer(void *data)
+{
+   Thread_Command_glIsFramebuffer *thread_param =
+      (Thread_Command_glIsFramebuffer *)data;
+
+   thread_param->return_value = glIsFramebuffer(thread_param->framebuffer);
+
+}
+
+EAPI GLboolean
+glIsFramebuffer_thread_cmd(GLint framebuffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsFramebuffer(framebuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsFramebuffer thread_param_local;
+   Thread_Command_glIsFramebuffer *thread_param = &thread_param_local;
+
+   thread_param->framebuffer = framebuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsFramebuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetFramebufferParameteriv;
+
+void (*orig_evas_glGetFramebufferParameteriv)(GLenum target, GLenum pname, GLint *params);
+
+void
+glGetFramebufferParameteriv_orig_evas_set(void *func)
+{
+   orig_evas_glGetFramebufferParameteriv = func;
+}
+
+void *
+glGetFramebufferParameteriv_orig_evas_get(void)
+{
+   return orig_evas_glGetFramebufferParameteriv;
+}
+
+static void
+_gl_thread_glGetFramebufferParameteriv(void *data)
+{
+   Thread_Command_glGetFramebufferParameteriv *thread_param =
+      (Thread_Command_glGetFramebufferParameteriv *)data;
+
+   orig_evas_glGetFramebufferParameteriv(thread_param->target,
+                                         thread_param->pname,
+                                         thread_param->params);
+
+}
+
+EAPI void
+glGetFramebufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glGetFramebufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetFramebufferParameteriv thread_param_local;
+   Thread_Command_glGetFramebufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetFramebufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsRenderbuffer(GLint renderbuffer);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint renderbuffer;
+
+} Thread_Command_glIsRenderbuffer;
+
+static void
+_gl_thread_glIsRenderbuffer(void *data)
+{
+   Thread_Command_glIsRenderbuffer *thread_param =
+      (Thread_Command_glIsRenderbuffer *)data;
+
+   thread_param->return_value = glIsRenderbuffer(thread_param->renderbuffer);
+
+}
+
+EAPI GLboolean
+glIsRenderbuffer_thread_cmd(GLint renderbuffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsRenderbuffer(renderbuffer);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsRenderbuffer thread_param_local;
+   Thread_Command_glIsRenderbuffer *thread_param = &thread_param_local;
+
+   thread_param->renderbuffer = renderbuffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsRenderbuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetRenderbufferParameteriv;
+
+static void
+_gl_thread_glGetRenderbufferParameteriv(void *data)
+{
+   Thread_Command_glGetRenderbufferParameteriv *thread_param =
+      (Thread_Command_glGetRenderbufferParameteriv *)data;
+
+   glGetRenderbufferParameteriv(thread_param->target,
+                                thread_param->pname,
+                                thread_param->params);
+
+}
+
+EAPI void
+glGetRenderbufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetRenderbufferParameteriv(target, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetRenderbufferParameteriv thread_param_local;
+   Thread_Command_glGetRenderbufferParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetRenderbufferParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLboolean
+   glIsTexture(GLint texture);
+ */
+
+typedef struct
+{
+   GLboolean return_value;
+   GLint texture;
+
+} Thread_Command_glIsTexture;
+
+static void
+_gl_thread_glIsTexture(void *data)
+{
+   Thread_Command_glIsTexture *thread_param =
+      (Thread_Command_glIsTexture *)data;
+
+   thread_param->return_value = glIsTexture(thread_param->texture);
+
+}
+
+EAPI GLboolean
+glIsTexture_thread_cmd(GLint texture)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glIsTexture(texture);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glIsTexture thread_param_local;
+   Thread_Command_glIsTexture *thread_param = &thread_param_local;
+
+   thread_param->texture = texture;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glIsTexture,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glStartTiling(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+ */
+
+typedef struct
+{
+   GLuint a;
+   GLuint b;
+   GLuint c;
+   GLuint d;
+   GLuint e;
+   int command_allocated;
+
+} Thread_Command_glStartTiling;
+
+void (*orig_evas_glStartTiling)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+
+void
+glStartTiling_orig_evas_set(void *func)
+{
+   orig_evas_glStartTiling = func;
+}
+
+void *
+glStartTiling_orig_evas_get(void)
+{
+   return orig_evas_glStartTiling;
+}
+
+static void
+_gl_thread_glStartTiling(void *data)
+{
+   Thread_Command_glStartTiling *thread_param =
+      (Thread_Command_glStartTiling *)data;
+
+   orig_evas_glStartTiling(thread_param->a,
+                           thread_param->b,
+                           thread_param->c,
+                           thread_param->d,
+                           thread_param->e);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glStartTiling_thread_cmd(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glStartTiling(a, b, c, d, e);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glStartTiling thread_param_local;
+   Thread_Command_glStartTiling *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glStartTiling *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glStartTiling));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glStartTiling,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEndTiling(GLuint a);
+ */
+
+typedef struct
+{
+   GLuint a;
+   int command_allocated;
+
+} Thread_Command_glEndTiling;
+
+void (*orig_evas_glEndTiling)(GLuint a);
+
+void
+glEndTiling_orig_evas_set(void *func)
+{
+   orig_evas_glEndTiling = func;
+}
+
+void *
+glEndTiling_orig_evas_get(void)
+{
+   return orig_evas_glEndTiling;
+}
+
+static void
+_gl_thread_glEndTiling(void *data)
+{
+   Thread_Command_glEndTiling *thread_param =
+      (Thread_Command_glEndTiling *)data;
+
+   orig_evas_glEndTiling(thread_param->a);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glEndTiling_thread_cmd(GLuint a)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glEndTiling(a);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glEndTiling thread_param_local;
+   Thread_Command_glEndTiling *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glEndTiling *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glEndTiling));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glEndTiling,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glActivateTile(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+ */
+
+typedef struct
+{
+   GLuint a;
+   GLuint b;
+   GLuint c;
+   GLuint d;
+   GLuint e;
+   int command_allocated;
+
+} Thread_Command_glActivateTile;
+
+void (*orig_evas_glActivateTile)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+
+void
+glActivateTile_orig_evas_set(void *func)
+{
+   orig_evas_glActivateTile = func;
+}
+
+void *
+glActivateTile_orig_evas_get(void)
+{
+   return orig_evas_glActivateTile;
+}
+
+static void
+_gl_thread_glActivateTile(void *data)
+{
+   Thread_Command_glActivateTile *thread_param =
+      (Thread_Command_glActivateTile *)data;
+
+   orig_evas_glActivateTile(thread_param->a,
+                            thread_param->b,
+                            thread_param->c,
+                            thread_param->d,
+                            thread_param->e);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glActivateTile_thread_cmd(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glActivateTile(a, b, c, d, e);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glActivateTile thread_param_local;
+   Thread_Command_glActivateTile *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glActivateTile *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glActivateTile));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->a = a;
+   thread_param->b = b;
+   thread_param->c = c;
+   thread_param->d = d;
+   thread_param->e = e;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glActivateTile,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glEGLImageTargetTexture2DOES(GLenum target, void *image);
+ */
+
+typedef struct
+{
+   GLenum target;
+   void *image;
+
+} Thread_Command_glEGLImageTargetTexture2DOES;
+
+void (*orig_evas_glEGLImageTargetTexture2DOES)(GLenum target, void *image);
+
+void
+glEGLImageTargetTexture2DOES_orig_evas_set(void *func)
+{
+   orig_evas_glEGLImageTargetTexture2DOES = func;
+}
+
+void *
+glEGLImageTargetTexture2DOES_orig_evas_get(void)
+{
+   return orig_evas_glEGLImageTargetTexture2DOES;
+}
+
+static void
+_gl_thread_glEGLImageTargetTexture2DOES(void *data)
+{
+   Thread_Command_glEGLImageTargetTexture2DOES *thread_param =
+      (Thread_Command_glEGLImageTargetTexture2DOES *)data;
+
+   orig_evas_glEGLImageTargetTexture2DOES(thread_param->target,
+                                          thread_param->image);
+
+}
+
+EAPI void
+glEGLImageTargetTexture2DOES_thread_cmd(GLenum target, void *image)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glEGLImageTargetTexture2DOES(target, image);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glEGLImageTargetTexture2DOES thread_param_local;
+   Thread_Command_glEGLImageTargetTexture2DOES *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->image = image;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glEGLImageTargetTexture2DOES,
+                              thread_param,
+                              thread_mode);
+}
+
+#ifndef GL_GLES
+
+/*
+   void
+   glAlphaFunc(GLenum func, GLclampf ref);
+ */
+
+typedef struct
+{
+   GLenum func;
+   GLclampf ref;
+   int command_allocated;
+
+} Thread_Command_glAlphaFunc;
+
+static void
+_gl_thread_glAlphaFunc(void *data)
+{
+   Thread_Command_glAlphaFunc *thread_param =
+      (Thread_Command_glAlphaFunc *)data;
+
+   glAlphaFunc(thread_param->func,
+               thread_param->ref);
+
+   if (thread_param->command_allocated)
+     eina_mempool_free(_mp_command, thread_param);
+}
+
+EAPI void
+glAlphaFunc_thread_cmd(GLenum func, GLclampf ref)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glAlphaFunc(func, ref);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glAlphaFunc thread_param_local;
+   Thread_Command_glAlphaFunc *thread_param = &thread_param_local;
+
+   /* command_allocated flag init. */
+   thread_param->command_allocated = 0;
+
+   if (!evas_gl_thread_force_finish())
+     { /* _flush */
+        Thread_Command_glAlphaFunc *thread_param_new;
+        thread_param_new = eina_mempool_malloc(_mp_command,
+                                               sizeof(Thread_Command_glAlphaFunc));
+        if (thread_param_new)
+          {
+             thread_param = thread_param_new;
+             thread_param->command_allocated = 1;
+             thread_mode = EVAS_GL_THREAD_MODE_FLUSH;
+          }
+     }
+
+   thread_param->func = func;
+   thread_param->ref = ref;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glAlphaFunc,
+                              thread_param,
+                              thread_mode);
+}
+#endif
+
+#ifndef GL_GLES
+
+/*
+   void
+   glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLint level;
+   GLenum pname;
+   GLint *params;
+
+} Thread_Command_glGetTexLevelParameteriv;
+
+static void
+_gl_thread_glGetTexLevelParameteriv(void *data)
+{
+   Thread_Command_glGetTexLevelParameteriv *thread_param =
+      (Thread_Command_glGetTexLevelParameteriv *)data;
+
+   glGetTexLevelParameteriv(thread_param->target,
+                            thread_param->level,
+                            thread_param->pname,
+                            thread_param->params);
+
+}
+
+EAPI void
+glGetTexLevelParameteriv_thread_cmd(GLenum target, GLint level, GLenum pname, GLint *params)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glGetTexLevelParameteriv(target, level, pname, params);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetTexLevelParameteriv thread_param_local;
+   Thread_Command_glGetTexLevelParameteriv *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->level = level;
+   thread_param->pname = pname;
+   thread_param->params = params;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetTexLevelParameteriv,
+                              thread_param,
+                              thread_mode);
+}
+#endif
+
+#ifndef GL_GLES
+
+/*
+   void
+   glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ */
+
+typedef struct
+{
+   GLenum target;
+   GLsizei samples;
+   GLenum internalformat;
+   GLsizei width;
+   GLsizei height;
+
+} Thread_Command_glRenderbufferStorageMultisample;
+
+void (*orig_evas_glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+void
+glRenderbufferStorageMultisample_orig_evas_set(void *func)
+{
+   orig_evas_glRenderbufferStorageMultisample = func;
+}
+
+void *
+glRenderbufferStorageMultisample_orig_evas_get(void)
+{
+   return orig_evas_glRenderbufferStorageMultisample;
+}
+
+static void
+_gl_thread_glRenderbufferStorageMultisample(void *data)
+{
+   Thread_Command_glRenderbufferStorageMultisample *thread_param =
+      (Thread_Command_glRenderbufferStorageMultisample *)data;
+
+   orig_evas_glRenderbufferStorageMultisample(thread_param->target,
+                                              thread_param->samples,
+                                              thread_param->internalformat,
+                                              thread_param->width,
+                                              thread_param->height);
+
+}
+
+EAPI void
+glRenderbufferStorageMultisample_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glRenderbufferStorageMultisample thread_param_local;
+   Thread_Command_glRenderbufferStorageMultisample *thread_param = &thread_param_local;
+
+   thread_param->target = target;
+   thread_param->samples = samples;
+   thread_param->internalformat = internalformat;
+   thread_param->width = width;
+   thread_param->height = height;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glRenderbufferStorageMultisample,
+                              thread_param,
+                              thread_mode);
+}
+#endif
+
+/*
+   const GLubyte *
+   glGetStringi(GLenum name, GLuint index);
+ */
+
+typedef struct
+{
+   const GLubyte * return_value;
+   GLenum name;
+   GLuint index;
+
+} Thread_Command_glGetStringi;
+
+const GLubyte * (*orig_evas_glGetStringi)(GLenum name, GLuint index);
+
+void
+glGetStringi_orig_evas_set(void *func)
+{
+   orig_evas_glGetStringi = func;
+}
+
+void *
+glGetStringi_orig_evas_get(void)
+{
+   return orig_evas_glGetStringi;
+}
+
+static void
+_gl_thread_glGetStringi(void *data)
+{
+   Thread_Command_glGetStringi *thread_param =
+      (Thread_Command_glGetStringi *)data;
+
+   thread_param->return_value = orig_evas_glGetStringi(thread_param->name,
+                                                       thread_param->index);
+
+}
+
+EAPI const GLubyte *
+glGetStringi_thread_cmd(GLenum name, GLuint index)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glGetStringi(name, index);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glGetStringi thread_param_local;
+   Thread_Command_glGetStringi *thread_param = &thread_param_local;
+
+   thread_param->name = name;
+   thread_param->index = index;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glGetStringi,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.h b/src/modules/evas/engines/gl_common/evas_gl_thread_gl_generated.h
new file mode 100644 (file)
index 0000000..ad6eac2
--- /dev/null
@@ -0,0 +1,187 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+
+EAPI GLenum glGetError_thread_cmd(void);
+EAPI void glVertexAttribPointer_thread_cmd(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+EAPI void glEnableVertexAttribArray_thread_cmd(GLuint index);
+EAPI void glDisableVertexAttribArray_thread_cmd(GLuint index);
+EAPI void glDrawArrays_thread_cmd(GLenum mode, GLint first, GLsizei count);
+EAPI void glDrawElements_thread_cmd(GLenum mode, GLsizei count, GLenum type, const void *indices);
+EAPI void glGenBuffers_thread_cmd(GLsizei n, GLuint *buffers);
+EAPI void glDeleteBuffers_thread_cmd(GLsizei n, const GLuint *buffers);
+EAPI void glBindBuffer_thread_cmd(GLenum target, GLuint buffer);
+EAPI void glBufferData_thread_cmd(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+
+EAPI void glMapBuffer_orig_evas_set(void *func);
+EAPI void *glMapBuffer_orig_evas_get(void);
+EAPI void * glMapBuffer_thread_cmd(GLenum target, GLenum access);
+
+EAPI void glUnmapBuffer_orig_evas_set(void *func);
+EAPI void *glUnmapBuffer_orig_evas_get(void);
+EAPI GLboolean glUnmapBuffer_thread_cmd(GLenum target);
+EAPI GLuint glCreateShader_thread_cmd(GLenum type);
+EAPI void glShaderSource_thread_cmd(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+EAPI void glCompileShader_thread_cmd(GLuint shader);
+
+EAPI void glReleaseShaderCompiler_orig_evas_set(void *func);
+EAPI void *glReleaseShaderCompiler_orig_evas_get(void);
+EAPI void glReleaseShaderCompiler_thread_cmd(void);
+EAPI void glDeleteShader_thread_cmd(GLuint shader);
+EAPI GLuint glCreateProgram_thread_cmd(void);
+EAPI void glAttachShader_thread_cmd(GLuint program, GLuint shader);
+EAPI void glDetachShader_thread_cmd(GLuint program, GLuint shader);
+EAPI void glLinkProgram_thread_cmd(GLuint program);
+EAPI void glUseProgram_thread_cmd(GLuint program);
+
+EAPI void glProgramParameteri_orig_evas_set(void *func);
+EAPI void *glProgramParameteri_orig_evas_get(void);
+EAPI void glProgramParameteri_thread_cmd(GLuint program, GLenum pname, GLint value);
+EAPI void glDeleteProgram_thread_cmd(GLuint program);
+
+EAPI void glGetProgramBinary_orig_evas_set(void *func);
+EAPI void *glGetProgramBinary_orig_evas_get(void);
+EAPI void glGetProgramBinary_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+
+EAPI void glProgramBinary_orig_evas_set(void *func);
+EAPI void *glProgramBinary_orig_evas_get(void);
+EAPI void glProgramBinary_thread_cmd(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+EAPI void glGetActiveAttrib_thread_cmd(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+EAPI GLint glGetAttribLocation_thread_cmd(GLuint program, const GLchar *name);
+EAPI void glBindAttribLocation_thread_cmd(GLuint program, GLuint index, const GLchar *name);
+EAPI GLint glGetUniformLocation_thread_cmd(GLuint program, const GLchar *name);
+EAPI void glUniform1f_thread_cmd(GLint location, GLfloat v0);
+EAPI void glUniform1i_thread_cmd(GLint location, GLint v0);
+EAPI void glUniform2f_thread_cmd(GLint location, GLfloat v0, GLfloat v1);
+EAPI void glUniform2i_thread_cmd(GLint location, GLint v0, GLint v1);
+EAPI void glUniform3f_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+EAPI void glUniform3i_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2);
+EAPI void glUniform4f_thread_cmd(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+EAPI void glUniform4i_thread_cmd(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+EAPI void glUniform1fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform1iv_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform2fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform2iv_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform3fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform3iv_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniform4fv_thread_cmd(GLint location, GLsizei count, const GLfloat *value);
+EAPI void glUniform4iv_thread_cmd(GLint location, GLsizei count, const GLint *value);
+EAPI void glUniformMatrix2fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix3fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glUniformMatrix4fv_thread_cmd(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+EAPI void glViewport_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glEnable_thread_cmd(GLenum cap);
+EAPI void glDisable_thread_cmd(GLenum cap);
+EAPI void glLineWidth_thread_cmd(GLfloat width);
+EAPI void glPolygonOffset_thread_cmd(GLfloat factor, GLfloat units);
+EAPI void glPixelStorei_thread_cmd(GLenum pname, GLint param);
+EAPI void glActiveTexture_thread_cmd(GLenum texture);
+EAPI void glGenTextures_thread_cmd(GLsizei n, GLuint *textures);
+EAPI void glBindTexture_thread_cmd(GLenum target, GLuint texture);
+EAPI void glDeleteTextures_thread_cmd(GLsizei n, const GLuint *textures);
+EAPI void glTexImage2D_thread_cmd(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+EAPI void glTexSubImage2D_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+EAPI void glCompressedTexImage2D_thread_cmd(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+EAPI void glCompressedTexSubImage2D_thread_cmd(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+EAPI void glTexParameterf_thread_cmd(GLenum target, GLenum pname, GLfloat param);
+EAPI void glTexParameterfv_thread_cmd(GLenum target, GLenum pname, const GLfloat *params);
+EAPI void glTexParameteri_thread_cmd(GLenum target, GLenum pname, GLint param);
+EAPI void glTexParameteriv_thread_cmd(GLenum target, GLenum pname, const GLint *params);
+EAPI void glScissor_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height);
+EAPI void glBlendFunc_thread_cmd(GLenum sfactor, GLenum dfactor);
+EAPI void glBlendColor_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+EAPI void glDepthMask_thread_cmd(GLboolean flag);
+EAPI void glClear_thread_cmd(GLbitfield mask);
+EAPI void glClearColor_thread_cmd(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+EAPI void glReadPixels_thread_cmd(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+
+EAPI void glGenFramebuffers_orig_evas_set(void *func);
+EAPI void *glGenFramebuffers_orig_evas_get(void);
+EAPI void glGenFramebuffers_thread_cmd(GLsizei n, GLuint *framebuffers);
+
+EAPI void glBindFramebuffer_orig_evas_set(void *func);
+EAPI void *glBindFramebuffer_orig_evas_get(void);
+EAPI void glBindFramebuffer_thread_cmd(GLenum target, GLuint framebuffer);
+
+EAPI void glDeleteFramebuffers_orig_evas_set(void *func);
+EAPI void *glDeleteFramebuffers_orig_evas_get(void);
+EAPI void glDeleteFramebuffers_thread_cmd(GLsizei n, const GLuint *framebuffers);
+EAPI void glGenRenderbuffers_thread_cmd(GLsizei n, GLuint *renderbuffers);
+EAPI void glBindRenderbuffer_thread_cmd(GLenum target, GLuint renderbuffer);
+EAPI void glDeleteRenderbuffers_thread_cmd(GLsizei n, const GLuint *renderbuffers);
+EAPI void glRenderbufferStorage_thread_cmd(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+EAPI void glFramebufferRenderbuffer_thread_cmd(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+
+EAPI void glFramebufferTexture2D_orig_evas_set(void *func);
+EAPI void *glFramebufferTexture2D_orig_evas_get(void);
+EAPI void glFramebufferTexture2D_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+
+EAPI void glFramebufferTexture2DMultisample_orig_evas_set(void *func);
+EAPI void *glFramebufferTexture2DMultisample_orig_evas_get(void);
+EAPI void glFramebufferTexture2DMultisample_thread_cmd(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+EAPI GLenum glCheckFramebufferStatus_thread_cmd(GLenum target);
+EAPI void glFlush_thread_cmd(void);
+EAPI void glFinish_thread_cmd(void);
+EAPI void glHint_thread_cmd(GLenum target, GLenum mode);
+EAPI const GLubyte * glGetString_thread_cmd(GLenum name);
+EAPI void glGetBooleanv_thread_cmd(GLenum pname, GLboolean *data);
+EAPI void glGetFloatv_thread_cmd(GLenum pname, GLfloat *data);
+EAPI void glGetIntegerv_thread_cmd(GLenum pname, GLint *data);
+EAPI GLboolean glIsBuffer_thread_cmd(GLint buffer);
+EAPI void glGetBufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params);
+EAPI GLboolean glIsShader_thread_cmd(GLuint shader);
+EAPI void glGetShaderiv_thread_cmd(GLuint shader, GLenum pname, GLint *params);
+EAPI void glGetAttachedShaders_thread_cmd(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+EAPI void glGetShaderInfoLog_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+EAPI void glGetShaderSource_thread_cmd(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+EAPI void glGetShaderPrecisionFormat_thread_cmd(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+EAPI void glGetVertexAttribfv_thread_cmd(GLuint index, GLenum pname, GLfloat *params);
+EAPI void glGetVertexAttribiv_thread_cmd(GLuint index, GLenum pname, GLint *params);
+EAPI GLboolean glIsProgram_thread_cmd(GLuint program);
+EAPI void glGetProgramInfoLog_thread_cmd(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+EAPI void glGetProgramiv_thread_cmd(GLuint program, GLenum pname, GLint *params);
+EAPI GLboolean glIsFramebuffer_thread_cmd(GLint framebuffer);
+
+EAPI void glGetFramebufferParameteriv_orig_evas_set(void *func);
+EAPI void *glGetFramebufferParameteriv_orig_evas_get(void);
+EAPI void glGetFramebufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params);
+EAPI GLboolean glIsRenderbuffer_thread_cmd(GLint renderbuffer);
+EAPI void glGetRenderbufferParameteriv_thread_cmd(GLenum target, GLenum pname, GLint *params);
+EAPI GLboolean glIsTexture_thread_cmd(GLint texture);
+
+EAPI void glStartTiling_orig_evas_set(void *func);
+EAPI void *glStartTiling_orig_evas_get(void);
+EAPI void glStartTiling_thread_cmd(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+
+EAPI void glEndTiling_orig_evas_set(void *func);
+EAPI void *glEndTiling_orig_evas_get(void);
+EAPI void glEndTiling_thread_cmd(GLuint a);
+
+EAPI void glActivateTile_orig_evas_set(void *func);
+EAPI void *glActivateTile_orig_evas_get(void);
+EAPI void glActivateTile_thread_cmd(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+
+EAPI void glEGLImageTargetTexture2DOES_orig_evas_set(void *func);
+EAPI void *glEGLImageTargetTexture2DOES_orig_evas_get(void);
+EAPI void glEGLImageTargetTexture2DOES_thread_cmd(GLenum target, void *image);
+#ifndef GL_GLES
+
+EAPI void glAlphaFunc_thread_cmd(GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_GLES
+
+EAPI void glGetTexLevelParameteriv_thread_cmd(GLenum target, GLint level, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_GLES
+
+
+EAPI void glRenderbufferStorageMultisample_orig_evas_set(void *func);
+EAPI void *glRenderbufferStorageMultisample_orig_evas_get(void);
+EAPI void glRenderbufferStorageMultisample_thread_cmd(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+
+EAPI void glGetStringi_orig_evas_set(void *func);
+EAPI void *glGetStringi_orig_evas_get(void);
+EAPI const GLubyte * glGetStringi_thread_cmd(GLenum name, GLuint index);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.c b/src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.c
new file mode 100644 (file)
index 0000000..76a5bbc
--- /dev/null
@@ -0,0 +1,340 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+GLenum (*glGetError_thread_cmd)(void) = NULL;
+void (*glVertexAttribPointer_thread_cmd)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer) = NULL;
+void (*glEnableVertexAttribArray_thread_cmd)(GLuint index) = NULL;
+void (*glDisableVertexAttribArray_thread_cmd)(GLuint index) = NULL;
+void (*glDrawArrays_thread_cmd)(GLenum mode, GLint first, GLsizei count) = NULL;
+void (*glDrawElements_thread_cmd)(GLenum mode, GLsizei count, GLenum type, const void *indices) = NULL;
+void (*glGenBuffers_thread_cmd)(GLsizei n, GLuint *buffers) = NULL;
+void (*glDeleteBuffers_thread_cmd)(GLsizei n, const GLuint *buffers) = NULL;
+void (*glBindBuffer_thread_cmd)(GLenum target, GLuint buffer) = NULL;
+void (*glBufferData_thread_cmd)(GLenum target, GLsizeiptr size, const void *data, GLenum usage) = NULL;
+void (*glMapBuffer_orig_evas_set)(void *func) = NULL;
+void *(*glMapBuffer_orig_evas_get)(void) = NULL;
+void * (*glMapBuffer_thread_cmd)(GLenum target, GLenum access) = NULL;
+void (*glUnmapBuffer_orig_evas_set)(void *func) = NULL;
+void *(*glUnmapBuffer_orig_evas_get)(void) = NULL;
+GLboolean (*glUnmapBuffer_thread_cmd)(GLenum target) = NULL;
+GLuint (*glCreateShader_thread_cmd)(GLenum type) = NULL;
+void (*glShaderSource_thread_cmd)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length) = NULL;
+void (*glCompileShader_thread_cmd)(GLuint shader) = NULL;
+void (*glReleaseShaderCompiler_orig_evas_set)(void *func) = NULL;
+void *(*glReleaseShaderCompiler_orig_evas_get)(void) = NULL;
+void (*glReleaseShaderCompiler_thread_cmd)(void) = NULL;
+void (*glDeleteShader_thread_cmd)(GLuint shader) = NULL;
+GLuint (*glCreateProgram_thread_cmd)(void) = NULL;
+void (*glAttachShader_thread_cmd)(GLuint program, GLuint shader) = NULL;
+void (*glDetachShader_thread_cmd)(GLuint program, GLuint shader) = NULL;
+void (*glLinkProgram_thread_cmd)(GLuint program) = NULL;
+void (*glUseProgram_thread_cmd)(GLuint program) = NULL;
+void (*glProgramParameteri_orig_evas_set)(void *func) = NULL;
+void *(*glProgramParameteri_orig_evas_get)(void) = NULL;
+void (*glProgramParameteri_thread_cmd)(GLuint program, GLenum pname, GLint value) = NULL;
+void (*glDeleteProgram_thread_cmd)(GLuint program) = NULL;
+void (*glGetProgramBinary_orig_evas_set)(void *func) = NULL;
+void *(*glGetProgramBinary_orig_evas_get)(void) = NULL;
+void (*glGetProgramBinary_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) = NULL;
+void (*glProgramBinary_orig_evas_set)(void *func) = NULL;
+void *(*glProgramBinary_orig_evas_get)(void) = NULL;
+void (*glProgramBinary_thread_cmd)(GLuint program, GLenum binaryFormat, const void *binary, GLint length) = NULL;
+void (*glGetActiveAttrib_thread_cmd)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name) = NULL;
+GLint (*glGetAttribLocation_thread_cmd)(GLuint program, const GLchar *name) = NULL;
+void (*glBindAttribLocation_thread_cmd)(GLuint program, GLuint index, const GLchar *name) = NULL;
+GLint (*glGetUniformLocation_thread_cmd)(GLuint program, const GLchar *name) = NULL;
+void (*glUniform1f_thread_cmd)(GLint location, GLfloat v0) = NULL;
+void (*glUniform1i_thread_cmd)(GLint location, GLint v0) = NULL;
+void (*glUniform2f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1) = NULL;
+void (*glUniform2i_thread_cmd)(GLint location, GLint v0, GLint v1) = NULL;
+void (*glUniform3f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2) = NULL;
+void (*glUniform3i_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2) = NULL;
+void (*glUniform4f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) = NULL;
+void (*glUniform4i_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3) = NULL;
+void (*glUniform1fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform1iv_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform2fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform2iv_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform3fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform3iv_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniform4fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value) = NULL;
+void (*glUniform4iv_thread_cmd)(GLint location, GLsizei count, const GLint *value) = NULL;
+void (*glUniformMatrix2fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glUniformMatrix3fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glUniformMatrix4fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = NULL;
+void (*glViewport_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+void (*glEnable_thread_cmd)(GLenum cap) = NULL;
+void (*glDisable_thread_cmd)(GLenum cap) = NULL;
+void (*glLineWidth_thread_cmd)(GLfloat width) = NULL;
+void (*glPolygonOffset_thread_cmd)(GLfloat factor, GLfloat units) = NULL;
+void (*glPixelStorei_thread_cmd)(GLenum pname, GLint param) = NULL;
+void (*glActiveTexture_thread_cmd)(GLenum texture) = NULL;
+void (*glGenTextures_thread_cmd)(GLsizei n, GLuint *textures) = NULL;
+void (*glBindTexture_thread_cmd)(GLenum target, GLuint texture) = NULL;
+void (*glDeleteTextures_thread_cmd)(GLsizei n, const GLuint *textures) = NULL;
+void (*glTexImage2D_thread_cmd)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels) = NULL;
+void (*glTexSubImage2D_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) = NULL;
+void (*glCompressedTexImage2D_thread_cmd)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data) = NULL;
+void (*glCompressedTexSubImage2D_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data) = NULL;
+void (*glTexParameterf_thread_cmd)(GLenum target, GLenum pname, GLfloat param) = NULL;
+void (*glTexParameterfv_thread_cmd)(GLenum target, GLenum pname, const GLfloat *params) = NULL;
+void (*glTexParameteri_thread_cmd)(GLenum target, GLenum pname, GLint param) = NULL;
+void (*glTexParameteriv_thread_cmd)(GLenum target, GLenum pname, const GLint *params) = NULL;
+void (*glScissor_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height) = NULL;
+void (*glBlendFunc_thread_cmd)(GLenum sfactor, GLenum dfactor) = NULL;
+void (*glBlendColor_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) = NULL;
+void (*glDepthMask_thread_cmd)(GLboolean flag) = NULL;
+void (*glClear_thread_cmd)(GLbitfield mask) = NULL;
+void (*glClearColor_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) = NULL;
+void (*glReadPixels_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) = NULL;
+void (*glGenFramebuffers_orig_evas_set)(void *func) = NULL;
+void *(*glGenFramebuffers_orig_evas_get)(void) = NULL;
+void (*glGenFramebuffers_thread_cmd)(GLsizei n, GLuint *framebuffers) = NULL;
+void (*glBindFramebuffer_orig_evas_set)(void *func) = NULL;
+void *(*glBindFramebuffer_orig_evas_get)(void) = NULL;
+void (*glBindFramebuffer_thread_cmd)(GLenum target, GLuint framebuffer) = NULL;
+void (*glDeleteFramebuffers_orig_evas_set)(void *func) = NULL;
+void *(*glDeleteFramebuffers_orig_evas_get)(void) = NULL;
+void (*glDeleteFramebuffers_thread_cmd)(GLsizei n, const GLuint *framebuffers) = NULL;
+void (*glGenRenderbuffers_thread_cmd)(GLsizei n, GLuint *renderbuffers) = NULL;
+void (*glBindRenderbuffer_thread_cmd)(GLenum target, GLuint renderbuffer) = NULL;
+void (*glDeleteRenderbuffers_thread_cmd)(GLsizei n, const GLuint *renderbuffers) = NULL;
+void (*glRenderbufferStorage_thread_cmd)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
+void (*glFramebufferRenderbuffer_thread_cmd)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL;
+void (*glFramebufferTexture2D_orig_evas_set)(void *func) = NULL;
+void *(*glFramebufferTexture2D_orig_evas_get)(void) = NULL;
+void (*glFramebufferTexture2D_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL;
+void (*glFramebufferTexture2DMultisample_orig_evas_set)(void *func) = NULL;
+void *(*glFramebufferTexture2DMultisample_orig_evas_get)(void) = NULL;
+void (*glFramebufferTexture2DMultisample_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) = NULL;
+GLenum (*glCheckFramebufferStatus_thread_cmd)(GLenum target) = NULL;
+void (*glFlush_thread_cmd)(void) = NULL;
+void (*glFinish_thread_cmd)(void) = NULL;
+void (*glHint_thread_cmd)(GLenum target, GLenum mode) = NULL;
+const GLubyte * (*glGetString_thread_cmd)(GLenum name) = NULL;
+void (*glGetBooleanv_thread_cmd)(GLenum pname, GLboolean *data) = NULL;
+void (*glGetFloatv_thread_cmd)(GLenum pname, GLfloat *data) = NULL;
+void (*glGetIntegerv_thread_cmd)(GLenum pname, GLint *data) = NULL;
+GLboolean (*glIsBuffer_thread_cmd)(GLint buffer) = NULL;
+void (*glGetBufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsShader_thread_cmd)(GLuint shader) = NULL;
+void (*glGetShaderiv_thread_cmd)(GLuint shader, GLenum pname, GLint *params) = NULL;
+void (*glGetAttachedShaders_thread_cmd)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders) = NULL;
+void (*glGetShaderInfoLog_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) = NULL;
+void (*glGetShaderSource_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source) = NULL;
+void (*glGetShaderPrecisionFormat_thread_cmd)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision) = NULL;
+void (*glGetVertexAttribfv_thread_cmd)(GLuint index, GLenum pname, GLfloat *params) = NULL;
+void (*glGetVertexAttribiv_thread_cmd)(GLuint index, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsProgram_thread_cmd)(GLuint program) = NULL;
+void (*glGetProgramInfoLog_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog) = NULL;
+void (*glGetProgramiv_thread_cmd)(GLuint program, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsFramebuffer_thread_cmd)(GLint framebuffer) = NULL;
+void (*glGetFramebufferParameteriv_orig_evas_set)(void *func) = NULL;
+void *(*glGetFramebufferParameteriv_orig_evas_get)(void) = NULL;
+void (*glGetFramebufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsRenderbuffer_thread_cmd)(GLint renderbuffer) = NULL;
+void (*glGetRenderbufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params) = NULL;
+GLboolean (*glIsTexture_thread_cmd)(GLint texture) = NULL;
+void (*glStartTiling_orig_evas_set)(void *func) = NULL;
+void *(*glStartTiling_orig_evas_get)(void) = NULL;
+void (*glStartTiling_thread_cmd)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e) = NULL;
+void (*glEndTiling_orig_evas_set)(void *func) = NULL;
+void *(*glEndTiling_orig_evas_get)(void) = NULL;
+void (*glEndTiling_thread_cmd)(GLuint a) = NULL;
+void (*glActivateTile_orig_evas_set)(void *func) = NULL;
+void *(*glActivateTile_orig_evas_get)(void) = NULL;
+void (*glActivateTile_thread_cmd)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e) = NULL;
+void (*glEGLImageTargetTexture2DOES_orig_evas_set)(void *func) = NULL;
+void *(*glEGLImageTargetTexture2DOES_orig_evas_get)(void) = NULL;
+void (*glEGLImageTargetTexture2DOES_thread_cmd)(GLenum target, void *image) = NULL;
+
+#ifndef GL_GLES
+void (*glAlphaFunc_thread_cmd)(GLenum func, GLclampf ref) = NULL;
+#endif
+
+#ifndef GL_GLES
+void (*glGetTexLevelParameteriv_thread_cmd)(GLenum target, GLint level, GLenum pname, GLint *params) = NULL;
+#endif
+
+#ifndef GL_GLES
+void (*glRenderbufferStorageMultisample_orig_evas_set)(void *func) = NULL;
+void *(*glRenderbufferStorageMultisample_orig_evas_get)(void) = NULL;
+void (*glRenderbufferStorageMultisample_thread_cmd)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) = NULL;
+#endif
+void (*glGetStringi_orig_evas_set)(void *func) = NULL;
+void *(*glGetStringi_orig_evas_get)(void) = NULL;
+const GLubyte * (*glGetStringi_thread_cmd)(GLenum name, GLuint index) = NULL;
+
+
+void _gl_thread_link_init()
+{
+#define LINK2GENERIC(sym) \
+   sym = dlsym(RTLD_DEFAULT, #sym); \
+   if (!sym) ERR("Could not find function '%s'", #sym);
+
+   LINK2GENERIC(glGetError_thread_cmd);
+   LINK2GENERIC(glVertexAttribPointer_thread_cmd);
+   LINK2GENERIC(glEnableVertexAttribArray_thread_cmd);
+   LINK2GENERIC(glDisableVertexAttribArray_thread_cmd);
+   LINK2GENERIC(glDrawArrays_thread_cmd);
+   LINK2GENERIC(glDrawElements_thread_cmd);
+   LINK2GENERIC(glGenBuffers_thread_cmd);
+   LINK2GENERIC(glDeleteBuffers_thread_cmd);
+   LINK2GENERIC(glBindBuffer_thread_cmd);
+   LINK2GENERIC(glBufferData_thread_cmd);
+   LINK2GENERIC(glMapBuffer_orig_evas_set);
+   LINK2GENERIC(glMapBuffer_orig_evas_get);
+   LINK2GENERIC(glMapBuffer_thread_cmd);
+   LINK2GENERIC(glUnmapBuffer_orig_evas_set);
+   LINK2GENERIC(glUnmapBuffer_orig_evas_get);
+   LINK2GENERIC(glUnmapBuffer_thread_cmd);
+   LINK2GENERIC(glCreateShader_thread_cmd);
+   LINK2GENERIC(glShaderSource_thread_cmd);
+   LINK2GENERIC(glCompileShader_thread_cmd);
+   LINK2GENERIC(glReleaseShaderCompiler_orig_evas_set);
+   LINK2GENERIC(glReleaseShaderCompiler_orig_evas_get);
+   LINK2GENERIC(glReleaseShaderCompiler_thread_cmd);
+   LINK2GENERIC(glDeleteShader_thread_cmd);
+   LINK2GENERIC(glCreateProgram_thread_cmd);
+   LINK2GENERIC(glAttachShader_thread_cmd);
+   LINK2GENERIC(glDetachShader_thread_cmd);
+   LINK2GENERIC(glLinkProgram_thread_cmd);
+   LINK2GENERIC(glUseProgram_thread_cmd);
+   LINK2GENERIC(glProgramParameteri_orig_evas_set);
+   LINK2GENERIC(glProgramParameteri_orig_evas_get);
+   LINK2GENERIC(glProgramParameteri_thread_cmd);
+   LINK2GENERIC(glDeleteProgram_thread_cmd);
+   LINK2GENERIC(glGetProgramBinary_orig_evas_set);
+   LINK2GENERIC(glGetProgramBinary_orig_evas_get);
+   LINK2GENERIC(glGetProgramBinary_thread_cmd);
+   LINK2GENERIC(glProgramBinary_orig_evas_set);
+   LINK2GENERIC(glProgramBinary_orig_evas_get);
+   LINK2GENERIC(glProgramBinary_thread_cmd);
+   LINK2GENERIC(glGetActiveAttrib_thread_cmd);
+   LINK2GENERIC(glGetAttribLocation_thread_cmd);
+   LINK2GENERIC(glBindAttribLocation_thread_cmd);
+   LINK2GENERIC(glGetUniformLocation_thread_cmd);
+   LINK2GENERIC(glUniform1f_thread_cmd);
+   LINK2GENERIC(glUniform1i_thread_cmd);
+   LINK2GENERIC(glUniform2f_thread_cmd);
+   LINK2GENERIC(glUniform2i_thread_cmd);
+   LINK2GENERIC(glUniform3f_thread_cmd);
+   LINK2GENERIC(glUniform3i_thread_cmd);
+   LINK2GENERIC(glUniform4f_thread_cmd);
+   LINK2GENERIC(glUniform4i_thread_cmd);
+   LINK2GENERIC(glUniform1fv_thread_cmd);
+   LINK2GENERIC(glUniform1iv_thread_cmd);
+   LINK2GENERIC(glUniform2fv_thread_cmd);
+   LINK2GENERIC(glUniform2iv_thread_cmd);
+   LINK2GENERIC(glUniform3fv_thread_cmd);
+   LINK2GENERIC(glUniform3iv_thread_cmd);
+   LINK2GENERIC(glUniform4fv_thread_cmd);
+   LINK2GENERIC(glUniform4iv_thread_cmd);
+   LINK2GENERIC(glUniformMatrix2fv_thread_cmd);
+   LINK2GENERIC(glUniformMatrix3fv_thread_cmd);
+   LINK2GENERIC(glUniformMatrix4fv_thread_cmd);
+   LINK2GENERIC(glViewport_thread_cmd);
+   LINK2GENERIC(glEnable_thread_cmd);
+   LINK2GENERIC(glDisable_thread_cmd);
+   LINK2GENERIC(glLineWidth_thread_cmd);
+   LINK2GENERIC(glPolygonOffset_thread_cmd);
+   LINK2GENERIC(glPixelStorei_thread_cmd);
+   LINK2GENERIC(glActiveTexture_thread_cmd);
+   LINK2GENERIC(glGenTextures_thread_cmd);
+   LINK2GENERIC(glBindTexture_thread_cmd);
+   LINK2GENERIC(glDeleteTextures_thread_cmd);
+   LINK2GENERIC(glTexImage2D_thread_cmd);
+   LINK2GENERIC(glTexSubImage2D_thread_cmd);
+   LINK2GENERIC(glCompressedTexImage2D_thread_cmd);
+   LINK2GENERIC(glCompressedTexSubImage2D_thread_cmd);
+   LINK2GENERIC(glTexParameterf_thread_cmd);
+   LINK2GENERIC(glTexParameterfv_thread_cmd);
+   LINK2GENERIC(glTexParameteri_thread_cmd);
+   LINK2GENERIC(glTexParameteriv_thread_cmd);
+   LINK2GENERIC(glScissor_thread_cmd);
+   LINK2GENERIC(glBlendFunc_thread_cmd);
+   LINK2GENERIC(glBlendColor_thread_cmd);
+   LINK2GENERIC(glDepthMask_thread_cmd);
+   LINK2GENERIC(glClear_thread_cmd);
+   LINK2GENERIC(glClearColor_thread_cmd);
+   LINK2GENERIC(glReadPixels_thread_cmd);
+   LINK2GENERIC(glGenFramebuffers_orig_evas_set);
+   LINK2GENERIC(glGenFramebuffers_orig_evas_get);
+   LINK2GENERIC(glGenFramebuffers_thread_cmd);
+   LINK2GENERIC(glBindFramebuffer_orig_evas_set);
+   LINK2GENERIC(glBindFramebuffer_orig_evas_get);
+   LINK2GENERIC(glBindFramebuffer_thread_cmd);
+   LINK2GENERIC(glDeleteFramebuffers_orig_evas_set);
+   LINK2GENERIC(glDeleteFramebuffers_orig_evas_get);
+   LINK2GENERIC(glDeleteFramebuffers_thread_cmd);
+   LINK2GENERIC(glGenRenderbuffers_thread_cmd);
+   LINK2GENERIC(glBindRenderbuffer_thread_cmd);
+   LINK2GENERIC(glDeleteRenderbuffers_thread_cmd);
+   LINK2GENERIC(glRenderbufferStorage_thread_cmd);
+   LINK2GENERIC(glFramebufferRenderbuffer_thread_cmd);
+   LINK2GENERIC(glFramebufferTexture2D_orig_evas_set);
+   LINK2GENERIC(glFramebufferTexture2D_orig_evas_get);
+   LINK2GENERIC(glFramebufferTexture2D_thread_cmd);
+   LINK2GENERIC(glFramebufferTexture2DMultisample_orig_evas_set);
+   LINK2GENERIC(glFramebufferTexture2DMultisample_orig_evas_get);
+   LINK2GENERIC(glFramebufferTexture2DMultisample_thread_cmd);
+   LINK2GENERIC(glCheckFramebufferStatus_thread_cmd);
+   LINK2GENERIC(glFlush_thread_cmd);
+   LINK2GENERIC(glFinish_thread_cmd);
+   LINK2GENERIC(glHint_thread_cmd);
+   LINK2GENERIC(glGetString_thread_cmd);
+   LINK2GENERIC(glGetBooleanv_thread_cmd);
+   LINK2GENERIC(glGetFloatv_thread_cmd);
+   LINK2GENERIC(glGetIntegerv_thread_cmd);
+   LINK2GENERIC(glIsBuffer_thread_cmd);
+   LINK2GENERIC(glGetBufferParameteriv_thread_cmd);
+   LINK2GENERIC(glIsShader_thread_cmd);
+   LINK2GENERIC(glGetShaderiv_thread_cmd);
+   LINK2GENERIC(glGetAttachedShaders_thread_cmd);
+   LINK2GENERIC(glGetShaderInfoLog_thread_cmd);
+   LINK2GENERIC(glGetShaderSource_thread_cmd);
+   LINK2GENERIC(glGetShaderPrecisionFormat_thread_cmd);
+   LINK2GENERIC(glGetVertexAttribfv_thread_cmd);
+   LINK2GENERIC(glGetVertexAttribiv_thread_cmd);
+   LINK2GENERIC(glIsProgram_thread_cmd);
+   LINK2GENERIC(glGetProgramInfoLog_thread_cmd);
+   LINK2GENERIC(glGetProgramiv_thread_cmd);
+   LINK2GENERIC(glIsFramebuffer_thread_cmd);
+   LINK2GENERIC(glGetFramebufferParameteriv_orig_evas_set);
+   LINK2GENERIC(glGetFramebufferParameteriv_orig_evas_get);
+   LINK2GENERIC(glGetFramebufferParameteriv_thread_cmd);
+   LINK2GENERIC(glIsRenderbuffer_thread_cmd);
+   LINK2GENERIC(glGetRenderbufferParameteriv_thread_cmd);
+   LINK2GENERIC(glIsTexture_thread_cmd);
+   LINK2GENERIC(glStartTiling_orig_evas_set);
+   LINK2GENERIC(glStartTiling_orig_evas_get);
+   LINK2GENERIC(glStartTiling_thread_cmd);
+   LINK2GENERIC(glEndTiling_orig_evas_set);
+   LINK2GENERIC(glEndTiling_orig_evas_get);
+   LINK2GENERIC(glEndTiling_thread_cmd);
+   LINK2GENERIC(glActivateTile_orig_evas_set);
+   LINK2GENERIC(glActivateTile_orig_evas_get);
+   LINK2GENERIC(glActivateTile_thread_cmd);
+   LINK2GENERIC(glEGLImageTargetTexture2DOES_orig_evas_set);
+   LINK2GENERIC(glEGLImageTargetTexture2DOES_orig_evas_get);
+   LINK2GENERIC(glEGLImageTargetTexture2DOES_thread_cmd);
+
+#ifndef GL_GLES
+   LINK2GENERIC(glAlphaFunc_thread_cmd);
+#endif
+
+
+#ifndef GL_GLES
+   LINK2GENERIC(glGetTexLevelParameteriv_thread_cmd);
+#endif
+
+
+#ifndef GL_GLES
+   LINK2GENERIC(glRenderbufferStorageMultisample_orig_evas_set);
+   LINK2GENERIC(glRenderbufferStorageMultisample_orig_evas_get);
+   LINK2GENERIC(glRenderbufferStorageMultisample_thread_cmd);
+#endif
+
+   LINK2GENERIC(glGetStringi_orig_evas_set);
+   LINK2GENERIC(glGetStringi_orig_evas_get);
+   LINK2GENERIC(glGetStringi_thread_cmd);
+}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.h b/src/modules/evas/engines/gl_common/evas_gl_thread_gl_link_generated.h
new file mode 100644 (file)
index 0000000..a198b46
--- /dev/null
@@ -0,0 +1,168 @@
+/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
+
+extern GLenum (*glGetError_thread_cmd)(void);
+extern void (*glVertexAttribPointer_thread_cmd)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+extern void (*glEnableVertexAttribArray_thread_cmd)(GLuint index);
+extern void (*glDisableVertexAttribArray_thread_cmd)(GLuint index);
+extern void (*glDrawArrays_thread_cmd)(GLenum mode, GLint first, GLsizei count);
+extern void (*glDrawElements_thread_cmd)(GLenum mode, GLsizei count, GLenum type, const void *indices);
+extern void (*glGenBuffers_thread_cmd)(GLsizei n, GLuint *buffers);
+extern void (*glDeleteBuffers_thread_cmd)(GLsizei n, const GLuint *buffers);
+extern void (*glBindBuffer_thread_cmd)(GLenum target, GLuint buffer);
+extern void (*glBufferData_thread_cmd)(GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+extern void (*glMapBuffer_orig_evas_set)(void *func);
+extern void *(*glMapBuffer_orig_evas_get)(void);
+extern void * (*glMapBuffer_thread_cmd)(GLenum target, GLenum access);
+extern void (*glUnmapBuffer_orig_evas_set)(void *func);
+extern void *(*glUnmapBuffer_orig_evas_get)(void);
+extern GLboolean (*glUnmapBuffer_thread_cmd)(GLenum target);
+extern GLuint (*glCreateShader_thread_cmd)(GLenum type);
+extern void (*glShaderSource_thread_cmd)(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
+extern void (*glCompileShader_thread_cmd)(GLuint shader);
+extern void (*glReleaseShaderCompiler_orig_evas_set)(void *func);
+extern void *(*glReleaseShaderCompiler_orig_evas_get)(void);
+extern void (*glReleaseShaderCompiler_thread_cmd)(void);
+extern void (*glDeleteShader_thread_cmd)(GLuint shader);
+extern GLuint (*glCreateProgram_thread_cmd)(void);
+extern void (*glAttachShader_thread_cmd)(GLuint program, GLuint shader);
+extern void (*glDetachShader_thread_cmd)(GLuint program, GLuint shader);
+extern void (*glLinkProgram_thread_cmd)(GLuint program);
+extern void (*glUseProgram_thread_cmd)(GLuint program);
+extern void (*glProgramParameteri_orig_evas_set)(void *func);
+extern void *(*glProgramParameteri_orig_evas_get)(void);
+extern void (*glProgramParameteri_thread_cmd)(GLuint program, GLenum pname, GLint value);
+extern void (*glDeleteProgram_thread_cmd)(GLuint program);
+extern void (*glGetProgramBinary_orig_evas_set)(void *func);
+extern void *(*glGetProgramBinary_orig_evas_get)(void);
+extern void (*glGetProgramBinary_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+extern void (*glProgramBinary_orig_evas_set)(void *func);
+extern void *(*glProgramBinary_orig_evas_get)(void);
+extern void (*glProgramBinary_thread_cmd)(GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+extern void (*glGetActiveAttrib_thread_cmd)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+extern GLint (*glGetAttribLocation_thread_cmd)(GLuint program, const GLchar *name);
+extern void (*glBindAttribLocation_thread_cmd)(GLuint program, GLuint index, const GLchar *name);
+extern GLint (*glGetUniformLocation_thread_cmd)(GLuint program, const GLchar *name);
+extern void (*glUniform1f_thread_cmd)(GLint location, GLfloat v0);
+extern void (*glUniform1i_thread_cmd)(GLint location, GLint v0);
+extern void (*glUniform2f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1);
+extern void (*glUniform2i_thread_cmd)(GLint location, GLint v0, GLint v1);
+extern void (*glUniform3f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+extern void (*glUniform3i_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2);
+extern void (*glUniform4f_thread_cmd)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+extern void (*glUniform4i_thread_cmd)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+extern void (*glUniform1fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform1iv_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform2fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform2iv_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform3fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform3iv_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniform4fv_thread_cmd)(GLint location, GLsizei count, const GLfloat *value);
+extern void (*glUniform4iv_thread_cmd)(GLint location, GLsizei count, const GLint *value);
+extern void (*glUniformMatrix2fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glUniformMatrix3fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glUniformMatrix4fv_thread_cmd)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+extern void (*glViewport_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height);
+extern void (*glEnable_thread_cmd)(GLenum cap);
+extern void (*glDisable_thread_cmd)(GLenum cap);
+extern void (*glLineWidth_thread_cmd)(GLfloat width);
+extern void (*glPolygonOffset_thread_cmd)(GLfloat factor, GLfloat units);
+extern void (*glPixelStorei_thread_cmd)(GLenum pname, GLint param);
+extern void (*glActiveTexture_thread_cmd)(GLenum texture);
+extern void (*glGenTextures_thread_cmd)(GLsizei n, GLuint *textures);
+extern void (*glBindTexture_thread_cmd)(GLenum target, GLuint texture);
+extern void (*glDeleteTextures_thread_cmd)(GLsizei n, const GLuint *textures);
+extern void (*glTexImage2D_thread_cmd)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+extern void (*glTexSubImage2D_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+extern void (*glCompressedTexImage2D_thread_cmd)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+extern void (*glCompressedTexSubImage2D_thread_cmd)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+extern void (*glTexParameterf_thread_cmd)(GLenum target, GLenum pname, GLfloat param);
+extern void (*glTexParameterfv_thread_cmd)(GLenum target, GLenum pname, const GLfloat *params);
+extern void (*glTexParameteri_thread_cmd)(GLenum target, GLenum pname, GLint param);
+extern void (*glTexParameteriv_thread_cmd)(GLenum target, GLenum pname, const GLint *params);
+extern void (*glScissor_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height);
+extern void (*glBlendFunc_thread_cmd)(GLenum sfactor, GLenum dfactor);
+extern void (*glBlendColor_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+extern void (*glDepthMask_thread_cmd)(GLboolean flag);
+extern void (*glClear_thread_cmd)(GLbitfield mask);
+extern void (*glClearColor_thread_cmd)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+extern void (*glReadPixels_thread_cmd)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+extern void (*glGenFramebuffers_orig_evas_set)(void *func);
+extern void *(*glGenFramebuffers_orig_evas_get)(void);
+extern void (*glGenFramebuffers_thread_cmd)(GLsizei n, GLuint *framebuffers);
+extern void (*glBindFramebuffer_orig_evas_set)(void *func);
+extern void *(*glBindFramebuffer_orig_evas_get)(void);
+extern void (*glBindFramebuffer_thread_cmd)(GLenum target, GLuint framebuffer);
+extern void (*glDeleteFramebuffers_orig_evas_set)(void *func);
+extern void *(*glDeleteFramebuffers_orig_evas_get)(void);
+extern void (*glDeleteFramebuffers_thread_cmd)(GLsizei n, const GLuint *framebuffers);
+extern void (*glGenRenderbuffers_thread_cmd)(GLsizei n, GLuint *renderbuffers);
+extern void (*glBindRenderbuffer_thread_cmd)(GLenum target, GLuint renderbuffer);
+extern void (*glDeleteRenderbuffers_thread_cmd)(GLsizei n, const GLuint *renderbuffers);
+extern void (*glRenderbufferStorage_thread_cmd)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+extern void (*glFramebufferRenderbuffer_thread_cmd)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+extern void (*glFramebufferTexture2D_orig_evas_set)(void *func);
+extern void *(*glFramebufferTexture2D_orig_evas_get)(void);
+extern void (*glFramebufferTexture2D_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+extern void (*glFramebufferTexture2DMultisample_orig_evas_set)(void *func);
+extern void *(*glFramebufferTexture2DMultisample_orig_evas_get)(void);
+extern void (*glFramebufferTexture2DMultisample_thread_cmd)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+extern GLenum (*glCheckFramebufferStatus_thread_cmd)(GLenum target);
+extern void (*glFlush_thread_cmd)(void);
+extern void (*glFinish_thread_cmd)(void);
+extern void (*glHint_thread_cmd)(GLenum target, GLenum mode);
+extern const GLubyte * (*glGetString_thread_cmd)(GLenum name);
+extern void (*glGetBooleanv_thread_cmd)(GLenum pname, GLboolean *data);
+extern void (*glGetFloatv_thread_cmd)(GLenum pname, GLfloat *data);
+extern void (*glGetIntegerv_thread_cmd)(GLenum pname, GLint *data);
+extern GLboolean (*glIsBuffer_thread_cmd)(GLint buffer);
+extern void (*glGetBufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params);
+extern GLboolean (*glIsShader_thread_cmd)(GLuint shader);
+extern void (*glGetShaderiv_thread_cmd)(GLuint shader, GLenum pname, GLint *params);
+extern void (*glGetAttachedShaders_thread_cmd)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+extern void (*glGetShaderInfoLog_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+extern void (*glGetShaderSource_thread_cmd)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+extern void (*glGetShaderPrecisionFormat_thread_cmd)(GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+extern void (*glGetVertexAttribfv_thread_cmd)(GLuint index, GLenum pname, GLfloat *params);
+extern void (*glGetVertexAttribiv_thread_cmd)(GLuint index, GLenum pname, GLint *params);
+extern GLboolean (*glIsProgram_thread_cmd)(GLuint program);
+extern void (*glGetProgramInfoLog_thread_cmd)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+extern void (*glGetProgramiv_thread_cmd)(GLuint program, GLenum pname, GLint *params);
+extern GLboolean (*glIsFramebuffer_thread_cmd)(GLint framebuffer);
+extern void (*glGetFramebufferParameteriv_orig_evas_set)(void *func);
+extern void *(*glGetFramebufferParameteriv_orig_evas_get)(void);
+extern void (*glGetFramebufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params);
+extern GLboolean (*glIsRenderbuffer_thread_cmd)(GLint renderbuffer);
+extern void (*glGetRenderbufferParameteriv_thread_cmd)(GLenum target, GLenum pname, GLint *params);
+extern GLboolean (*glIsTexture_thread_cmd)(GLint texture);
+extern void (*glStartTiling_orig_evas_set)(void *func);
+extern void *(*glStartTiling_orig_evas_get)(void);
+extern void (*glStartTiling_thread_cmd)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+extern void (*glEndTiling_orig_evas_set)(void *func);
+extern void *(*glEndTiling_orig_evas_get)(void);
+extern void (*glEndTiling_thread_cmd)(GLuint a);
+extern void (*glActivateTile_orig_evas_set)(void *func);
+extern void *(*glActivateTile_orig_evas_get)(void);
+extern void (*glActivateTile_thread_cmd)(GLuint a, GLuint b, GLuint c, GLuint d, GLuint e);
+extern void (*glEGLImageTargetTexture2DOES_orig_evas_set)(void *func);
+extern void *(*glEGLImageTargetTexture2DOES_orig_evas_get)(void);
+extern void (*glEGLImageTargetTexture2DOES_thread_cmd)(GLenum target, void *image);
+
+#ifndef GL_GLES
+extern void (*glAlphaFunc_thread_cmd)(GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_GLES
+extern void (*glGetTexLevelParameteriv_thread_cmd)(GLenum target, GLint level, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_GLES
+extern void (*glRenderbufferStorageMultisample_orig_evas_set)(void *func);
+extern void *(*glRenderbufferStorageMultisample_orig_evas_get)(void);
+extern void (*glRenderbufferStorageMultisample_thread_cmd)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+extern void (*glGetStringi_orig_evas_set)(void *func);
+extern void *(*glGetStringi_orig_evas_get)(void);
+extern const GLubyte * (*glGetStringi_thread_cmd)(GLenum name, GLuint index);
+
+
+extern void _gl_thread_link_init();
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_glx.c b/src/modules/evas/engines/gl_common/evas_gl_thread_glx.c
new file mode 100644 (file)
index 0000000..bf17c01
--- /dev/null
@@ -0,0 +1,3087 @@
+#include "evas_common_private.h"
+#include "evas_gl_thread.h"
+
+
+#ifndef GL_GLES
+
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+
+/*
+   void
+   glXBindTexImage(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int buffer;
+   const int *attrib_list;
+
+} Thread_Command_glXBindTexImage;
+
+void (*orig_evas_glXBindTexImage)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+
+EAPI void
+glXBindTexImage_orig_evas_set(void *func)
+{
+   orig_evas_glXBindTexImage = func;
+}
+
+EAPI void *
+glXBindTexImage_orig_evas_get(void)
+{
+   return orig_evas_glXBindTexImage;
+}
+
+static void
+_gl_thread_glXBindTexImage(void *data)
+{
+   Thread_Command_glXBindTexImage *thread_param =
+      (Thread_Command_glXBindTexImage *)data;
+
+   orig_evas_glXBindTexImage(thread_param->dpy,
+                             thread_param->drawable,
+                             thread_param->buffer,
+                             thread_param->attrib_list);
+
+}
+
+EAPI void
+glXBindTexImage_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glXBindTexImage(dpy, drawable, buffer, attrib_list);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXBindTexImage thread_param_local;
+   Thread_Command_glXBindTexImage *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->buffer = buffer;
+   thread_param->attrib_list = attrib_list;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXBindTexImage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLXFBConfig *
+   glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems);
+ */
+
+typedef struct
+{
+   GLXFBConfig * return_value;
+   Display *dpy;
+   int screen;
+   const int *attribList;
+   int *nitems;
+
+} Thread_Command_glXChooseFBConfig;
+
+static void
+_gl_thread_glXChooseFBConfig(void *data)
+{
+   Thread_Command_glXChooseFBConfig *thread_param =
+      (Thread_Command_glXChooseFBConfig *)data;
+
+   thread_param->return_value = glXChooseFBConfig(thread_param->dpy,
+                                                  thread_param->screen,
+                                                  thread_param->attribList,
+                                                  thread_param->nitems);
+
+}
+
+EAPI GLXFBConfig *
+glXChooseFBConfig_thread_cmd(Display *dpy, int screen, const int *attribList, int *nitems)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXChooseFBConfig(dpy, screen, attribList, nitems);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXChooseFBConfig thread_param_local;
+   Thread_Command_glXChooseFBConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->screen = screen;
+   thread_param->attribList = attribList;
+   thread_param->nitems = nitems;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXChooseFBConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXCreateContext(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+ */
+
+typedef struct
+{
+   GLXContext return_value;
+   Display *dpy;
+   XVisualInfo *vis;
+   GLXContext shareList;
+   Bool direct;
+
+} Thread_Command_glXCreateContext;
+
+static void
+_gl_thread_glXCreateContext(void *data)
+{
+   Thread_Command_glXCreateContext *thread_param =
+      (Thread_Command_glXCreateContext *)data;
+
+   thread_param->return_value = glXCreateContext(thread_param->dpy,
+                                                 thread_param->vis,
+                                                 thread_param->shareList,
+                                                 thread_param->direct);
+
+}
+
+EAPI GLXContext
+glXCreateContext_thread_cmd(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXCreateContext(dpy, vis, shareList, direct);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXCreateContext thread_param_local;
+   Thread_Command_glXCreateContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->vis = vis;
+   thread_param->shareList = shareList;
+   thread_param->direct = direct;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXCreateContext,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXCreateNewContext(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+ */
+
+typedef struct
+{
+   GLXContext return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   int renderType;
+   GLXContext shareList;
+   Bool direct;
+
+} Thread_Command_glXCreateNewContext;
+
+static void
+_gl_thread_glXCreateNewContext(void *data)
+{
+   Thread_Command_glXCreateNewContext *thread_param =
+      (Thread_Command_glXCreateNewContext *)data;
+
+   thread_param->return_value = glXCreateNewContext(thread_param->dpy,
+                                                    thread_param->config,
+                                                    thread_param->renderType,
+                                                    thread_param->shareList,
+                                                    thread_param->direct);
+
+}
+
+EAPI GLXContext
+glXCreateNewContext_thread_cmd(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXCreateNewContext(dpy, config, renderType, shareList, direct);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXCreateNewContext thread_param_local;
+   Thread_Command_glXCreateNewContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->renderType = renderType;
+   thread_param->shareList = shareList;
+   thread_param->direct = direct;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXCreateNewContext,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXPbuffer
+   glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXPbuffer return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   const int *attribList;
+
+} Thread_Command_glXCreatePbuffer;
+
+static void
+_gl_thread_glXCreatePbuffer(void *data)
+{
+   Thread_Command_glXCreatePbuffer *thread_param =
+      (Thread_Command_glXCreatePbuffer *)data;
+
+   thread_param->return_value = glXCreatePbuffer(thread_param->dpy,
+                                                 thread_param->config,
+                                                 thread_param->attribList);
+
+}
+
+EAPI GLXPbuffer
+glXCreatePbuffer_thread_cmd(Display *dpy, GLXFBConfig config, const int *attribList)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXCreatePbuffer(dpy, config, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXCreatePbuffer thread_param_local;
+   Thread_Command_glXCreatePbuffer *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXCreatePbuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXPixmap
+   glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXPixmap return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   Pixmap pixmap;
+   const int *attribList;
+
+} Thread_Command_glXCreatePixmap;
+
+GLXPixmap (*orig_evas_glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+
+EAPI void
+glXCreatePixmap_orig_evas_set(void *func)
+{
+   orig_evas_glXCreatePixmap = func;
+}
+
+EAPI void *
+glXCreatePixmap_orig_evas_get(void)
+{
+   return orig_evas_glXCreatePixmap;
+}
+
+
+static void
+_gl_thread_glXCreatePixmap(void *data)
+{
+   Thread_Command_glXCreatePixmap *thread_param =
+      (Thread_Command_glXCreatePixmap *)data;
+
+   thread_param->return_value = orig_evas_glXCreatePixmap(thread_param->dpy,
+                                                          thread_param->config,
+                                                          thread_param->pixmap,
+                                                          thread_param->attribList);
+
+}
+
+EAPI GLXPixmap
+glXCreatePixmap_thread_cmd(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glXCreatePixmap(dpy, config, pixmap, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXCreatePixmap thread_param_local;
+   Thread_Command_glXCreatePixmap *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->pixmap = pixmap;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXCreatePixmap,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXWindow
+   glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXWindow return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   Window win;
+   const int *attribList;
+
+} Thread_Command_glXCreateWindow;
+
+static void
+_gl_thread_glXCreateWindow(void *data)
+{
+   Thread_Command_glXCreateWindow *thread_param =
+      (Thread_Command_glXCreateWindow *)data;
+
+   thread_param->return_value = glXCreateWindow(thread_param->dpy,
+                                                thread_param->config,
+                                                thread_param->win,
+                                                thread_param->attribList);
+
+}
+
+EAPI GLXWindow
+glXCreateWindow_thread_cmd(Display *dpy, GLXFBConfig config, Window win, const int *attribList)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXCreateWindow(dpy, config, win, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXCreateWindow thread_param_local;
+   Thread_Command_glXCreateWindow *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->win = win;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXCreateWindow,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXPbuffer pbuf;
+
+} Thread_Command_glXDestroyPbuffer;
+
+static void
+_gl_thread_glXDestroyPbuffer(void *data)
+{
+   Thread_Command_glXDestroyPbuffer *thread_param =
+      (Thread_Command_glXDestroyPbuffer *)data;
+
+   glXDestroyPbuffer(thread_param->dpy,
+                     thread_param->pbuf);
+
+}
+
+EAPI void
+glXDestroyPbuffer_thread_cmd(Display *dpy, GLXPbuffer pbuf)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glXDestroyPbuffer(dpy, pbuf);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXDestroyPbuffer thread_param_local;
+   Thread_Command_glXDestroyPbuffer *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->pbuf = pbuf;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXDestroyPbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXPixmap pixmap;
+
+} Thread_Command_glXDestroyPixmap;
+
+void (*orig_evas_glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap);
+
+EAPI void
+glXDestroyPixmap_orig_evas_set(void *func)
+{
+   orig_evas_glXDestroyPixmap = func;
+}
+
+EAPI void *
+glXDestroyPixmap_orig_evas_get(void)
+{
+   return orig_evas_glXDestroyPixmap;
+}
+
+static void
+_gl_thread_glXDestroyPixmap(void *data)
+{
+   Thread_Command_glXDestroyPixmap *thread_param =
+      (Thread_Command_glXDestroyPixmap *)data;
+
+   orig_evas_glXDestroyPixmap(thread_param->dpy,
+                              thread_param->pixmap);
+
+}
+
+EAPI void
+glXDestroyPixmap_thread_cmd(Display *dpy, GLXPixmap pixmap)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glXDestroyPixmap(dpy, pixmap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXDestroyPixmap thread_param_local;
+   Thread_Command_glXDestroyPixmap *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->pixmap = pixmap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXDestroyPixmap,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXDestroyWindow(Display *dpy, GLXWindow window);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXWindow window;
+
+} Thread_Command_glXDestroyWindow;
+
+static void
+_gl_thread_glXDestroyWindow(void *data)
+{
+   Thread_Command_glXDestroyWindow *thread_param =
+      (Thread_Command_glXDestroyWindow *)data;
+
+   glXDestroyWindow(thread_param->dpy,
+                    thread_param->window);
+
+}
+
+EAPI void
+glXDestroyWindow_thread_cmd(Display *dpy, GLXWindow window)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glXDestroyWindow(dpy, window);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXDestroyWindow thread_param_local;
+   Thread_Command_glXDestroyWindow *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->window = window;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXDestroyWindow,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glXGetConfig(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+ */
+
+typedef struct
+{
+   int return_value;
+   Display *dpy;
+   XVisualInfo *visual;
+   int attrib;
+   int *value;
+
+} Thread_Command_glXGetConfig;
+
+static void
+_gl_thread_glXGetConfig(void *data)
+{
+   Thread_Command_glXGetConfig *thread_param =
+      (Thread_Command_glXGetConfig *)data;
+
+   thread_param->return_value = glXGetConfig(thread_param->dpy,
+                                             thread_param->visual,
+                                             thread_param->attrib,
+                                             thread_param->value);
+
+}
+
+EAPI int
+glXGetConfig_thread_cmd(Display *dpy, XVisualInfo *visual, int attrib, int *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXGetConfig(dpy, visual, attrib, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXGetConfig thread_param_local;
+   Thread_Command_glXGetConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->visual = visual;
+   thread_param->attrib = attrib;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXGetConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value);
+ */
+
+typedef struct
+{
+   int return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   int attribute;
+   int *value;
+
+} Thread_Command_glXGetFBConfigAttrib;
+
+static void
+_gl_thread_glXGetFBConfigAttrib(void *data)
+{
+   Thread_Command_glXGetFBConfigAttrib *thread_param =
+      (Thread_Command_glXGetFBConfigAttrib *)data;
+
+   thread_param->return_value = glXGetFBConfigAttrib(thread_param->dpy,
+                                                     thread_param->config,
+                                                     thread_param->attribute,
+                                                     thread_param->value);
+
+}
+
+EAPI int
+glXGetFBConfigAttrib_thread_cmd(Display *dpy, GLXFBConfig config, int attribute, int *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXGetFBConfigAttrib(dpy, config, attribute, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXGetFBConfigAttrib thread_param_local;
+   Thread_Command_glXGetFBConfigAttrib *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXGetFBConfigAttrib,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXGetVideoSync(unsigned int *count);
+ */
+
+typedef struct
+{
+   int return_value;
+   unsigned int *count;
+
+} Thread_Command_glXGetVideoSync;
+
+int (*orig_evas_glXGetVideoSync)(unsigned int *count);
+
+EAPI void
+glXGetVideoSync_orig_evas_set(void *func)
+{
+   orig_evas_glXGetVideoSync = func;
+}
+
+EAPI void *
+glXGetVideoSync_orig_evas_get(void)
+{
+   return orig_evas_glXGetVideoSync;
+}
+
+static void
+_gl_thread_glXGetVideoSync(void *data)
+{
+   Thread_Command_glXGetVideoSync *thread_param =
+      (Thread_Command_glXGetVideoSync *)data;
+
+   thread_param->return_value = orig_evas_glXGetVideoSync(thread_param->count);
+
+}
+
+EAPI int
+glXGetVideoSync_thread_cmd(unsigned int *count)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glXGetVideoSync(count);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXGetVideoSync thread_param_local;
+   Thread_Command_glXGetVideoSync *thread_param = &thread_param_local;
+
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXGetVideoSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   XVisualInfo *
+   glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
+ */
+
+typedef struct
+{
+   XVisualInfo * return_value;
+   Display *dpy;
+   GLXFBConfig config;
+
+} Thread_Command_glXGetVisualFromFBConfig;
+
+static void
+_gl_thread_glXGetVisualFromFBConfig(void *data)
+{
+   Thread_Command_glXGetVisualFromFBConfig *thread_param =
+      (Thread_Command_glXGetVisualFromFBConfig *)data;
+
+   thread_param->return_value = glXGetVisualFromFBConfig(thread_param->dpy,
+                                                         thread_param->config);
+
+}
+
+EAPI XVisualInfo *
+glXGetVisualFromFBConfig_thread_cmd(Display *dpy, GLXFBConfig config)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXGetVisualFromFBConfig(dpy, config);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXGetVisualFromFBConfig thread_param_local;
+   Thread_Command_glXGetVisualFromFBConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXGetVisualFromFBConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Bool
+   glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   GLXDrawable draw;
+   GLXDrawable read;
+   GLXContext ctx;
+
+} Thread_Command_glXMakeContextCurrent;
+
+
+GLXContext current_thread_ctx = NULL;
+GLXDrawable current_thread_draw = NULL;
+GLXDrawable current_thread_read = NULL;
+
+static void
+_gl_thread_glXMakeContextCurrent(void *data)
+{
+   Thread_Command_glXMakeContextCurrent *thread_param =
+      (Thread_Command_glXMakeContextCurrent *)data;
+
+   fprintf(stderr,"THREAD >> OTHER THREAD MAKECONTEXTCURRENT : (%p, %p, %p, %p)\n",
+                                 thread_param->dpy, (void *)thread_param->draw,
+                                 (void* )thread_param->read, thread_param->ctx);
+
+   thread_param->return_value = glXMakeContextCurrent(thread_param->dpy,
+                                                      thread_param->draw,
+                                                      thread_param->read,
+                                                      thread_param->ctx);
+
+   if (thread_param->return_value)
+     {
+        current_thread_ctx = thread_param->ctx;
+        current_thread_draw = thread_param->draw;
+        current_thread_read = thread_param->read;
+     }
+
+}
+
+EAPI Bool
+glXMakeContextCurrent_thread_cmd(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXMakeContextCurrent(dpy, draw, read, ctx);
+     }
+
+   if (current_thread_ctx == ctx &&
+       current_thread_draw == draw &&
+       current_thread_read == read)
+      return True;
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXMakeContextCurrent thread_param_local;
+   Thread_Command_glXMakeContextCurrent *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->draw = draw;
+   thread_param->read = read;
+   thread_param->ctx = ctx;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXMakeContextCurrent,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXGetCurrentContext(void);
+ */
+
+EAPI GLXContext
+glXGetCurrentContext_thread_cmd(void)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXGetCurrentContext();
+     }
+
+   return current_thread_ctx;
+}
+
+/*
+   void
+   glXDestroyContext(Display *dpy, GLXContext ctx);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXContext ctx;
+
+} Thread_Command_glXDestroyContext;
+
+static void
+_gl_thread_glXDestroyContext(void *data)
+{
+   Thread_Command_glXDestroyContext *thread_param =
+      (Thread_Command_glXDestroyContext *)data;
+
+   glXDestroyContext(thread_param->dpy,
+                     thread_param->ctx);
+
+}
+
+EAPI void
+glXDestroyContext_thread_cmd(Display *dpy, GLXContext ctx)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glXDestroyContext(dpy, ctx);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXDestroyContext thread_param_local;
+   Thread_Command_glXDestroyContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->ctx = ctx;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXDestroyContext,
+                              thread_param,
+                              thread_mode);
+}
+
+
+/*
+   void
+   glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable draw;
+   int attribute;
+   unsigned int *value;
+
+} Thread_Command_glXQueryDrawable;
+
+void (*orig_evas_glXQueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+
+EAPI void
+glXQueryDrawable_orig_evas_set(void *func)
+{
+   orig_evas_glXQueryDrawable = func;
+}
+
+EAPI void *
+glXQueryDrawable_orig_evas_get(void)
+{
+   return orig_evas_glXQueryDrawable;
+}
+
+static void
+_gl_thread_glXQueryDrawable(void *data)
+{
+   Thread_Command_glXQueryDrawable *thread_param =
+      (Thread_Command_glXQueryDrawable *)data;
+
+   orig_evas_glXQueryDrawable(thread_param->dpy,
+                              thread_param->draw,
+                              thread_param->attribute,
+                              thread_param->value);
+
+}
+
+EAPI void
+glXQueryDrawable_thread_cmd(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glXQueryDrawable(dpy, draw, attribute, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXQueryDrawable thread_param_local;
+   Thread_Command_glXQueryDrawable *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->draw = draw;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXQueryDrawable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   Bool
+   glXQueryExtension(Display *dpy, int *errorb, int *event);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   int *errorb;
+   int *event;
+
+} Thread_Command_glXQueryExtension;
+
+static void
+_gl_thread_glXQueryExtension(void *data)
+{
+   Thread_Command_glXQueryExtension *thread_param =
+      (Thread_Command_glXQueryExtension *)data;
+
+   thread_param->return_value = glXQueryExtension(thread_param->dpy,
+                                                  thread_param->errorb,
+                                                  thread_param->event);
+
+}
+
+EAPI Bool
+glXQueryExtension_thread_cmd(Display *dpy, int *errorb, int *event)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXQueryExtension(dpy, errorb, event);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXQueryExtension thread_param_local;
+   Thread_Command_glXQueryExtension *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->errorb = errorb;
+   thread_param->event = event;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXQueryExtension,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   const char *
+   glXQueryExtensionsString(Display *dpy, int screen);
+ */
+
+typedef struct
+{
+   const char * return_value;
+   Display *dpy;
+   int screen;
+
+} Thread_Command_glXQueryExtensionsString;
+
+static void
+_gl_thread_glXQueryExtensionsString(void *data)
+{
+   Thread_Command_glXQueryExtensionsString *thread_param =
+      (Thread_Command_glXQueryExtensionsString *)data;
+
+   thread_param->return_value = glXQueryExtensionsString(thread_param->dpy,
+                                                         thread_param->screen);
+
+}
+
+EAPI const char *
+glXQueryExtensionsString_thread_cmd(Display *dpy, int screen)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return glXQueryExtensionsString(dpy, screen);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXQueryExtensionsString thread_param_local;
+   Thread_Command_glXQueryExtensionsString *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->screen = screen;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXQueryExtensionsString,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Bool
+   glXReleaseBuffersMESA(Display *dpy, GLXDrawable drawable);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   GLXDrawable drawable;
+
+} Thread_Command_glXReleaseBuffersMESA;
+
+Bool (*orig_evas_glXReleaseBuffersMESA)(Display *dpy, GLXDrawable drawable);
+
+EAPI void
+glXReleaseBuffersMESA_orig_evas_set(void *func)
+{
+   orig_evas_glXReleaseBuffersMESA = func;
+}
+
+EAPI void *
+glXReleaseBuffersMESA_orig_evas_get(void)
+{
+   return orig_evas_glXReleaseBuffersMESA;
+}
+
+static void
+_gl_thread_glXReleaseBuffersMESA(void *data)
+{
+   Thread_Command_glXReleaseBuffersMESA *thread_param =
+      (Thread_Command_glXReleaseBuffersMESA *)data;
+
+   thread_param->return_value = orig_evas_glXReleaseBuffersMESA(thread_param->dpy,
+                                                                thread_param->drawable);
+
+}
+
+EAPI Bool
+glXReleaseBuffersMESA_thread_cmd(Display *dpy, GLXDrawable drawable)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glXReleaseBuffersMESA(dpy, drawable);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXReleaseBuffersMESA thread_param_local;
+   Thread_Command_glXReleaseBuffersMESA *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXReleaseBuffersMESA,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glXReleaseTexImage(Display *dpy, GLXDrawable drawable, int buffer);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int buffer;
+
+} Thread_Command_glXReleaseTexImage;
+
+void (*orig_evas_glXReleaseTexImage)(Display *dpy, GLXDrawable drawable, int buffer);
+
+EAPI void
+glXReleaseTexImage_orig_evas_set(void *func)
+{
+   orig_evas_glXReleaseTexImage = func;
+}
+
+EAPI void *
+glXReleaseTexImage_orig_evas_get(void)
+{
+   return orig_evas_glXReleaseTexImage;
+}
+
+static void
+_gl_thread_glXReleaseTexImage(void *data)
+{
+   Thread_Command_glXReleaseTexImage *thread_param =
+      (Thread_Command_glXReleaseTexImage *)data;
+
+   orig_evas_glXReleaseTexImage(thread_param->dpy,
+                                thread_param->drawable,
+                                thread_param->buffer);
+
+}
+
+EAPI void
+glXReleaseTexImage_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glXReleaseTexImage(dpy, drawable, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXReleaseTexImage thread_param_local;
+   Thread_Command_glXReleaseTexImage *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXReleaseTexImage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXSwapBuffers(Display *dpy, GLXDrawable drawable);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+
+} Thread_Command_glXSwapBuffers;
+
+static void
+_gl_thread_glXSwapBuffers(void *data)
+{
+   Thread_Command_glXSwapBuffers *thread_param =
+      (Thread_Command_glXSwapBuffers *)data;
+
+   glXSwapBuffers(thread_param->dpy,
+                  thread_param->drawable);
+
+}
+
+EAPI void
+glXSwapBuffers_thread_cmd(Display *dpy, GLXDrawable drawable)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        glXSwapBuffers(dpy, drawable);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXSwapBuffers thread_param_local;
+   Thread_Command_glXSwapBuffers *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXSwapBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXSwapIntervalEXT(Display *dpy, GLXDrawable drawable, int interval);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int interval;
+
+} Thread_Command_glXSwapIntervalEXT;
+
+void (*orig_evas_glXSwapIntervalEXT)(Display *dpy, GLXDrawable drawable, int interval);
+
+EAPI void
+glXSwapIntervalEXT_orig_evas_set(void *func)
+{
+   orig_evas_glXSwapIntervalEXT = func;
+}
+
+EAPI void *
+glXSwapIntervalEXT_orig_evas_get(void)
+{
+   return orig_evas_glXSwapIntervalEXT;
+}
+
+static void
+_gl_thread_glXSwapIntervalEXT(void *data)
+{
+   Thread_Command_glXSwapIntervalEXT *thread_param =
+      (Thread_Command_glXSwapIntervalEXT *)data;
+
+   orig_evas_glXSwapIntervalEXT(thread_param->dpy,
+                                thread_param->drawable,
+                                thread_param->interval);
+
+}
+
+EAPI void
+glXSwapIntervalEXT_thread_cmd(Display *dpy, GLXDrawable drawable, int interval)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        orig_evas_glXSwapIntervalEXT(dpy, drawable, interval);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXSwapIntervalEXT thread_param_local;
+   Thread_Command_glXSwapIntervalEXT *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->interval = interval;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXSwapIntervalEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glXSwapIntervalSGI(int interval);
+ */
+
+typedef struct
+{
+   int return_value;
+   int interval;
+
+} Thread_Command_glXSwapIntervalSGI;
+
+int (*orig_evas_glXSwapIntervalSGI)(int interval);
+
+EAPI void
+glXSwapIntervalSGI_orig_evas_set(void *func)
+{
+   orig_evas_glXSwapIntervalSGI = func;
+}
+
+EAPI void *
+glXSwapIntervalSGI_orig_evas_get(void)
+{
+   return orig_evas_glXSwapIntervalSGI;
+}
+
+static void
+_gl_thread_glXSwapIntervalSGI(void *data)
+{
+   Thread_Command_glXSwapIntervalSGI *thread_param =
+      (Thread_Command_glXSwapIntervalSGI *)data;
+
+   thread_param->return_value = orig_evas_glXSwapIntervalSGI(thread_param->interval);
+
+}
+
+EAPI int
+glXSwapIntervalSGI_thread_cmd(int interval)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glXSwapIntervalSGI(interval);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXSwapIntervalSGI thread_param_local;
+   Thread_Command_glXSwapIntervalSGI *thread_param = &thread_param_local;
+
+   thread_param->interval = interval;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXSwapIntervalSGI,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXWaitVideoSync(int divisor, int remainder, unsigned int *count);
+ */
+
+typedef struct
+{
+   int return_value;
+   int divisor;
+   int remainder;
+   unsigned int *count;
+
+} Thread_Command_glXWaitVideoSync;
+
+int (*orig_evas_glXWaitVideoSync)(int divisor, int remainder, unsigned int *count);
+
+EAPI void
+glXWaitVideoSync_orig_evas_set(void *func)
+{
+   orig_evas_glXWaitVideoSync = func;
+}
+
+EAPI void *
+glXWaitVideoSync_orig_evas_get(void)
+{
+   return orig_evas_glXWaitVideoSync;
+}
+
+static void
+_gl_thread_glXWaitVideoSync(void *data)
+{
+   Thread_Command_glXWaitVideoSync *thread_param =
+      (Thread_Command_glXWaitVideoSync *)data;
+
+   thread_param->return_value = orig_evas_glXWaitVideoSync(thread_param->divisor,
+                                                           thread_param->remainder,
+                                                           thread_param->count);
+
+}
+
+EAPI int
+glXWaitVideoSync_thread_cmd(int divisor, int remainder, unsigned int *count)
+{
+   if (!evas_gl_thread_enabled())
+     {
+        return orig_evas_glXWaitVideoSync(divisor, remainder, count);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   Thread_Command_glXWaitVideoSync thread_param_local;
+   Thread_Command_glXWaitVideoSync *thread_param = &thread_param_local;
+
+   thread_param->divisor = divisor;
+   thread_param->remainder = remainder;
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_glXWaitVideoSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/****** EVAS GL ******/
+/*
+   void
+   glXBindTexImage(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int buffer;
+   const int *attrib_list;
+
+} EVGL_Thread_Command_glXBindTexImage;
+
+void (*orig_evgl_glXBindTexImage)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+
+void
+glXBindTexImage_orig_evgl_set(void *func)
+{
+   orig_evgl_glXBindTexImage = func;
+}
+
+void *
+glXBindTexImage_orig_evgl_get(void)
+{
+   return orig_evgl_glXBindTexImage;
+}
+
+static void
+_evgl_thread_glXBindTexImage(void *data)
+{
+   EVGL_Thread_Command_glXBindTexImage *thread_param =
+      (EVGL_Thread_Command_glXBindTexImage *)data;
+
+   orig_evgl_glXBindTexImage(thread_param->dpy,
+                             thread_param->drawable,
+                             thread_param->buffer,
+                             thread_param->attrib_list);
+
+}
+
+EAPI void
+glXBindTexImage_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glXBindTexImage(dpy, drawable, buffer, attrib_list);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXBindTexImage thread_param_local;
+   EVGL_Thread_Command_glXBindTexImage *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->buffer = buffer;
+   thread_param->attrib_list = attrib_list;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXBindTexImage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   GLXFBConfig *
+   glXChooseFBConfig(Display *dpy, int screen, const int *attribList, int *nitems);
+ */
+
+typedef struct
+{
+   GLXFBConfig * return_value;
+   Display *dpy;
+   int screen;
+   const int *attribList;
+   int *nitems;
+
+} EVGL_Thread_Command_glXChooseFBConfig;
+
+static void
+_evgl_thread_glXChooseFBConfig(void *data)
+{
+   EVGL_Thread_Command_glXChooseFBConfig *thread_param =
+      (EVGL_Thread_Command_glXChooseFBConfig *)data;
+
+   thread_param->return_value = glXChooseFBConfig(thread_param->dpy,
+                                                  thread_param->screen,
+                                                  thread_param->attribList,
+                                                  thread_param->nitems);
+
+}
+
+EAPI GLXFBConfig *
+glXChooseFBConfig_evgl_thread_cmd(Display *dpy, int screen, const int *attribList, int *nitems)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXChooseFBConfig(dpy, screen, attribList, nitems);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXChooseFBConfig thread_param_local;
+   EVGL_Thread_Command_glXChooseFBConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->screen = screen;
+   thread_param->attribList = attribList;
+   thread_param->nitems = nitems;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXChooseFBConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXCreateContext(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+ */
+
+typedef struct
+{
+   GLXContext return_value;
+   Display *dpy;
+   XVisualInfo *vis;
+   GLXContext shareList;
+   Bool direct;
+
+} EVGL_Thread_Command_glXCreateContext;
+
+static void
+_evgl_thread_glXCreateContext(void *data)
+{
+   EVGL_Thread_Command_glXCreateContext *thread_param =
+      (EVGL_Thread_Command_glXCreateContext *)data;
+
+   thread_param->return_value = glXCreateContext(thread_param->dpy,
+                                                 thread_param->vis,
+                                                 thread_param->shareList,
+                                                 thread_param->direct);
+
+}
+
+EAPI GLXContext
+glXCreateContext_evgl_thread_cmd(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXCreateContext(dpy, vis, shareList, direct);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXCreateContext thread_param_local;
+   EVGL_Thread_Command_glXCreateContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->vis = vis;
+   thread_param->shareList = shareList;
+   thread_param->direct = direct;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXCreateContext,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXCreateNewContext(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+ */
+
+typedef struct
+{
+   GLXContext return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   int renderType;
+   GLXContext shareList;
+   Bool direct;
+
+} EVGL_Thread_Command_glXCreateNewContext;
+
+static void
+_evgl_thread_glXCreateNewContext(void *data)
+{
+   EVGL_Thread_Command_glXCreateNewContext *thread_param =
+      (EVGL_Thread_Command_glXCreateNewContext *)data;
+
+   thread_param->return_value = glXCreateNewContext(thread_param->dpy,
+                                                    thread_param->config,
+                                                    thread_param->renderType,
+                                                    thread_param->shareList,
+                                                    thread_param->direct);
+
+}
+
+EAPI GLXContext
+glXCreateNewContext_evgl_thread_cmd(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXCreateNewContext(dpy, config, renderType, shareList, direct);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXCreateNewContext thread_param_local;
+   EVGL_Thread_Command_glXCreateNewContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->renderType = renderType;
+   thread_param->shareList = shareList;
+   thread_param->direct = direct;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXCreateNewContext,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXPbuffer
+   glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXPbuffer return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   const int *attribList;
+
+} EVGL_Thread_Command_glXCreatePbuffer;
+
+static void
+_evgl_thread_glXCreatePbuffer(void *data)
+{
+   EVGL_Thread_Command_glXCreatePbuffer *thread_param =
+      (EVGL_Thread_Command_glXCreatePbuffer *)data;
+
+   thread_param->return_value = glXCreatePbuffer(thread_param->dpy,
+                                                 thread_param->config,
+                                                 thread_param->attribList);
+
+}
+
+EAPI GLXPbuffer
+glXCreatePbuffer_evgl_thread_cmd(Display *dpy, GLXFBConfig config, const int *attribList)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXCreatePbuffer(dpy, config, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXCreatePbuffer thread_param_local;
+   EVGL_Thread_Command_glXCreatePbuffer *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXCreatePbuffer,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXPixmap
+   glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXPixmap return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   Pixmap pixmap;
+   const int *attribList;
+
+} EVGL_Thread_Command_glXCreatePixmap;
+
+GLXPixmap (*orig_evgl_glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+
+void
+glXCreatePixmap_orig_evgl_set(void *func)
+{
+   orig_evgl_glXCreatePixmap = func;
+}
+
+void *
+glXCreatePixmap_orig_evgl_get(void)
+{
+   return orig_evgl_glXCreatePixmap;
+}
+
+static void
+_evgl_thread_glXCreatePixmap(void *data)
+{
+   EVGL_Thread_Command_glXCreatePixmap *thread_param =
+      (EVGL_Thread_Command_glXCreatePixmap *)data;
+
+   thread_param->return_value = orig_evgl_glXCreatePixmap(thread_param->dpy,
+                                                          thread_param->config,
+                                                          thread_param->pixmap,
+                                                          thread_param->attribList);
+
+}
+
+EAPI GLXPixmap
+glXCreatePixmap_evgl_thread_cmd(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return orig_evgl_glXCreatePixmap(dpy, config, pixmap, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXCreatePixmap thread_param_local;
+   EVGL_Thread_Command_glXCreatePixmap *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->pixmap = pixmap;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXCreatePixmap,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXWindow
+   glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+ */
+
+typedef struct
+{
+   GLXWindow return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   Window win;
+   const int *attribList;
+
+} EVGL_Thread_Command_glXCreateWindow;
+
+static void
+_evgl_thread_glXCreateWindow(void *data)
+{
+   EVGL_Thread_Command_glXCreateWindow *thread_param =
+      (EVGL_Thread_Command_glXCreateWindow *)data;
+
+   thread_param->return_value = glXCreateWindow(thread_param->dpy,
+                                                thread_param->config,
+                                                thread_param->win,
+                                                thread_param->attribList);
+
+}
+
+EAPI GLXWindow
+glXCreateWindow_evgl_thread_cmd(Display *dpy, GLXFBConfig config, Window win, const int *attribList)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXCreateWindow(dpy, config, win, attribList);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXCreateWindow thread_param_local;
+   EVGL_Thread_Command_glXCreateWindow *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->win = win;
+   thread_param->attribList = attribList;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXCreateWindow,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glXDestroyContext(Display *dpy, GLXContext ctx);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXContext ctx;
+
+} EVGL_Thread_Command_glXDestroyContext;
+
+static void
+_evgl_thread_glXDestroyContext(void *data)
+{
+   EVGL_Thread_Command_glXDestroyContext *thread_param =
+      (EVGL_Thread_Command_glXDestroyContext *)data;
+
+   glXDestroyContext(thread_param->dpy,
+                     thread_param->ctx);
+
+}
+
+EAPI void
+glXDestroyContext_evgl_thread_cmd(Display *dpy, GLXContext ctx)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glXDestroyContext(dpy, ctx);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXDestroyContext thread_param_local;
+   EVGL_Thread_Command_glXDestroyContext *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->ctx = ctx;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXDestroyContext,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXPbuffer pbuf;
+
+} EVGL_Thread_Command_glXDestroyPbuffer;
+
+static void
+_evgl_thread_glXDestroyPbuffer(void *data)
+{
+   EVGL_Thread_Command_glXDestroyPbuffer *thread_param =
+      (EVGL_Thread_Command_glXDestroyPbuffer *)data;
+
+   glXDestroyPbuffer(thread_param->dpy,
+                     thread_param->pbuf);
+
+}
+
+EAPI void
+glXDestroyPbuffer_evgl_thread_cmd(Display *dpy, GLXPbuffer pbuf)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glXDestroyPbuffer(dpy, pbuf);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXDestroyPbuffer thread_param_local;
+   EVGL_Thread_Command_glXDestroyPbuffer *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->pbuf = pbuf;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXDestroyPbuffer,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXPixmap pixmap;
+
+} EVGL_Thread_Command_glXDestroyPixmap;
+
+void (*orig_evgl_glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap);
+
+void
+glXDestroyPixmap_orig_evgl_set(void *func)
+{
+   orig_evgl_glXDestroyPixmap = func;
+}
+
+void *
+glXDestroyPixmap_orig_evgl_get(void)
+{
+   return orig_evgl_glXDestroyPixmap;
+}
+
+static void
+_evgl_thread_glXDestroyPixmap(void *data)
+{
+   EVGL_Thread_Command_glXDestroyPixmap *thread_param =
+      (EVGL_Thread_Command_glXDestroyPixmap *)data;
+
+   orig_evgl_glXDestroyPixmap(thread_param->dpy,
+                              thread_param->pixmap);
+
+}
+
+EAPI void
+glXDestroyPixmap_evgl_thread_cmd(Display *dpy, GLXPixmap pixmap)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glXDestroyPixmap(dpy, pixmap);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXDestroyPixmap thread_param_local;
+   EVGL_Thread_Command_glXDestroyPixmap *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->pixmap = pixmap;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXDestroyPixmap,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXDestroyWindow(Display *dpy, GLXWindow window);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXWindow window;
+
+} EVGL_Thread_Command_glXDestroyWindow;
+
+static void
+_evgl_thread_glXDestroyWindow(void *data)
+{
+   EVGL_Thread_Command_glXDestroyWindow *thread_param =
+      (EVGL_Thread_Command_glXDestroyWindow *)data;
+
+   glXDestroyWindow(thread_param->dpy,
+                    thread_param->window);
+
+}
+
+EAPI void
+glXDestroyWindow_evgl_thread_cmd(Display *dpy, GLXWindow window)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glXDestroyWindow(dpy, window);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXDestroyWindow thread_param_local;
+   EVGL_Thread_Command_glXDestroyWindow *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->window = window;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXDestroyWindow,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glXGetConfig(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+ */
+
+typedef struct
+{
+   int return_value;
+   Display *dpy;
+   XVisualInfo *visual;
+   int attrib;
+   int *value;
+
+} EVGL_Thread_Command_glXGetConfig;
+
+static void
+_evgl_thread_glXGetConfig(void *data)
+{
+   EVGL_Thread_Command_glXGetConfig *thread_param =
+      (EVGL_Thread_Command_glXGetConfig *)data;
+
+   thread_param->return_value = glXGetConfig(thread_param->dpy,
+                                             thread_param->visual,
+                                             thread_param->attrib,
+                                             thread_param->value);
+
+}
+
+EAPI int
+glXGetConfig_evgl_thread_cmd(Display *dpy, XVisualInfo *visual, int attrib, int *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXGetConfig(dpy, visual, attrib, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXGetConfig thread_param_local;
+   EVGL_Thread_Command_glXGetConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->visual = visual;
+   thread_param->attrib = attrib;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXGetConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config, int attribute, int *value);
+ */
+
+typedef struct
+{
+   int return_value;
+   Display *dpy;
+   GLXFBConfig config;
+   int attribute;
+   int *value;
+
+} EVGL_Thread_Command_glXGetFBConfigAttrib;
+
+static void
+_evgl_thread_glXGetFBConfigAttrib(void *data)
+{
+   EVGL_Thread_Command_glXGetFBConfigAttrib *thread_param =
+      (EVGL_Thread_Command_glXGetFBConfigAttrib *)data;
+
+   thread_param->return_value = glXGetFBConfigAttrib(thread_param->dpy,
+                                                     thread_param->config,
+                                                     thread_param->attribute,
+                                                     thread_param->value);
+
+}
+
+EAPI int
+glXGetFBConfigAttrib_evgl_thread_cmd(Display *dpy, GLXFBConfig config, int attribute, int *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXGetFBConfigAttrib(dpy, config, attribute, value);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXGetFBConfigAttrib thread_param_local;
+   EVGL_Thread_Command_glXGetFBConfigAttrib *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXGetFBConfigAttrib,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXGetVideoSync(unsigned int *count);
+ */
+
+typedef struct
+{
+   int return_value;
+   unsigned int *count;
+
+} EVGL_Thread_Command_glXGetVideoSync;
+
+int (*orig_evgl_glXGetVideoSync)(unsigned int *count);
+
+void
+glXGetVideoSync_orig_evgl_set(void *func)
+{
+   orig_evgl_glXGetVideoSync = func;
+}
+
+void *
+glXGetVideoSync_orig_evgl_get(void)
+{
+   return orig_evgl_glXGetVideoSync;
+}
+
+static void
+_evgl_thread_glXGetVideoSync(void *data)
+{
+   EVGL_Thread_Command_glXGetVideoSync *thread_param =
+      (EVGL_Thread_Command_glXGetVideoSync *)data;
+
+   thread_param->return_value = orig_evgl_glXGetVideoSync(thread_param->count);
+
+}
+
+EAPI int
+glXGetVideoSync_evgl_thread_cmd(unsigned int *count)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return orig_evgl_glXGetVideoSync(count);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXGetVideoSync thread_param_local;
+   EVGL_Thread_Command_glXGetVideoSync *thread_param = &thread_param_local;
+
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXGetVideoSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   XVisualInfo *
+   glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
+ */
+
+typedef struct
+{
+   XVisualInfo * return_value;
+   Display *dpy;
+   GLXFBConfig config;
+
+} EVGL_Thread_Command_glXGetVisualFromFBConfig;
+
+static void
+_evgl_thread_glXGetVisualFromFBConfig(void *data)
+{
+   EVGL_Thread_Command_glXGetVisualFromFBConfig *thread_param =
+      (EVGL_Thread_Command_glXGetVisualFromFBConfig *)data;
+
+   thread_param->return_value = glXGetVisualFromFBConfig(thread_param->dpy,
+                                                         thread_param->config);
+
+}
+
+EAPI XVisualInfo *
+glXGetVisualFromFBConfig_evgl_thread_cmd(Display *dpy, GLXFBConfig config)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXGetVisualFromFBConfig(dpy, config);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXGetVisualFromFBConfig thread_param_local;
+   EVGL_Thread_Command_glXGetVisualFromFBConfig *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->config = config;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXGetVisualFromFBConfig,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Bool
+   glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   GLXDrawable draw;
+   GLXDrawable read;
+   GLXContext ctx;
+
+} EVGL_Thread_Command_glXMakeContextCurrent;
+
+GLXContext current_evgl_thread_ctx = NULL;
+GLXDrawable current_evgl_thread_draw = NULL;
+GLXDrawable current_evgl_thread_read = NULL;
+
+static void
+_evgl_thread_glXMakeContextCurrent(void *data)
+{
+   EVGL_Thread_Command_glXMakeContextCurrent *thread_param =
+      (EVGL_Thread_Command_glXMakeContextCurrent *)data;
+
+   fprintf(stderr,"EVGL THREAD >> OTHER THREAD MAKECONTEXTCURRENT : (%p, %p, %p, %p)\n",
+                                 thread_param->dpy, (void *)thread_param->draw,
+                                 (void* )thread_param->read, thread_param->ctx);
+
+   thread_param->return_value = glXMakeContextCurrent(thread_param->dpy,
+                                                      thread_param->draw,
+                                                      thread_param->read,
+                                                      thread_param->ctx);
+
+   if (thread_param->return_value)
+     {
+        current_evgl_thread_ctx = thread_param->ctx;
+        current_evgl_thread_draw = thread_param->draw;
+        current_evgl_thread_read = thread_param->read;
+     }
+
+}
+
+EAPI Bool
+glXMakeContextCurrent_evgl_thread_cmd(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXMakeContextCurrent(dpy, draw, read, ctx);
+     }
+
+   if (current_evgl_thread_ctx == ctx &&
+       current_evgl_thread_draw == draw &&
+       current_evgl_thread_read == read)
+      return True;
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXMakeContextCurrent thread_param_local;
+   EVGL_Thread_Command_glXMakeContextCurrent *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->draw = draw;
+   thread_param->read = read;
+   thread_param->ctx = ctx;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXMakeContextCurrent,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   GLXContext
+   glXGetCurrentContext(void);
+ */
+
+EAPI GLXContext
+glXGetCurrentContext_evgl_thread_cmd(void)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXGetCurrentContext();
+     }
+
+   return current_evgl_thread_ctx;
+}
+
+
+/*
+   void
+   glXQueryDrawable(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable draw;
+   int attribute;
+   unsigned int *value;
+
+} EVGL_Thread_Command_glXQueryDrawable;
+
+void (*orig_evgl_glXQueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+
+void
+glXQueryDrawable_orig_evgl_set(void *func)
+{
+   orig_evgl_glXQueryDrawable = func;
+}
+
+void *
+glXQueryDrawable_orig_evgl_get(void)
+{
+   return orig_evgl_glXQueryDrawable;
+}
+
+static void
+_evgl_thread_glXQueryDrawable(void *data)
+{
+   EVGL_Thread_Command_glXQueryDrawable *thread_param =
+      (EVGL_Thread_Command_glXQueryDrawable *)data;
+
+   orig_evgl_glXQueryDrawable(thread_param->dpy,
+                              thread_param->draw,
+                              thread_param->attribute,
+                              thread_param->value);
+
+}
+
+EAPI void
+glXQueryDrawable_evgl_thread_cmd(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glXQueryDrawable(dpy, draw, attribute, value);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXQueryDrawable thread_param_local;
+   EVGL_Thread_Command_glXQueryDrawable *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->draw = draw;
+   thread_param->attribute = attribute;
+   thread_param->value = value;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXQueryDrawable,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   Bool
+   glXQueryExtension(Display *dpy, int *errorb, int *event);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   int *errorb;
+   int *event;
+
+} EVGL_Thread_Command_glXQueryExtension;
+
+static void
+_evgl_thread_glXQueryExtension(void *data)
+{
+   EVGL_Thread_Command_glXQueryExtension *thread_param =
+      (EVGL_Thread_Command_glXQueryExtension *)data;
+
+   thread_param->return_value = glXQueryExtension(thread_param->dpy,
+                                                  thread_param->errorb,
+                                                  thread_param->event);
+
+}
+
+EAPI Bool
+glXQueryExtension_evgl_thread_cmd(Display *dpy, int *errorb, int *event)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXQueryExtension(dpy, errorb, event);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXQueryExtension thread_param_local;
+   EVGL_Thread_Command_glXQueryExtension *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->errorb = errorb;
+   thread_param->event = event;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXQueryExtension,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   const char *
+   glXQueryExtensionsString(Display *dpy, int screen);
+ */
+
+typedef struct
+{
+   const char * return_value;
+   Display *dpy;
+   int screen;
+
+} EVGL_Thread_Command_glXQueryExtensionsString;
+
+static void
+_evgl_thread_glXQueryExtensionsString(void *data)
+{
+   EVGL_Thread_Command_glXQueryExtensionsString *thread_param =
+      (EVGL_Thread_Command_glXQueryExtensionsString *)data;
+
+   thread_param->return_value = glXQueryExtensionsString(thread_param->dpy,
+                                                         thread_param->screen);
+
+}
+
+EAPI const char *
+glXQueryExtensionsString_evgl_thread_cmd(Display *dpy, int screen)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return glXQueryExtensionsString(dpy, screen);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXQueryExtensionsString thread_param_local;
+   EVGL_Thread_Command_glXQueryExtensionsString *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->screen = screen;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXQueryExtensionsString,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   Bool
+   glXReleaseBuffersMESA(Display *dpy, GLXDrawable drawable);
+ */
+
+typedef struct
+{
+   Bool return_value;
+   Display *dpy;
+   GLXDrawable drawable;
+
+} EVGL_Thread_Command_glXReleaseBuffersMESA;
+
+Bool (*orig_evgl_glXReleaseBuffersMESA)(Display *dpy, GLXDrawable drawable);
+
+void
+glXReleaseBuffersMESA_orig_evgl_set(void *func)
+{
+   orig_evgl_glXReleaseBuffersMESA = func;
+}
+
+void *
+glXReleaseBuffersMESA_orig_evgl_get(void)
+{
+   return orig_evgl_glXReleaseBuffersMESA;
+}
+
+static void
+_evgl_thread_glXReleaseBuffersMESA(void *data)
+{
+   EVGL_Thread_Command_glXReleaseBuffersMESA *thread_param =
+      (EVGL_Thread_Command_glXReleaseBuffersMESA *)data;
+
+   thread_param->return_value = orig_evgl_glXReleaseBuffersMESA(thread_param->dpy,
+                                                                thread_param->drawable);
+
+}
+
+EAPI Bool
+glXReleaseBuffersMESA_evgl_thread_cmd(Display *dpy, GLXDrawable drawable)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return orig_evgl_glXReleaseBuffersMESA(dpy, drawable);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXReleaseBuffersMESA thread_param_local;
+   EVGL_Thread_Command_glXReleaseBuffersMESA *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXReleaseBuffersMESA,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   void
+   glXReleaseTexImage(Display *dpy, GLXDrawable drawable, int buffer);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int buffer;
+
+} EVGL_Thread_Command_glXReleaseTexImage;
+
+void (*orig_evgl_glXReleaseTexImage)(Display *dpy, GLXDrawable drawable, int buffer);
+
+void
+glXReleaseTexImage_orig_evgl_set(void *func)
+{
+   orig_evgl_glXReleaseTexImage = func;
+}
+
+void *
+glXReleaseTexImage_orig_evgl_get(void)
+{
+   return orig_evgl_glXReleaseTexImage;
+}
+
+static void
+_evgl_thread_glXReleaseTexImage(void *data)
+{
+   EVGL_Thread_Command_glXReleaseTexImage *thread_param =
+      (EVGL_Thread_Command_glXReleaseTexImage *)data;
+
+   orig_evgl_glXReleaseTexImage(thread_param->dpy,
+                                thread_param->drawable,
+                                thread_param->buffer);
+
+}
+
+EAPI void
+glXReleaseTexImage_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glXReleaseTexImage(dpy, drawable, buffer);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXReleaseTexImage thread_param_local;
+   EVGL_Thread_Command_glXReleaseTexImage *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->buffer = buffer;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXReleaseTexImage,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXSwapBuffers(Display *dpy, GLXDrawable drawable);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+
+} EVGL_Thread_Command_glXSwapBuffers;
+
+static void
+_evgl_thread_glXSwapBuffers(void *data)
+{
+   EVGL_Thread_Command_glXSwapBuffers *thread_param =
+      (EVGL_Thread_Command_glXSwapBuffers *)data;
+
+   glXSwapBuffers(thread_param->dpy,
+                  thread_param->drawable);
+
+}
+
+EAPI void
+glXSwapBuffers_evgl_thread_cmd(Display *dpy, GLXDrawable drawable)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        glXSwapBuffers(dpy, drawable);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXSwapBuffers thread_param_local;
+   EVGL_Thread_Command_glXSwapBuffers *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXSwapBuffers,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   void
+   glXSwapIntervalEXT(Display *dpy, GLXDrawable drawable, int interval);
+ */
+
+typedef struct
+{
+   Display *dpy;
+   GLXDrawable drawable;
+   int interval;
+
+} EVGL_Thread_Command_glXSwapIntervalEXT;
+
+void (*orig_evgl_glXSwapIntervalEXT)(Display *dpy, GLXDrawable drawable, int interval);
+
+void
+glXSwapIntervalEXT_orig_evgl_set(void *func)
+{
+   orig_evgl_glXSwapIntervalEXT = func;
+}
+
+void *
+glXSwapIntervalEXT_orig_evgl_get(void)
+{
+   return orig_evgl_glXSwapIntervalEXT;
+}
+
+static void
+_evgl_thread_glXSwapIntervalEXT(void *data)
+{
+   EVGL_Thread_Command_glXSwapIntervalEXT *thread_param =
+      (EVGL_Thread_Command_glXSwapIntervalEXT *)data;
+
+   orig_evgl_glXSwapIntervalEXT(thread_param->dpy,
+                                thread_param->drawable,
+                                thread_param->interval);
+
+}
+
+EAPI void
+glXSwapIntervalEXT_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int interval)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        orig_evgl_glXSwapIntervalEXT(dpy, drawable, interval);
+        return;
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXSwapIntervalEXT thread_param_local;
+   EVGL_Thread_Command_glXSwapIntervalEXT *thread_param = &thread_param_local;
+
+   thread_param->dpy = dpy;
+   thread_param->drawable = drawable;
+   thread_param->interval = interval;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXSwapIntervalEXT,
+                              thread_param,
+                              thread_mode);
+}
+
+/*
+   int
+   glXSwapIntervalSGI(int interval);
+ */
+
+typedef struct
+{
+   int return_value;
+   int interval;
+
+} EVGL_Thread_Command_glXSwapIntervalSGI;
+
+int (*orig_evgl_glXSwapIntervalSGI)(int interval);
+
+void
+glXSwapIntervalSGI_orig_evgl_set(void *func)
+{
+   orig_evgl_glXSwapIntervalSGI = func;
+}
+
+void *
+glXSwapIntervalSGI_orig_evgl_get(void)
+{
+   return orig_evgl_glXSwapIntervalSGI;
+}
+
+static void
+_evgl_thread_glXSwapIntervalSGI(void *data)
+{
+   EVGL_Thread_Command_glXSwapIntervalSGI *thread_param =
+      (EVGL_Thread_Command_glXSwapIntervalSGI *)data;
+
+   thread_param->return_value = orig_evgl_glXSwapIntervalSGI(thread_param->interval);
+
+}
+
+EAPI int
+glXSwapIntervalSGI_evgl_thread_cmd(int interval)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return orig_evgl_glXSwapIntervalSGI(interval);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXSwapIntervalSGI thread_param_local;
+   EVGL_Thread_Command_glXSwapIntervalSGI *thread_param = &thread_param_local;
+
+   thread_param->interval = interval;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXSwapIntervalSGI,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+/*
+   int
+   glXWaitVideoSync(int divisor, int remainder, unsigned int *count);
+ */
+
+typedef struct
+{
+   int return_value;
+   int divisor;
+   int remainder;
+   unsigned int *count;
+
+} EVGL_Thread_Command_glXWaitVideoSync;
+
+int (*orig_evgl_glXWaitVideoSync)(int divisor, int remainder, unsigned int *count);
+
+void
+glXWaitVideoSync_orig_evgl_set(void *func)
+{
+   orig_evgl_glXWaitVideoSync = func;
+}
+
+void *
+glXWaitVideoSync_orig_evgl_get(void)
+{
+   return orig_evgl_glXWaitVideoSync;
+}
+
+static void
+_evgl_thread_glXWaitVideoSync(void *data)
+{
+   EVGL_Thread_Command_glXWaitVideoSync *thread_param =
+      (EVGL_Thread_Command_glXWaitVideoSync *)data;
+
+   thread_param->return_value = orig_evgl_glXWaitVideoSync(thread_param->divisor,
+                                                           thread_param->remainder,
+                                                           thread_param->count);
+
+}
+
+EAPI int
+glXWaitVideoSync_evgl_thread_cmd(int divisor, int remainder, unsigned int *count)
+{
+   if (!evas_evgl_thread_enabled())
+     {
+        return orig_evgl_glXWaitVideoSync(divisor, remainder, count);
+     }
+
+   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
+
+   EVGL_Thread_Command_glXWaitVideoSync thread_param_local;
+   EVGL_Thread_Command_glXWaitVideoSync *thread_param = &thread_param_local;
+
+   thread_param->divisor = divisor;
+   thread_param->remainder = remainder;
+   thread_param->count = count;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_glXWaitVideoSync,
+                              thread_param,
+                              thread_mode);
+
+   return thread_param->return_value;
+}
+
+
+#else /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#include <dlfcn.h>
+
+
+void (*glXBindTexImage_orig_evas_set)(void *func) = NULL;
+void *(*glXBindTexImage_orig_evas_get)(void) = NULL;
+void (*glXBindTexImage_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list) = NULL;
+GLXFBConfig * (*glXChooseFBConfig_thread_cmd)(Display *dpy, int screen, const int *attribList, int *nitems) = NULL;
+GLXContext (*glXCreateContext_thread_cmd)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct) = NULL;
+GLXContext (*glXCreateNewContext_thread_cmd)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct) = NULL;
+GLXPbuffer (*glXCreatePbuffer_thread_cmd)(Display *dpy, GLXFBConfig config, const int *attribList) = NULL;
+void (*glXCreatePixmap_orig_evas_set)(void *func) = NULL;
+void *(*glXCreatePixmap_orig_evas_get)(void) = NULL;
+GLXPixmap (*glXCreatePixmap_thread_cmd)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList) = NULL;
+GLXWindow (*glXCreateWindow_thread_cmd)(Display *dpy, GLXFBConfig config, Window win, const int *attribList) = NULL;
+void (*glXDestroyContext_thread_cmd)(Display *dpy, GLXContext ctx) = NULL;
+void (*glXDestroyPbuffer_thread_cmd)(Display *dpy, GLXPbuffer pbuf) = NULL;
+void (*glXDestroyPixmap_orig_evas_set)(void *func) = NULL;
+void *(*glXDestroyPixmap_orig_evas_get)(void) = NULL;
+void (*glXDestroyPixmap_thread_cmd)(Display *dpy, GLXPixmap pixmap) = NULL;
+void (*glXDestroyWindow_thread_cmd)(Display *dpy, GLXWindow window) = NULL;
+int (*glXGetConfig_thread_cmd)(Display *dpy, XVisualInfo *visual, int attrib, int *value) = NULL;
+GLXContext (*glXGetCurrentContext_thread_cmd)(void) = NULL;
+int (*glXGetFBConfigAttrib_thread_cmd)(Display *dpy, GLXFBConfig config, int attribute, int *value) = NULL;
+void (*glXGetVideoSync_orig_evas_set)(void *func) = NULL;
+void *(*glXGetVideoSync_orig_evas_get)(void) = NULL;
+int (*glXGetVideoSync_thread_cmd)(unsigned int *count) = NULL;
+XVisualInfo * (*glXGetVisualFromFBConfig_thread_cmd)(Display *dpy, GLXFBConfig config) = NULL;
+Bool (*glXMakeContextCurrent_thread_cmd)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) = NULL;
+void (*glXQueryDrawable_orig_evas_set)(void *func) = NULL;
+void *(*glXQueryDrawable_orig_evas_get)(void) = NULL;
+void (*glXQueryDrawable_thread_cmd)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value) = NULL;
+Bool (*glXQueryExtension_thread_cmd)(Display *dpy, int *errorb, int *event) = NULL;
+const char * (*glXQueryExtensionsString_thread_cmd)(Display *dpy, int screen) = NULL;
+void (*glXReleaseBuffersMESA_orig_evas_set)(void *func) = NULL;
+void *(*glXReleaseBuffersMESA_orig_evas_get)(void) = NULL;
+Bool (*glXReleaseBuffersMESA_thread_cmd)(Display *dpy, GLXDrawable drawable) = NULL;
+void (*glXReleaseTexImage_orig_evas_set)(void *func) = NULL;
+void *(*glXReleaseTexImage_orig_evas_get)(void) = NULL;
+void (*glXReleaseTexImage_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer) = NULL;
+void (*glXSwapBuffers_thread_cmd)(Display *dpy, GLXDrawable drawable) = NULL;
+void (*glXSwapIntervalEXT_orig_evas_set)(void *func) = NULL;
+void *(*glXSwapIntervalEXT_orig_evas_get)(void) = NULL;
+void (*glXSwapIntervalEXT_thread_cmd)(Display *dpy, GLXDrawable drawable, int interval) = NULL;
+void (*glXSwapIntervalSGI_orig_evas_set)(void *func) = NULL;
+void *(*glXSwapIntervalSGI_orig_evas_get)(void) = NULL;
+int (*glXSwapIntervalSGI_thread_cmd)(int interval) = NULL;
+void (*glXWaitVideoSync_orig_evas_set)(void *func) = NULL;
+void *(*glXWaitVideoSync_orig_evas_get)(void) = NULL;
+int (*glXWaitVideoSync_thread_cmd)(int divisor, int remainder, unsigned int *count) = NULL;
+
+/****** EVAS GL ******/
+
+void (*glXBindTexImage_orig_evgl_set)(void *func) = NULL;
+void *(*glXBindTexImage_orig_evgl_get)(void) = NULL;
+void (*glXBindTexImage_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list) = NULL;
+GLXFBConfig * (*glXChooseFBConfig_evgl_thread_cmd)(Display *dpy, int screen, const int *attribList, int *nitems) = NULL;
+GLXContext (*glXCreateContext_evgl_thread_cmd)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct) = NULL;
+GLXContext (*glXCreateNewContext_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct) = NULL;
+GLXPbuffer (*glXCreatePbuffer_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, const int *attribList) = NULL;
+void (*glXCreatePixmap_orig_evgl_set)(void *func) = NULL;
+void *(*glXCreatePixmap_orig_evgl_get)(void) = NULL;
+GLXPixmap (*glXCreatePixmap_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList) = NULL;
+GLXWindow (*glXCreateWindow_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, Window win, const int *attribList) = NULL;
+void (*glXDestroyContext_evgl_thread_cmd)(Display *dpy, GLXContext ctx) = NULL;
+void (*glXDestroyPbuffer_evgl_thread_cmd)(Display *dpy, GLXPbuffer pbuf) = NULL;
+void (*glXDestroyPixmap_orig_evgl_set)(void *func) = NULL;
+void *(*glXDestroyPixmap_orig_evgl_get)(void) = NULL;
+void (*glXDestroyPixmap_evgl_thread_cmd)(Display *dpy, GLXPixmap pixmap) = NULL;
+void (*glXDestroyWindow_evgl_thread_cmd)(Display *dpy, GLXWindow window) = NULL;
+int (*glXGetConfig_evgl_thread_cmd)(Display *dpy, XVisualInfo *visual, int attrib, int *value) = NULL;
+GLXContext (*glXGetCurrentContext_evgl_thread_cmd)(void) = NULL;
+int (*glXGetFBConfigAttrib_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, int attribute, int *value) = NULL;
+void (*glXGetVideoSync_orig_evgl_set)(void *func) = NULL;
+void *(*glXGetVideoSync_orig_evgl_get)(void) = NULL;
+int (*glXGetVideoSync_evgl_thread_cmd)(unsigned int *count) = NULL;
+XVisualInfo * (*glXGetVisualFromFBConfig_evgl_thread_cmd)(Display *dpy, GLXFBConfig config) = NULL;
+Bool (*glXMakeContextCurrent_evgl_thread_cmd)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx) = NULL;
+void (*glXQueryDrawable_orig_evgl_set)(void *func) = NULL;
+void *(*glXQueryDrawable_orig_evgl_get)(void) = NULL;
+void (*glXQueryDrawable_evgl_thread_cmd)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value) = NULL;
+Bool (*glXQueryExtension_evgl_thread_cmd)(Display *dpy, int *errorb, int *event) = NULL;
+const char * (*glXQueryExtensionsString_evgl_thread_cmd)(Display *dpy, int screen) = NULL;
+void (*glXReleaseBuffersMESA_orig_evgl_set)(void *func) = NULL;
+void *(*glXReleaseBuffersMESA_orig_evgl_get)(void) = NULL;
+Bool (*glXReleaseBuffersMESA_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable) = NULL;
+void (*glXReleaseTexImage_orig_evgl_set)(void *func) = NULL;
+void *(*glXReleaseTexImage_orig_evgl_get)(void) = NULL;
+void (*glXReleaseTexImage_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer) = NULL;
+void (*glXSwapBuffers_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable) = NULL;
+void (*glXSwapIntervalEXT_orig_evgl_set)(void *func) = NULL;
+void *(*glXSwapIntervalEXT_orig_evgl_get)(void) = NULL;
+void (*glXSwapIntervalEXT_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int interval) = NULL;
+void (*glXSwapIntervalSGI_orig_evgl_set)(void *func) = NULL;
+void *(*glXSwapIntervalSGI_orig_evgl_get)(void) = NULL;
+int (*glXSwapIntervalSGI_evgl_thread_cmd)(int interval) = NULL;
+void (*glXWaitVideoSync_orig_evgl_set)(void *func) = NULL;
+void *(*glXWaitVideoSync_orig_evgl_get)(void) = NULL;
+int (*glXWaitVideoSync_evgl_thread_cmd)(int divisor, int remainder, unsigned int *count) = NULL;
+
+
+
+void _glx_thread_link_init()
+{
+#define LINK2GENERIC(sym) \
+   sym = dlsym(RTLD_DEFAULT, #sym); \
+   if (!sym) ERR("Could not find function '%s'", #sym);
+
+   LINK2GENERIC(glXBindTexImage_orig_evas_set);
+   LINK2GENERIC(glXBindTexImage_orig_evas_get);
+   LINK2GENERIC(glXBindTexImage_thread_cmd);
+   LINK2GENERIC(glXChooseFBConfig_thread_cmd);
+   LINK2GENERIC(glXCreateContext_thread_cmd);
+   LINK2GENERIC(glXCreateNewContext_thread_cmd);
+   LINK2GENERIC(glXCreatePbuffer_thread_cmd);
+   LINK2GENERIC(glXCreatePixmap_orig_evas_set);
+   LINK2GENERIC(glXCreatePixmap_orig_evas_get);
+   LINK2GENERIC(glXCreatePixmap_thread_cmd);
+   LINK2GENERIC(glXCreateWindow_thread_cmd);
+   LINK2GENERIC(glXDestroyContext_thread_cmd);
+   LINK2GENERIC(glXDestroyPbuffer_thread_cmd);
+   LINK2GENERIC(glXDestroyPixmap_orig_evas_set);
+   LINK2GENERIC(glXDestroyPixmap_orig_evas_get);
+   LINK2GENERIC(glXDestroyPixmap_thread_cmd);
+   LINK2GENERIC(glXDestroyWindow_thread_cmd);
+   LINK2GENERIC(glXGetConfig_thread_cmd);
+   LINK2GENERIC(glXGetCurrentContext_thread_cmd);
+   LINK2GENERIC(glXGetFBConfigAttrib_thread_cmd);
+   LINK2GENERIC(glXGetVideoSync_orig_evas_set);
+   LINK2GENERIC(glXGetVideoSync_orig_evas_get);
+   LINK2GENERIC(glXGetVideoSync_thread_cmd);
+   LINK2GENERIC(glXGetVisualFromFBConfig_thread_cmd);
+   LINK2GENERIC(glXMakeContextCurrent_thread_cmd);
+   LINK2GENERIC(glXQueryDrawable_orig_evas_set);
+   LINK2GENERIC(glXQueryDrawable_orig_evas_get);
+   LINK2GENERIC(glXQueryDrawable_thread_cmd);
+   LINK2GENERIC(glXQueryExtension_thread_cmd);
+   LINK2GENERIC(glXQueryExtensionsString_thread_cmd);
+   LINK2GENERIC(glXReleaseBuffersMESA_orig_evas_set);
+   LINK2GENERIC(glXReleaseBuffersMESA_orig_evas_get);
+   LINK2GENERIC(glXReleaseBuffersMESA_thread_cmd);
+   LINK2GENERIC(glXReleaseTexImage_orig_evas_set);
+   LINK2GENERIC(glXReleaseTexImage_orig_evas_get);
+   LINK2GENERIC(glXReleaseTexImage_thread_cmd);
+   LINK2GENERIC(glXSwapBuffers_thread_cmd);
+   LINK2GENERIC(glXSwapIntervalEXT_orig_evas_set);
+   LINK2GENERIC(glXSwapIntervalEXT_orig_evas_get);
+   LINK2GENERIC(glXSwapIntervalEXT_thread_cmd);
+   LINK2GENERIC(glXSwapIntervalSGI_orig_evas_set);
+   LINK2GENERIC(glXSwapIntervalSGI_orig_evas_get);
+   LINK2GENERIC(glXSwapIntervalSGI_thread_cmd);
+   LINK2GENERIC(glXWaitVideoSync_orig_evas_set);
+   LINK2GENERIC(glXWaitVideoSync_orig_evas_get);
+   LINK2GENERIC(glXWaitVideoSync_thread_cmd);
+
+   /****** EVAS GL ******/
+
+   LINK2GENERIC(glXBindTexImage_orig_evgl_set);
+   LINK2GENERIC(glXBindTexImage_orig_evgl_get);
+   LINK2GENERIC(glXBindTexImage_evgl_thread_cmd);
+   LINK2GENERIC(glXChooseFBConfig_evgl_thread_cmd);
+   LINK2GENERIC(glXCreateContext_evgl_thread_cmd);
+   LINK2GENERIC(glXCreateNewContext_evgl_thread_cmd);
+   LINK2GENERIC(glXCreatePbuffer_evgl_thread_cmd);
+   LINK2GENERIC(glXCreatePixmap_orig_evgl_set);
+   LINK2GENERIC(glXCreatePixmap_orig_evgl_get);
+   LINK2GENERIC(glXCreatePixmap_evgl_thread_cmd);
+   LINK2GENERIC(glXCreateWindow_evgl_thread_cmd);
+   LINK2GENERIC(glXDestroyContext_evgl_thread_cmd);
+   LINK2GENERIC(glXDestroyPbuffer_evgl_thread_cmd);
+   LINK2GENERIC(glXDestroyPixmap_orig_evgl_set);
+   LINK2GENERIC(glXDestroyPixmap_orig_evgl_get);
+   LINK2GENERIC(glXDestroyPixmap_evgl_thread_cmd);
+   LINK2GENERIC(glXDestroyWindow_evgl_thread_cmd);
+   LINK2GENERIC(glXGetConfig_evgl_thread_cmd);
+   LINK2GENERIC(glXGetCurrentContext_evgl_thread_cmd);
+   LINK2GENERIC(glXGetFBConfigAttrib_evgl_thread_cmd);
+   LINK2GENERIC(glXGetVideoSync_orig_evgl_set);
+   LINK2GENERIC(glXGetVideoSync_orig_evgl_get);
+   LINK2GENERIC(glXGetVideoSync_evgl_thread_cmd);
+   LINK2GENERIC(glXGetVisualFromFBConfig_evgl_thread_cmd);
+   LINK2GENERIC(glXMakeContextCurrent_evgl_thread_cmd);
+   LINK2GENERIC(glXQueryDrawable_orig_evgl_set);
+   LINK2GENERIC(glXQueryDrawable_orig_evgl_get);
+   LINK2GENERIC(glXQueryDrawable_evgl_thread_cmd);
+   LINK2GENERIC(glXQueryExtension_evgl_thread_cmd);
+   LINK2GENERIC(glXQueryExtensionsString_evgl_thread_cmd);
+   LINK2GENERIC(glXReleaseBuffersMESA_orig_evgl_set);
+   LINK2GENERIC(glXReleaseBuffersMESA_orig_evgl_get);
+   LINK2GENERIC(glXReleaseBuffersMESA_evgl_thread_cmd);
+   LINK2GENERIC(glXReleaseTexImage_orig_evgl_set);
+   LINK2GENERIC(glXReleaseTexImage_orig_evgl_get);
+   LINK2GENERIC(glXReleaseTexImage_evgl_thread_cmd);
+   LINK2GENERIC(glXSwapBuffers_evgl_thread_cmd);
+   LINK2GENERIC(glXSwapIntervalEXT_orig_evgl_set);
+   LINK2GENERIC(glXSwapIntervalEXT_orig_evgl_get);
+   LINK2GENERIC(glXSwapIntervalEXT_evgl_thread_cmd);
+   LINK2GENERIC(glXSwapIntervalSGI_orig_evgl_set);
+   LINK2GENERIC(glXSwapIntervalSGI_orig_evgl_get);
+   LINK2GENERIC(glXSwapIntervalSGI_evgl_thread_cmd);
+   LINK2GENERIC(glXWaitVideoSync_orig_evgl_set);
+   LINK2GENERIC(glXWaitVideoSync_orig_evgl_get);
+   LINK2GENERIC(glXWaitVideoSync_evgl_thread_cmd);
+}
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+#endif /* ! GL_GLES */
diff --git a/src/modules/evas/engines/gl_common/evas_gl_thread_glx.h b/src/modules/evas/engines/gl_common/evas_gl_thread_glx.h
new file mode 100644 (file)
index 0000000..42912f7
--- /dev/null
@@ -0,0 +1,257 @@
+#ifndef EVAS_GL_THREAD_GLX_H
+#define EVAS_GL_THREAD_GLX_H
+
+#ifndef GL_GLES
+
+# include <GL/glx.h>
+
+#ifdef EVAS_GL_RENDER_THREAD_IS_GENERIC
+
+#define GL_GLEXT_PROTOTYPES
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EVAS_BUILD
+#  ifdef DLL_EXPORT
+#   define EAPI __declspec(dllexport)
+#  else
+#   define EAPI
+#  endif /* ! DLL_EXPORT */
+# else
+#  define EAPI __declspec(dllimport)
+# endif /* ! EFL_EVAS_BUILD */
+#else
+# ifdef __GNUC__
+#  if __GNUC__ >= 4
+#   define EAPI __attribute__ ((visibility("default")))
+#  else
+#   define EAPI
+#  endif
+# else
+#  define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+
+EAPI void glXBindTexImage_orig_evas_set(void *func);
+EAPI void *glXBindTexImage_orig_evas_get(void);
+EAPI void glXBindTexImage_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+EAPI GLXFBConfig * glXChooseFBConfig_thread_cmd(Display *dpy, int screen, const int *attribList, int *nitems);
+EAPI GLXContext glXCreateContext_thread_cmd(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+EAPI GLXContext glXCreateNewContext_thread_cmd(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+EAPI GLXPbuffer glXCreatePbuffer_thread_cmd(Display *dpy, GLXFBConfig config, const int *attribList);
+EAPI void glXCreatePixmap_orig_evas_set(void *func);
+EAPI void *glXCreatePixmap_orig_evas_get(void);
+EAPI GLXPixmap glXCreatePixmap_thread_cmd(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+EAPI GLXWindow glXCreateWindow_thread_cmd(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+EAPI void glXDestroyContext_thread_cmd(Display *dpy, GLXContext ctx);
+EAPI void glXDestroyPbuffer_thread_cmd(Display *dpy, GLXPbuffer pbuf);
+EAPI void glXDestoyPixmap_orig_evas_set(void *func);
+EAPI void *glXDestoyPixmap_orig_evas_get(void);
+EAPI void glXDestroyPixmap_thread_cmd(Display *dpy, GLXPixmap pixmap);
+EAPI void glXDestroyWindow_thread_cmd(Display *dpy, GLXWindow window);
+EAPI int glXGetConfig_thread_cmd(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+EAPI GLXContext glXGetCurrentContext_thread_cmd(void);
+EAPI int glXGetFBConfigAttrib_thread_cmd(Display *dpy, GLXFBConfig config, int attribute, int *value);
+
+EAPI void glXGetVideoSync_orig_evas_set(void *func);
+EAPI void *glXGetVideoSync_orig_evas_get(void);
+EAPI int glXGetVideoSync_thread_cmd(unsigned int *count);
+EAPI XVisualInfo * glXGetVisualFromFBConfig_thread_cmd(Display *dpy, GLXFBConfig config);
+EAPI Bool glXMakeContextCurrent_thread_cmd(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+EAPI void glXQueryDrawable_orig_evas_set(void *func);
+EAPI void *glXQueryDrawable_orig_evas_get(void);
+EAPI void glXQueryDrawable_thread_cmd(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+EAPI Bool glXQueryExtension_thread_cmd(Display *dpy, int *errorb, int *event);
+EAPI const char * glXQueryExtensionsString_thread_cmd(Display *dpy, int screen);
+
+EAPI void glXReleaseBuffersMESA_orig_evas_set(void *func);
+EAPI void *glXReleaseBuffersMESA_orig_evas_get(void);
+EAPI Bool glXReleaseBuffersMESA_thread_cmd(Display *dpy, GLXDrawable drawable);
+
+EAPI void glXReleaseTexImageEXT_orig_evas_set(void *func);
+EAPI void *glXReleaseTexImageEXT_orig_evas_get(void);
+EAPI void glXReleaseTexImageEXT_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer);
+EAPI void glXSwapBuffers_thread_cmd(Display *dpy, GLXDrawable drawable);
+
+EAPI void glXSwapIntervalEXT_orig_evas_set(void *func);
+EAPI void *glXSwapIntervalEXT_orig_evas_get(void);
+EAPI void glXSwapIntervalEXT_thread_cmd(Display *dpy, GLXDrawable drawable, int interval);
+
+EAPI void glXSwapIntervalSGI_orig_evas_set(void *func);
+EAPI void *glXSwapIntervalSGI_orig_evas_get(void);
+EAPI int glXSwapIntervalSGI_thread_cmd(int interval);
+
+EAPI void glXWaitVideoSync_orig_evas_set(void *func);
+EAPI void *glXWaitVideoSync_orig_evas_get(void);
+EAPI int glXWaitVideoSync_thread_cmd(int divisor, int remainder, unsigned int *count);
+
+/****** EVAS GL ******/
+
+EAPI void glXBindTexImage_orig_evgl_set(void *func);
+EAPI void *glXBindTexImage_orig_evgl_get(void);
+EAPI void glXBindTexImage_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+EAPI GLXFBConfig * glXChooseFBConfig_evgl_thread_cmd(Display *dpy, int screen, const int *attribList, int *nitems);
+EAPI GLXContext glXCreateContext_evgl_thread_cmd(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+EAPI GLXContext glXCreateNewContext_evgl_thread_cmd(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+EAPI GLXPbuffer glXCreatePbuffer_evgl_thread_cmd(Display *dpy, GLXFBConfig config, const int *attribList);
+
+EAPI void glXCreatePixmap_orig_evgl_set(void *func);
+EAPI void *glXCreatePixmap_orig_evgl_get(void);
+EAPI GLXPixmap glXCreatePixmap_evgl_thread_cmd(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+EAPI GLXWindow glXCreateWindow_evgl_thread_cmd(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+EAPI void glXDestroyContext_evgl_thread_cmd(Display *dpy, GLXContext ctx);
+EAPI void glXDestroyPbuffer_evgl_thread_cmd(Display *dpy, GLXPbuffer pbuf);
+
+EAPI void glXDestroyPixmap_orig_evgl_set(void *func);
+EAPI void *glXDestroyPixmap_orig_evgl_get(void);
+EAPI void glXDestroyPixmap_evgl_thread_cmd(Display *dpy, GLXPixmap pixmap);
+EAPI void glXDestroyWindow_evgl_thread_cmd(Display *dpy, GLXWindow window);
+EAPI int glXGetConfig_evgl_thread_cmd(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+EAPI GLXContext glXGetCurrentContext_evgl_thread_cmd(void);
+EAPI int glXGetFBConfigAttrib_evgl_thread_cmd(Display *dpy, GLXFBConfig config, int attribute, int *value);
+
+EAPI void glXGetVideoSync_orig_evgl_set(void *func);
+EAPI void *glXGetVideoSync_orig_evgl_get(void);
+EAPI int glXGetVideoSync_evgl_thread_cmd(unsigned int *count);
+EAPI XVisualInfo * glXGetVisualFromFBConfig_evgl_thread_cmd(Display *dpy, GLXFBConfig config);
+EAPI Bool glXMakeContextCurrent_evgl_thread_cmd(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+
+EAPI void glXQueryDrawable_orig_evgl_set(void *func);
+EAPI void *glXQueryDrawable_orig_evgl_get(void);
+EAPI void glXQueryDrawable_evgl_thread_cmd(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+EAPI Bool glXQueryExtension_evgl_thread_cmd(Display *dpy, int *errorb, int *event);
+EAPI const char * glXQueryExtensionsString_evgl_thread_cmd(Display *dpy, int screen);
+
+EAPI void glXReleaseBuffersMESA_orig_evgl_set(void *func);
+EAPI void *glXReleaseBuffersMESA_orig_evgl_get(void);
+EAPI Bool glXReleaseBuffersMESA_evgl_thread_cmd(Display *dpy, GLXDrawable drawable);
+
+EAPI void glXReleaseTexImage_orig_evgl_set(void *func);
+EAPI void *glXReleaseTexImage_orig_evgl_get(void);
+EAPI void glXReleaseTexImage_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int buffer);
+EAPI void glXSwapBuffers_evgl_thread_cmd(Display *dpy, GLXDrawable drawable);
+
+EAPI void glXSwapIntervalEXT_orig_evgl_set(void *func);
+EAPI void *glXSwapIntervalEXT_orig_evgl_get(void);
+EAPI void glXSwapIntervalEXT_evgl_thread_cmd(Display *dpy, GLXDrawable drawable, int interval);
+
+EAPI void glXSwapIntervalSGI_orig_evgl_set(void *func);
+EAPI void *glXSwapIntervalSGI_orig_evgl_get(void);
+EAPI int glXSwapIntervalSGI_evgl_thread_cmd(int interval);
+
+EAPI void glXWaitVideoSync_orig_evgl_set(void *func);
+EAPI void *glXWaitVideoSync_orig_evgl_get(void);
+EAPI int glXWaitVideoSync_evgl_thread_cmd(int divisor, int remainder, unsigned int *count);
+
+#else /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+
+extern void (*glXBindTexImage_orig_evas_set)(void *func);
+extern void *(*glXBindTexImage_orig_evas_get)(void);
+extern void (*glXBindTexImage_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern GLXFBConfig * (*glXChooseFBConfig_thread_cmd)(Display *dpy, int screen, const int *attribList, int *nitems);
+extern GLXContext (*glXCreateContext_thread_cmd)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+extern GLXContext (*glXCreateNewContext_thread_cmd)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+extern GLXPbuffer (*glXCreatePbuffer_thread_cmd)(Display *dpy, GLXFBConfig config, const int *attribList);
+extern void (*glXCreatePixmap_orig_evas_set)(void *func);
+extern void  *(*glXCreatePixmap_orig_evas_get)(void);
+extern GLXPixmap (*glXCreatePixmap_thread_cmd)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+extern GLXWindow (*glXCreateWindow_thread_cmd)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+extern void (*glXDestroyContext_thread_cmd)(Display *dpy, GLXContext ctx);
+extern void (*glXDestroyPbuffer_thread_cmd)(Display *dpy, GLXPbuffer pbuf);
+extern void (*glXDestroyPixmap_orig_evas_set)(void *func);
+extern void *(*glXDestroyPixmap_orig_evas_get)(void);
+extern void (*glXDestroyPixmap_thread_cmd)(Display *dpy, GLXPixmap pixmap);
+extern void (*glXDestroyWindow_thread_cmd)(Display *dpy, GLXWindow window);
+extern int (*glXGetConfig_thread_cmd)(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+extern GLXContext (*glXGetCurrentContext_thread_cmd)(void);
+extern int (*glXGetFBConfigAttrib_thread_cmd)(Display *dpy, GLXFBConfig config, int attribute, int *value);
+extern void (*glXGetVideoSync_orig_evas_set)(void *func);
+extern void *(*glXGetVideoSync_orig_evas_get)(void);
+extern int (*glXGetVideoSync_thread_cmd)(unsigned int *count);
+extern XVisualInfo * (*glXGetVisualFromFBConfig_thread_cmd)(Display *dpy, GLXFBConfig config);
+extern Bool (*glXMakeContextCurrent_thread_cmd)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern void (*glXQueryDrawable_orig_evas_set)(void *func);
+extern void *(*glXQueryDrawable_orig_evas_get)(void);
+extern void (*glXQueryDrawable_thread_cmd)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+extern Bool (*glXQueryExtension_thread_cmd)(Display *dpy, int *errorb, int *event);
+extern const char * (*glXQueryExtensionsString_thread_cmd)(Display *dpy, int screen);
+extern void (*glXReleaseBuffersMESA_orig_evas_set)(void *func);
+extern void *(*glXReleaseBuffersMESA_orig_evas_get)(void);
+extern Bool (*glXReleaseBuffersMESA_thread_cmd)(Display *dpy, GLXDrawable drawable);
+extern void (*glXReleaseTexImage_orig_evas_set)(void *func);
+extern void *(*glXReleaseTexImage_orig_evas_get)(void);
+extern void (*glXReleaseTexImage_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer);
+extern void (*glXSwapBuffers_thread_cmd)(Display *dpy, GLXDrawable drawable);
+extern void (*glXSwapIntervalEXT_orig_evas_set)(void *func);
+extern void *(*glXSwapIntervalEXT_orig_evas_get)(void);
+extern void (*glXSwapIntervalEXT_thread_cmd)(Display *dpy, GLXDrawable drawable, int interval);
+extern void (*glXSwapIntervalSGI_orig_evas_set)(void *func);
+extern void *(*glXSwapIntervalSGI_orig_evas_get)(void);
+extern int (*glXSwapIntervalSGI_thread_cmd)(int interval);
+extern void (*glXWaitVideoSync_orig_evas_set)(void *func);
+extern void *(*glXWaitVideoSync_orig_evas_get)(void);
+extern int (*glXWaitVideoSync_thread_cmd)(int divisor, int remainder, unsigned int *count);
+
+/****** EVAS GL ******/
+
+extern void (*glXBindTexImage_orig_evgl_set)(void *func);
+extern void *(*glXBindTexImage_orig_evgl_get)(void);
+extern void (*glXBindTexImage_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
+extern GLXFBConfig * (*glXChooseFBConfig_evgl_thread_cmd)(Display *dpy, int screen, const int *attribList, int *nitems);
+extern GLXContext (*glXCreateContext_evgl_thread_cmd)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
+extern GLXContext (*glXCreateNewContext_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
+extern GLXPbuffer (*glXCreatePbuffer_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, const int *attribList);
+extern void (*glXCreatePixmap_orig_evgl_set)(void *func);
+extern void *(*glXCreatePixmap_orig_evgl_get)(void);
+extern GLXPixmap (*glXCreatePixmap_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
+extern GLXWindow (*glXCreateWindow_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
+extern void (*glXDestroyContext_evgl_thread_cmd)(Display *dpy, GLXContext ctx);
+extern void (*glXDestroyPbuffer_evgl_thread_cmd)(Display *dpy, GLXPbuffer pbuf);
+extern void (*glXDestroyPixmap_orig_evgl_set)(void *func);
+extern void *(*glXDestroyPixmap_orig_evgl_get)(void);
+extern void (*glXDestroyPixmap_evgl_thread_cmd)(Display *dpy, GLXPixmap pixmap);
+extern void (*glXDestroyWindow_evgl_thread_cmd)(Display *dpy, GLXWindow window);
+extern int (*glXGetConfig_evgl_thread_cmd)(Display *dpy, XVisualInfo *visual, int attrib, int *value);
+extern GLXContext (*glXGetCurrentContext_evgl_thread_cmd)(void);
+extern int (*glXGetFBConfigAttrib_evgl_thread_cmd)(Display *dpy, GLXFBConfig config, int attribute, int *value);
+extern void (*glXGetVideoSync_orig_evgl_set)(void *func);
+extern void *(*glXGetVideoSync_orig_evgl_get)(void);
+extern int (*glXGetVideoSync_evgl_thread_cmd)(unsigned int *count);
+extern XVisualInfo * (*glXGetVisualFromFBConfig_evgl_thread_cmd)(Display *dpy, GLXFBConfig config);
+extern Bool (*glXMakeContextCurrent_evgl_thread_cmd)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+extern void (*glXQueryDrawable_orig_evgl_set)(void *func);
+extern void *(*glXQueryDrawable_orig_evgl_get)(void);
+extern void (*glXQueryDrawable_evgl_thread_cmd)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
+extern Bool (*glXQueryExtension_evgl_thread_cmd)(Display *dpy, int *errorb, int *event);
+extern const char * (*glXQueryExtensionsString_evgl_thread_cmd)(Display *dpy, int screen);
+extern void (*glXReleaseBuffersMESA_orig_evgl_set)(void *func);
+extern void *(*glXReleaseBuffersMESA_orig_evgl_get)(void);
+extern Bool (*glXReleaseBuffersMESA_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable);
+extern void (*glXReleaseTexImage_orig_evgl_set)(void *func);
+extern void *(*glXReleaseTexImage_orig_evgl_get)(void);
+extern void (*glXReleaseTexImage_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int buffer);
+extern void (*glXSwapBuffers_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable);
+extern void (*glXSwapIntervalEXT_orig_evgl_set)(void *func);
+extern void *(*glXSwapIntervalEXT_orig_evgl_get)(void);
+extern void (*glXSwapIntervalEXT_evgl_thread_cmd)(Display *dpy, GLXDrawable drawable, int interval);
+extern void (*glXSwapIntervalSGI_orig_evgl_set)(void *func);
+extern void *(*glXSwapIntervalSGI_orig_evgl_get)(void);
+extern int (*glXSwapIntervalSGI_evgl_thread_cmd)(int interval);
+extern void (*glXWaitVideoSync_orig_evgl_set)(void *func);
+extern void *(*glXWaitVideoSync_orig_evgl_get)(void);
+extern int (*glXWaitVideoSync_evgl_thread_cmd)(int divisor, int remainder, unsigned int *count);
+
+
+extern void _glx_thread_link_init();
+
+
+#endif /* EVAS_GL_RENDER_THREAD_IS_GENERIC */
+
+#endif /* ! GL_GLES */
+
+#endif /* EVAS_GL_THREAD_GLX_H */
index e5743ee..acf9b1f 100644 (file)
@@ -5,6 +5,7 @@
 #include "../gl_common/evas_gl_common.h"
 #include "../gl_common/evas_gl_core.h"
 #include "../gl_common/evas_gl_core_private.h"
+#include "../gl_common/evas_gl_thread.h"
 
 typedef struct _Render_Engine_GL_Generic Render_Engine_GL_Generic;
 typedef struct _Context_3D Context_3D;
index 2ecf707..f50e915 100644 (file)
@@ -13,6 +13,7 @@
 #endif
 
 #include "../gl_common/evas_gl_common.h"
+#include "../gl_common/evas_gl_thread_gl.h"
 
 #include "Evas_Engine_GL_Generic.h"
 
@@ -313,7 +314,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
    Evas_Native_Surface *n = im->native.data;
 
    if (n->type == EVAS_NATIVE_SURFACE_OPENGL)
-     glBindTexture(GL_TEXTURE_2D, n->data.opengl.texture_id);
+     glBindTexture_thread_cmd(GL_TEXTURE_2D, n->data.opengl.texture_id);
 }
 
 static void
@@ -323,7 +324,7 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
   Evas_Native_Surface *n = im->native.data;
 
   if (n->type == EVAS_NATIVE_SURFACE_OPENGL)
-    glBindTexture(GL_TEXTURE_2D, 0);
+    glBindTexture_thread_cmd(GL_TEXTURE_2D, 0);
 }
 
 static void
@@ -1127,6 +1128,7 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x,
                              direct_surface);
 
         // Call pixel get function
+        // IS DDDDDDDDDDDDIRECT RENDERING
         evgl_get_pixels_pre();
         re->func.get_pixels(re->func.get_pixels_data, re->func.obj);
         evgl_get_pixels_post();
@@ -1536,16 +1538,19 @@ eng_gl_make_current(void *data, void *surface, void *context)
 
    if ((sfc) && (ctx))
      {
-        Evas_Engine_GL_Context *gl_context;
-
-        gl_context = re->window_gl_context_get(re->software.ob);
-        if ((gl_context->havestuff) ||
-            (gl_context->master_clip.used))
+        if (!sfc->thread_rendering)
           {
-             re->window_use(re->software.ob);
-             evas_gl_common_context_flush(gl_context);
-             if (gl_context->master_clip.used)
-                evas_gl_common_context_done(gl_context);
+             Evas_Engine_GL_Context *gl_context;
+
+             gl_context = re->window_gl_context_get(re->software.ob);
+             if ((gl_context->havestuff) ||
+                 (gl_context->master_clip.used))
+               {
+                  re->window_use(re->software.ob);
+                  evas_gl_common_context_flush(gl_context);
+                  if (gl_context->master_clip.used)
+                     evas_gl_common_context_done(gl_context);
+               }
           }
      }
 
@@ -1660,6 +1665,9 @@ eng_gl_surface_direct_renderable_get(void *data, Evas_Native_Surface *ns, Eina_B
    Evas_Engine_GL_Context *gl_context;
    Evas_GL_Image *sfc = surface;
 
+   if (evas_gl_thread_enabled())
+     return EINA_FALSE;
+
    if (!re) return EINA_FALSE;
    EVGLINIT(data, EINA_FALSE);
    if (!ns) return EINA_FALSE;
@@ -1696,6 +1704,74 @@ eng_gl_get_pixels_pre(void *data)
    evgl_get_pixels_pre();
 }
 
+typedef struct
+{
+   Evas_Object_Image_Pixels_Get_Cb cb;
+   void *get_pixels_data;
+   Evas_Object *o;
+} Evas_GL_Thread_Command_get_pixels;
+
+static void
+_evgl_thread_get_pixels(void *data)
+{
+   Evas_GL_Thread_Command_get_pixels *thread_param =
+      (Evas_GL_Thread_Command_get_pixels *)data;
+
+  evas_evgl_thread_begin();
+  thread_param->cb(thread_param->get_pixels_data, thread_param->o);
+  evas_evgl_thread_end();
+
+  eina_mempool_free(_mp_command, thread_param);
+}
+
+static void
+get_pixels_evgl_thread_cmd(Evas_Object_Image_Pixels_Get_Cb cb, void *get_pixels_data, Evas_Object *o)
+{
+   if (!evas_gl_thread_enabled()) /* XXX */
+     {
+        cb(get_pixels_data, o);
+        return;
+     }
+
+   Evas_GL_Thread_Command_get_pixels *thread_param;
+   thread_param = eina_mempool_malloc(_mp_command,
+                                      sizeof(Evas_GL_Thread_Command_get_pixels));
+   thread_param->cb = cb;
+   thread_param->get_pixels_data = get_pixels_data;
+   thread_param->o = o;
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_EVGL,
+                              _evgl_thread_get_pixels,
+                              thread_param,
+                              EVAS_GL_THREAD_MODE_FLUSH);
+}
+
+static void
+eng_gl_get_pixels(void *data EINA_UNUSED, Evas_Object_Image_Pixels_Get_Cb cb, void *get_pixels_data, Evas_Object *o, void *image)
+{
+   Evas_GL_Image *im = image;
+   Evas_Native_Surface *n;
+   EVGL_Surface *sfc;
+
+   if (im)
+     {
+        n = im->native.data;
+        if (n)
+          {
+             sfc = n->data.evasgl.surface;
+             if (sfc)
+               {
+                  if (sfc->thread_rendering)
+                    {
+                       get_pixels_evgl_thread_cmd(cb, get_pixels_data, o);
+                       return;
+                    }
+               }
+          }
+     }
+
+   cb(get_pixels_data, o);
+}
+
 static void
 eng_gl_get_pixels_post(void *data EINA_UNUSED)
 {
@@ -1755,20 +1831,20 @@ eng_gl_surface_read_pixels(void *data EINA_UNUSED, void *surface,
     * But some devices don't support GL_BGRA, so we still need to convert.
     */
 
-   glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbo);
+   glGetIntegerv_thread_cmd(GL_FRAMEBUFFER_BINDING, &fbo);
    if (fbo != (GLint) im->tex->pt->fb)
      glsym_glBindFramebuffer(GL_FRAMEBUFFER, im->tex->pt->fb);
-   glPixelStorei(GL_PACK_ALIGNMENT, 4);
+   glPixelStorei_thread_cmd(GL_PACK_ALIGNMENT, 4);
 
    // With GLX we will try to read BGRA even if the driver reports RGBA
 #if defined(GL_GLES) && defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT)
-   glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &fmt);
+   glGetIntegerv_thread_cmd(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &fmt);
 #endif
 
    if ((im->tex->pt->format == GL_BGRA) && (fmt == GL_BGRA))
      {
-        glReadPixels(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
-        done = (glGetError() == GL_NO_ERROR);
+        glReadPixels_thread_cmd(x, y, w, h, GL_BGRA, GL_UNSIGNED_BYTE, pixels);
+        done = (glGetError_thread_cmd() == GL_NO_ERROR);
      }
 
    if (!done)
@@ -1776,7 +1852,7 @@ eng_gl_surface_read_pixels(void *data EINA_UNUSED, void *surface,
         DATA32 *ptr = pixels;
         int k;
 
-        glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+        glReadPixels_thread_cmd(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
         for (k = w * h; k; --k)
           {
              const DATA32 v = *ptr;
@@ -2709,6 +2785,7 @@ module_open(Evas_Module *em)
    ORD(gl_surface_direct_renderable_get);
    ORD(gl_get_pixels_set);
    ORD(gl_get_pixels_pre);
+   ORD(gl_get_pixels);
    ORD(gl_get_pixels_post);
    ORD(gl_surface_lock);
    ORD(gl_surface_read_pixels);
index 89771fa..6584340 100644 (file)
@@ -3,6 +3,11 @@
 #include "../gl_common/evas_gl_define.h"
 #include "../software_generic/evas_native_common.h"
 
+#ifdef GL_GLES
+#include "../gl_common/evas_gl_thread_egl.h"
+#endif
+#include "../gl_common/evas_gl_thread_gl.h"
+
 #ifdef HAVE_DLSYM
 # include <dlfcn.h>      /* dlopen,dlclose,etc */
 #else
@@ -84,8 +89,8 @@ void    *(*glsym_eglCreateImage)               (EGLDisplay a, EGLContext b, EGLe
 void     (*glsym_eglDestroyImage)              (EGLDisplay a, void *b) = NULL;
 void     (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b)  = NULL;
 unsigned int   (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
-unsigned int   (*glsym_eglSetDamageRegionKHR)  (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL;
-unsigned int (*glsym_eglQueryWaylandBufferWL)(EGLDisplay a, /*struct wl_resource */void *b, EGLint c, EGLint *d) = NULL;
+unsigned int   (*glsym_eglSetDamageRegion)  (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL;
+unsigned int (*glsym_eglQueryWaylandBuffer)(EGLDisplay a, /*struct wl_resource */void *b, EGLint c, EGLint *d) = NULL;
 
 #else
 
@@ -105,6 +110,13 @@ void     (*glsym_glXReleaseBuffersMESA)   (Display *a, XID b) = NULL;
 
 #endif
 
+#define REPLACE_THREAD(prefix, dst, typ) \
+   if (prefix##dst && (typ)prefix##dst != (typ)dst##_thread_cmd) \
+     { \
+        dst##_orig_evas_set(prefix##dst); \
+        prefix##dst = (typ)dst##_thread_cmd; \
+     }
+
 void (*glsym_evas_gl_common_surface_cache_dump)(void) = NULL;
 
 static inline Outbuf *
@@ -183,14 +195,14 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
 
    if ((!context) && (!surface))
      {
-        if (!eglGetCurrentContext() &&
-            !eglGetCurrentSurface(EGL_READ) &&
-            !eglGetCurrentSurface(EGL_DRAW))
+        if (!eglGetCurrentContext_thread_cmd() &&
+            !eglGetCurrentSurface_thread_cmd(EGL_READ) &&
+            !eglGetCurrentSurface_thread_cmd(EGL_DRAW))
           return 1;
-        ret = eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        ret = eglMakeCurrent_thread_cmd(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
         if (!ret)
           {
-             int err = eglGetError();
+             int err = eglGetError_thread_cmd();
              glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
              ERR("eglMakeCurrent() failed! Error Code=%#x", err);
              return 0;
@@ -199,9 +211,9 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
      }
 
    // FIXME: Check (eglGetCurrentDisplay() != dpy) ?
-   if ((eglGetCurrentContext() != ctx) ||
-       (eglGetCurrentSurface(EGL_READ) != sfc) ||
-       (eglGetCurrentSurface(EGL_DRAW) != sfc) )
+   if ((eglGetCurrentContext_thread_cmd() != ctx) ||
+       (eglGetCurrentSurface_thread_cmd(EGL_READ) != sfc) ||
+       (eglGetCurrentSurface_thread_cmd(EGL_DRAW) != sfc) )
      {
 
         //!!!! Does it need to be flushed with it's set to NULL above??
@@ -209,11 +221,11 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
         if (flush) eng_window_use(NULL);
 
         // Do a make current
-        ret = eglMakeCurrent(dpy, sfc, sfc, ctx);
+        ret = eglMakeCurrent_thread_cmd(dpy, sfc, sfc, ctx);
 
         if (!ret)
           {
-             int err = eglGetError();
+             int err = eglGetError_thread_cmd();
              glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
              ERR("eglMakeCurrent() failed! Error Code=%#x", err);
              return 0;
@@ -1251,8 +1263,10 @@ gl_symbols(void)
    FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressEXT", glsym_func_eng_fn);
    FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressARB", glsym_func_eng_fn);
    FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddress", glsym_func_eng_fn);
-   FINDSYM(glsym_eglQueryWaylandBufferWL, "eglQueryWaylandBufferWL",
+
+   FINDSYM(glsym_eglQueryWaylandBuffer, "eglQueryWaylandBufferWL",
            glsym_func_uint)
+   REPLACE_THREAD(glsym_, eglQueryWaylandBuffer, glsym_func_eng_fn);
 #else
 #define FINDSYM(dst, sym, typ) \
    if (glsym_glXGetProcAddress) { \
@@ -1297,11 +1311,15 @@ eng_gl_symbols(void)
    FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void);
 
    FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void);
+   REPLACE_THREAD(glsym_, glEGLImageTargetTexture2DOES, glsym_func_void);
 
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamageEXT", glsym_func_uint);
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamageINTEL", glsym_func_uint);
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamage", glsym_func_uint);
-   FINDSYM(glsym_eglSetDamageRegionKHR, "eglSetDamageRegionKHR", glsym_func_uint);
+   REPLACE_THREAD(glsym_, eglSwapBuffersWithDamage, glsym_func_uint);
+
+   FINDSYM(glsym_eglSetDamageRegion, "eglSetDamageRegionKHR", glsym_func_uint);
+   REPLACE_THREAD(glsym_, eglSetDamageRegion, glsym_func_uint);
 
 
 #else
@@ -1366,7 +1384,7 @@ gl_extn_veto(Render_Engine *re)
           {
              extn_have_buffer_age = 0;
              glsym_eglSwapBuffersWithDamage = NULL;
-             glsym_eglSetDamageRegionKHR = NULL;
+             glsym_eglSetDamageRegion = NULL;
           }
         if (!strstr(str, "EGL_EXT_buffer_age"))
           {
@@ -1375,7 +1393,7 @@ gl_extn_veto(Render_Engine *re)
           }
         if (!strstr(str, "EGL_KHR_partial_update"))
           {
-             glsym_eglSetDamageRegionKHR = NULL;
+             glsym_eglSetDamageRegion = NULL;
           }
         if (!strstr(str, "EGL_NOK_texture_from_pixmap"))
           {
@@ -1385,8 +1403,8 @@ gl_extn_veto(Render_Engine *re)
           {
              const GLubyte *vendor, *renderer;
 
-             vendor = glGetString(GL_VENDOR);
-             renderer = glGetString(GL_RENDERER);
+             vendor = glGetString_thread_cmd(GL_VENDOR);
+             renderer = glGetString_thread_cmd(GL_RENDERER);
              // XXX: workaround mesa bug!
              // looking for mesa and intel build which is known to
              // advertise the EGL_NOK_texture_from_pixmap extension
@@ -1842,7 +1860,7 @@ eng_preload_make_current(void *data, void *doit)
    if (doit)
      {
 #ifdef GL_GLES
-        if (!eglMakeCurrent(ob->egl_disp, ob->egl_surface[0], ob->egl_surface[0], ob->egl_context[0]))
+        if (!eglMakeCurrent_thread_cmd(ob->egl_disp, ob->egl_surface[0], ob->egl_surface[0], ob->egl_context[0]))
           return EINA_FALSE;
 #else
         if (!__glXMakeContextCurrent(ob->info->info.display, ob->glxwin, ob->context))
@@ -1857,7 +1875,7 @@ eng_preload_make_current(void *data, void *doit)
    else
      {
 #ifdef GL_GLES
-        if (!eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
+        if (!eglMakeCurrent_thread_cmd(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
           return EINA_FALSE;
 #else
         if (!__glXMakeContextCurrent(ob->info->info.display, 0, NULL))
@@ -1905,7 +1923,7 @@ eng_gl_current_context_get(void *data EINA_UNUSED)
    context = glsym_evgl_current_native_context_get(ctx);
 
 #ifdef GL_GLES
-   if (eglGetCurrentContext() == context)
+   if (eglGetCurrentContext_thread_cmd() == context)
      return ctx;
 #else
    if (glXGetCurrentContext() == context)
@@ -1924,7 +1942,7 @@ eng_gl_error_get(void *data)
      goto end;
 
 #ifdef GL_GLES
-   err = eglGetError() - EGL_SUCCESS;
+   err = eglGetError_thread_cmd() - EGL_SUCCESS;
 #else
    Render_Engine *re = data;
 
@@ -1987,7 +2005,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
     }
   else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
     {
-       glBindTexture(im->native.target, n->ns.data.opengl.texture_id);
+       glBindTexture_thread_cmd(im->native.target, n->ns.data.opengl.texture_id);
     }
   else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
     {
@@ -2027,7 +2045,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
               }
             else
               {
-                 glBindTexture(GL_TEXTURE_2D, (GLuint)(uintptr_t)surface);
+                 glBindTexture_thread_cmd(GL_TEXTURE_2D, (GLuint)(uintptr_t)surface);
               }
          }
     }
@@ -2076,7 +2094,7 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
      {
-        glBindTexture(im->native.target, 0);
+        glBindTexture_thread_cmd(im->native.target, 0);
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
      {
@@ -2087,7 +2105,7 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
 #ifdef GL_GLES
         // nothing
 #else
-        glBindTexture(GL_TEXTURE_2D, 0);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, 0);
 #endif
      }
 }
@@ -2845,12 +2863,12 @@ eng_image_native_set(void *data, void *image, void *native)
                   EGLint attribs[3];
                   int format, yinvert = 1;
 
-                  glsym_eglQueryWaylandBufferWL(eng_get_ob(re)->egl_disp, wl_buf,
-                                                EGL_TEXTURE_FORMAT, &format);
+                  glsym_eglQueryWaylandBuffer(eng_get_ob(re)->egl_disp, wl_buf,
+                                              EGL_TEXTURE_FORMAT, &format); // TODO : THREAD
                   if ((format != EGL_TEXTURE_RGB) &&
                       (format != EGL_TEXTURE_RGBA))
                     {
-                       ERR("eglQueryWaylandBufferWL() %d format is not supported ", format);
+                       ERR("eglQueryWaylandBuffer() %d format is not supported ", format);
                        glsym_evas_gl_common_image_free(im);
                        free(n);
                        return NULL;
@@ -2861,7 +2879,7 @@ eng_image_native_set(void *data, void *image, void *native)
                   attribs[2] = EGL_NONE;
 
                   memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
-                  if (glsym_eglQueryWaylandBufferWL(eng_get_ob(re)->egl_disp, wl_buf,
+                  if (glsym_eglQueryWaylandBuffer(eng_get_ob(re)->egl_disp, wl_buf,
                                                     EGL_WAYLAND_Y_INVERTED_WL,
                                                     &yinvert) == EGL_FALSE)
                     yinvert = 1;
@@ -2895,7 +2913,7 @@ 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.
+                  // mesa's eglQueryWaylandBuffer() with EGL_WAYLAND_Y_INVERTED_WL works incorrect.
                   //im->native.yinvert = yinvert;
                   im->native.yinvert = 1;
                   im->native.loose = 0;
@@ -2966,6 +2984,7 @@ module_open(Evas_Module *em)
       setenv("EGL_PLATFORM", "x11", 0);
 
    gl_symbols();
+   _init_thread_egl_use();
 
    if (!platform_env)
       unsetenv("EGL_PLATFORM");
index 3ef4054..bde5172 100644 (file)
@@ -148,7 +148,7 @@ extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock;
 #endif
 
 extern unsigned int   (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c);
-extern unsigned int   (*glsym_eglSetDamageRegionKHR)  (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d);
+extern unsigned int   (*glsym_eglSetDamageRegion)  (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d);
 
 #else
 
index 8ebe2e2..5fcc3e7 100755 (executable)
@@ -2,6 +2,11 @@
 #include "../gl_common/evas_gl_define.h"
 #include <dlfcn.h>
 
+#ifdef GL_GLES
+#include "../gl_common/evas_gl_thread_egl.h"
+#endif
+#include "../gl_common/evas_gl_thread_gl.h"
+
 # define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_common_context_restore_set) glsym_evas_gl_common_context_restore_set(EINA_TRUE); } while(0)
 
 static Eina_TLS _outbuf_key = 0;
@@ -229,9 +234,9 @@ eng_window_new(Evas_Engine_Info_GL_X11 *info,
         eng_window_free(gw);
         return NULL;
      }
-   if (!eglBindAPI(EGL_OPENGL_ES_API))
+   if (!eglBindAPI_thread_cmd(EGL_OPENGL_ES_API))
      {
-        ERR("eglBindAPI() fail. code=%#x", eglGetError());
+        ERR("eglBindAPI() fail. code=%#x", eglGetError_thread_cmd());
         eng_window_free(gw);
         return NULL;
      }
@@ -276,20 +281,20 @@ try_gles2:
      _tls_context_set(gw->egl_context[0]);
    
    SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(gw->egl_disp,
+   if (eglMakeCurrent_thread_cmd(gw->egl_disp,
                       gw->egl_surface[0],
                       gw->egl_surface[0],
                       gw->egl_context[0]) == EGL_FALSE)
      {
-        ERR("eglMakeCurrent() fail. code=%#x", eglGetError());
+        ERR("eglMakeCurrent() fail. code=%#x", eglGetError_thread_cmd());
         eng_window_free(gw);
         return NULL;
      }
 
-   vendor = glGetString(GL_VENDOR);
-   renderer = glGetString(GL_RENDERER);
-   version = glGetString(GL_VERSION);
-   glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION);
+   vendor = glGetString_thread_cmd(GL_VENDOR);
+   renderer = glGetString_thread_cmd(GL_RENDERER);
+   version = glGetString_thread_cmd(GL_VERSION);
+   glslversion = glGetString_thread_cmd(GL_SHADING_LANGUAGE_VERSION);
    if (!vendor)   vendor   = (unsigned char *)"-UNKNOWN-";
    if (!renderer) renderer = (unsigned char *)"-UNKNOWN-";
    if (!version)  version  = (unsigned char *)"-UNKNOWN-";
@@ -428,10 +433,10 @@ try_gles2:
      }
    // FIXME: move this up to context creation
 
-   vendor = glGetString(GL_VENDOR);
-   renderer = glGetString(GL_RENDERER);
-   version = glGetString(GL_VERSION);
-   glslversion = glGetString(GL_SHADING_LANGUAGE_VERSION);
+   vendor = glGetString_thread_cmd(GL_VENDOR);
+   renderer = glGetString_thread_cmd(GL_RENDERER);
+   version = glGetString_thread_cmd(GL_VERSION);
+   glslversion = glGetString_thread_cmd(GL_SHADING_LANGUAGE_VERSION);
    if (!vendor)   vendor   = (unsigned char *)"-UNKNOWN-";
    if (!renderer) renderer = (unsigned char *)"-UNKNOWN-";
    if (!version)  version  = (unsigned char *)"-UNKNOWN-";
@@ -591,7 +596,7 @@ eng_window_free(Outbuf *gw)
      }
 #ifdef GL_GLES
    SET_RESTORE_CONTEXT();
-   eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+   eglMakeCurrent_thread_cmd(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
    if (gw->egl_surface[0] != EGL_NO_SURFACE)
       eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
    if (gw->egl_surface[1] != EGL_NO_SURFACE)
@@ -632,12 +637,12 @@ eng_window_make_current(void *data, void *doit)
    SET_RESTORE_CONTEXT();
    if (doit)
      {
-        if (!eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0], gw->egl_context[0]))
+        if (!eglMakeCurrent_thread_cmd(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0], gw->egl_context[0]))
           return EINA_FALSE;
      }
    else
      {
-        if (!eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
+        if (!eglMakeCurrent_thread_cmd(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT))
           return EINA_FALSE;
      }
 #else
@@ -670,15 +675,15 @@ eng_window_use(Outbuf *gw)
 #ifdef GL_GLES
    if (xwin)
      {
-        if ((eglGetCurrentDisplay() !=
+        if ((eglGetCurrentDisplay_thread_cmd() !=
              xwin->egl_disp) ||
-            (eglGetCurrentContext() !=
+            (eglGetCurrentContext_thread_cmd() !=
              xwin->egl_context[0])
 #if 0
             // FIXME: Figure out what that offscreen thing was about...
-            || (eglGetCurrentSurface(EGL_READ) !=
+            || (eglGetCurrentSurface_thread_cmd(EGL_READ) !=
                 xwin->egl_surface[xwin->offscreen])
-            || (eglGetCurrentSurface(EGL_DRAW) !=
+            || (eglGetCurrentSurface_thread_cmd(EGL_DRAW) !=
                 xwin->egl_surface[xwin->offscreen])
 #endif
             )
@@ -706,7 +711,7 @@ eng_window_use(Outbuf *gw)
              if (gw->egl_surface[0] != EGL_NO_SURFACE)
                {
                   SET_RESTORE_CONTEXT();
-                  if (eglMakeCurrent(gw->egl_disp,
+                  if (eglMakeCurrent_thread_cmd(gw->egl_disp,
                                      gw->egl_surface[0],
                                      gw->egl_surface[0],
                                      gw->egl_context[0]) == EGL_FALSE)
@@ -742,7 +747,7 @@ eng_window_unsurf(Outbuf *gw)
    if (xwin == gw)
      {
         SET_RESTORE_CONTEXT();
-        eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        eglMakeCurrent_thread_cmd(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
         if (gw->egl_surface[0] != EGL_NO_SURFACE)
            eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
         gw->egl_surface[0] = EGL_NO_SURFACE;
@@ -777,7 +782,7 @@ eng_window_resurf(Outbuf *gw)
         return;
      }
    SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(gw->egl_disp,
+   if (eglMakeCurrent_thread_cmd(gw->egl_disp,
                       gw->egl_surface[0],
                       gw->egl_surface[0],
                       gw->egl_context[0]) == EGL_FALSE)
@@ -1332,7 +1337,7 @@ eng_gl_context_use(Context_3D *ctx)
 {
 #if GL_GLES
     SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(ctx->display, ctx->surface,
+   if (eglMakeCurrent_thread_cmd(ctx->display, ctx->surface,
                       ctx->surface, ctx->context) == EGL_FALSE)
      {
         ERR("eglMakeCurrent() failed.");
@@ -1372,7 +1377,7 @@ eng_outbuf_swap_mode(Outbuf *ob)
 #ifdef GL_GLES
         EGLint age = 0;
 
-        if (!eglQuerySurface(ob->egl_disp, ob->egl_surface[0],
+        if (!eglQuerySurface_thread_cmd(ob->egl_disp, ob->egl_surface[0],
                              EGL_BUFFER_AGE_EXT, &age))
           age = 0;
 #else
@@ -1418,8 +1423,8 @@ eng_outbuf_region_first_rect(Outbuf *ob)
    glsym_evas_gl_common_context_newframe(ob->gl_context);
    if (partial_render_debug == 1)
      {
-        glClearColor(0.2, 0.5, 1.0, 1.0);
-        glClear(GL_COLOR_BUFFER_BIT);
+        glClearColor_thread_cmd(0.2, 0.5, 1.0, 1.0);
+        glClear_thread_cmd(GL_COLOR_BUFFER_BIT);
      }
 
    return EINA_FALSE;
@@ -1478,7 +1483,7 @@ _set_damage_rect(Outbuf *ob, int x, int y, int w, int h)
      }
 
    _convert_to_glcoords(rects, ob, x, y, w, h);
-   glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
+   glsym_eglSetDamageRegion(ob->egl_disp, ob->egl_surface[0], rects, 1);
 }
 #endif
 
@@ -1500,7 +1505,7 @@ eng_outbuf_new_region_for_update(Outbuf *ob,
         ob->gl_context->master_clip.w = w;
         ob->gl_context->master_clip.h = h;
 #ifdef GL_GLES
-        if (glsym_eglSetDamageRegionKHR)
+        if (glsym_eglSetDamageRegion)
           _set_damage_rect(ob, x, y, w, h);
 #endif
      }
@@ -1558,8 +1563,8 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
 #ifdef GL_GLES
    if (!ob->vsync)
      {
-        if (ob->info->vsync) eglSwapInterval(ob->egl_disp, 1);
-        else eglSwapInterval(ob->egl_disp, 0);
+        if (ob->info->vsync) eglSwapInterval_thread_cmd(ob->egl_disp, 1);
+        else eglSwapInterval_thread_cmd(ob->egl_disp, 0);
         ob->vsync = 1;
      }
    if (ob->info->callback.pre_swap)
@@ -1588,7 +1593,7 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
           }
      }
    else
-     eglSwapBuffers(ob->egl_disp, ob->egl_surface[0]);
+     eglSwapBuffers_thread_cmd(ob->egl_disp, ob->egl_surface[0]);
 
 //xx   if (!safe_native) eglWaitGL();
    if (ob->info->callback.post_swap)
index f901bf9..1b25510 100755 (executable)
@@ -86,11 +86,18 @@ void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientB
 void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
 void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b)  = NULL;
 unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
-unsigned int (*glsym_eglSetDamageRegionKHR) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL;
-unsigned int (*glsym_eglQueryWaylandBufferWL)(EGLDisplay a, struct wl_resource *b, EGLint c, EGLint *d) = NULL;
+unsigned int (*glsym_eglSetDamageRegion) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL;
+unsigned int (*glsym_eglQueryWaylandBuffer)(EGLDisplay a, struct wl_resource *b, EGLint c, EGLint *d) = NULL;
 
 void (*glsym_evas_gl_common_surface_cache_dump)(void) = NULL;
 
+#define REPLACE_THREAD(prefix, dst, typ) \
+   if (prefix##dst && (typ)prefix##dst != (typ)dst##_thread_cmd) \
+     { \
+        dst##_orig_evas_set(prefix##dst); \
+        prefix##dst = (typ)dst##_thread_cmd; \
+     }
+
 /* local variables */
 static Eina_Bool initted = EINA_FALSE;
 static int gl_wins = 0;
@@ -185,6 +192,7 @@ gl_symbols(void)
 
    FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES",
            glsym_func_void);
+   REPLACE_THREAD(glsym_, glEGLImageTargetTexture2DOES, glsym_func_void);
 
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamageEXT",
            glsym_func_uint);
@@ -192,11 +200,15 @@ gl_symbols(void)
            glsym_func_uint);
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamage",
            glsym_func_uint);
-   FINDSYM(glsym_eglSetDamageRegionKHR, "eglSetDamageRegionKHR",
+   REPLACE_THREAD(glsym_, eglSwapBuffersWithDamage, glsym_func_uint);
+
+   FINDSYM(glsym_eglSetDamageRegion, "eglSetDamageRegionKHR",
            glsym_func_uint);
+   REPLACE_THREAD(glsym_, eglSetDamageRegion, glsym_func_uint);
 
-   FINDSYM(glsym_eglQueryWaylandBufferWL, "eglQueryWaylandBufferWL",
+   FINDSYM(glsym_eglQueryWaylandBuffer, "eglQueryWaylandBufferWL",
            glsym_func_uint);
+   REPLACE_THREAD(glsym_, eglQueryWaylandBuffer, glsym_func_uint);
 
    done = EINA_TRUE;
 }
@@ -217,7 +229,7 @@ gl_extn_veto(Render_Engine *re)
           {
              extn_have_buffer_age = EINA_FALSE;
              glsym_eglSwapBuffersWithDamage = NULL;
-             glsym_eglSetDamageRegionKHR = NULL;
+             glsym_eglSetDamageRegion = NULL;
           }
         if (!strstr(str, "EGL_EXT_buffer_age"))
           {
@@ -226,7 +238,7 @@ gl_extn_veto(Render_Engine *re)
           }
         if (!strstr(str, "EGL_KHR_partial_update"))
           {
-             glsym_eglSetDamageRegionKHR = NULL;
+             glsym_eglSetDamageRegion = NULL;
           }
         if (!strstr(str, "EGL_NOK_texture_from_pixmap"))
           {
@@ -236,8 +248,8 @@ gl_extn_veto(Render_Engine *re)
           {
              const GLubyte *vendor, *renderer;
 
-             vendor = glGetString(GL_VENDOR);
-             renderer = glGetString(GL_RENDERER);
+             vendor = glGetString_thread_cmd(GL_VENDOR);
+             renderer = glGetString_thread_cmd(GL_RENDERER);
              // XXX: workaround mesa bug!
              // looking for mesa and intel build which is known to
              // advertise the EGL_NOK_texture_from_pixmap extension
@@ -544,35 +556,70 @@ evgl_eng_make_current(void *data, void *surface, void *ctxt, int flush)
 
    if ((!ctxt) && (!surface))
      {
+#ifdef SCORE_EGL_MOVE_TO_OTHER_THREAD
+        ret = eglMakeCurrent_evgl_thread_cmd(ob->egl_disp, EGL_NO_SURFACE,
+                                             EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        if (!ret)
+          {
+             int err = eglGetError_evgl_thread_cmd();
+             glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
+             ERR("eglMakeCurrent failed! Error Code=%#x", err);
+             return 0;
+          }
+#else
         ret =
-          eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE,
+          eglMakeCurrent_thread_cmd(ob->egl_disp, EGL_NO_SURFACE,
                          EGL_NO_SURFACE, EGL_NO_CONTEXT);
         if (!ret)
           {
-             int err = eglGetError();
+             int err = eglGetError_thread_cmd();
              glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
              ERR("eglMakeCurrent() failed! Error Code=%#x", err);
              return 0;
           }
+#endif
         return 1;
      }
 
-   if ((eglGetCurrentContext() != ctx) ||
-       (eglGetCurrentSurface(EGL_READ) != surf) ||
-       (eglGetCurrentSurface(EGL_DRAW) != surf))
+#ifdef SCORE_EGL_MOVE_TO_OTHER_THREAD
+   if ((eglGetCurrentContext_evgl_thread_cmd() != ctx) ||
+       (eglGetCurrentSurface_evgl_thread_cmd(EGL_READ) != surf) ||
+       (eglGetCurrentSurface_evgl_thread_cmd(EGL_DRAW) != surf) )
+     {
+        //!!!! Does it need to be flushed with it's set to NULL above??
+        // Flush remainder of what's in Evas' pipeline
+        //if (flush) eng_window_use(NULL);
+
+        ret = eglMakeCurrent_evgl_thread_cmd(ob->egl_disp, surf, surf, ctx);
+        if (!ret)
+          {
+             int err = eglGetError_evgl_thread_cmd();
+             glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
+             ERR("eglMakeCurrent() failed! Error Code=%#x", err);
+             return 0;
+          }
+     }
+
+#else
+
+   if ((eglGetCurrentContext_thread_cmd() != ctx) ||
+       (eglGetCurrentSurface_thread_cmd(EGL_READ) != surf) ||
+       (eglGetCurrentSurface_thread_cmd(EGL_DRAW) != surf))
      {
         if (flush) eng_window_use(NULL);
 
-        ret = eglMakeCurrent(ob->egl_disp, surf, surf, ctx);
+        ret = eglMakeCurrent_thread_cmd(ob->egl_disp, surf, surf, ctx);
         if (!ret)
           {
-             int err = eglGetError();
+             int err = eglGetError_thread_cmd();
              glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
              ERR("eglMakeCurrent() failed! Error Code=%#x", err);
              return 0;
           }
      }
 
+#endif
+
    return 1;
 }
 
@@ -1145,7 +1192,7 @@ eng_gl_current_context_get(void *data EINA_UNUSED)
      return NULL;
 
 #ifdef GL_GLES
-   if (eglGetCurrentContext() == (ctx->context))
+   if (eglGetCurrentContext_thread_cmd() == (ctx->context))
      return ctx;
    else
      return NULL;
@@ -1196,7 +1243,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image)
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
      {
-        glBindTexture(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, n->ns.data.opengl.texture_id);
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
      {
@@ -1221,7 +1268,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image)
                }
              else
                {
-                  glBindTexture(GL_TEXTURE_2D, (GLuint)(uintptr_t)surface);
+                  glBindTexture_thread_cmd(GL_TEXTURE_2D, (GLuint)(uintptr_t)surface);
                }
           }
     }
@@ -1258,7 +1305,7 @@ _native_cb_unbind(void *data EINA_UNUSED, void *image)
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
      {
-        glBindTexture(GL_TEXTURE_2D, 0);
+        glBindTexture_thread_cmd(GL_TEXTURE_2D, 0);
      }
   else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
     {
@@ -1546,12 +1593,12 @@ eng_image_native_set(void *data, void *image, void *native)
                   EGLint attribs[3];
                   int format, yinvert = 1;
 
-                  glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf,
+                  glsym_eglQueryWaylandBuffer(ob->egl_disp, wl_buf,
                                                 EGL_TEXTURE_FORMAT, &format);
                   if ((format != EGL_TEXTURE_RGB) &&
                       (format != EGL_TEXTURE_RGBA))
                     {
-                       ERR("eglQueryWaylandBufferWL() %d format is not supported ", format);
+                       ERR("eglQueryWaylandBuffer() %d format is not supported ", format);
                        glsym_evas_gl_common_image_free(img);
                        free(n);
                        return NULL;
@@ -1562,7 +1609,7 @@ eng_image_native_set(void *data, void *image, void *native)
                   attribs[2] = EGL_NONE;
 
                   memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
-                  if (glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf,
+                  if (glsym_eglQueryWaylandBuffer(ob->egl_disp, wl_buf,
                                                     EVAS_GL_WAYLAND_Y_INVERTED_WL,
                                                     &yinvert) == EGL_FALSE)
                     yinvert = 1;
@@ -1730,13 +1777,13 @@ eng_preload_make_current(void *data, void *doit)
 
    if (doit)
      {
-        if (!eglMakeCurrent(ob->egl_disp, ob->egl_surface[0],
+        if (!eglMakeCurrent_thread_cmd(ob->egl_disp, ob->egl_surface[0],
                             ob->egl_surface[0], ob->egl_context[0]))
           return EINA_FALSE;
      }
    else
      {
-        if (!eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
+        if (!eglMakeCurrent_thread_cmd(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
                             EGL_NO_CONTEXT))
           return EINA_FALSE;
      }
@@ -1784,6 +1831,7 @@ module_open(Evas_Module *em)
    ORD(gl_current_context_get);
    ORD(gl_error_get);
 
+   evas_gl_thread_link_init();
    gl_symbols();
 
    /* advertise out which functions we support */
index a12be35..a2d0e96 100755 (executable)
@@ -116,7 +116,7 @@ extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_lock;
 extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock;
 
 extern unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c);
-extern unsigned int (*glsym_eglSetDamageRegionKHR) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d);
+extern unsigned int (*glsym_eglSetDamageRegion) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d);
 
 Outbuf *eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode,
                                   int depth_bits, int stencil_bits, int msaa_bits);
index eff2a88..002490e 100644 (file)
@@ -15,7 +15,7 @@ static EGLContext context = EGL_NO_CONTEXT;
 static int win_count = 0;
 
 Outbuf *
-eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode,
+_orig_eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode,
                           int depth_bits, int stencil_bits, int msaa_bits)
 {
    Outbuf *gw;
@@ -113,9 +113,9 @@ eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Re
         eng_window_free(gw);
         return NULL;
      }
-   if (!eglBindAPI(EGL_OPENGL_ES_API))
+   if (!eglBindAPI_thread_cmd(EGL_OPENGL_ES_API))
      {
-        ERR("eglBindAPI() fail. code=%#x", eglGetError());
+        ERR("eglBindAPI() fail. code=%#x", eglGetError_thread_cmd());
         eng_window_free(gw);
         return NULL;
      }
@@ -157,17 +157,17 @@ eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Re
    if (context == EGL_NO_CONTEXT) context = gw->egl_context[0];
 
    SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0],
+   if (eglMakeCurrent_thread_cmd(gw->egl_disp, gw->egl_surface[0],
                       gw->egl_surface[0], gw->egl_context[0]) == EGL_FALSE)
      {
-        ERR("eglMakeCurrent() fail. code=%#x", eglGetError());
+        ERR("eglMakeCurrent() fail. code=%#x", eglGetError_thread_cmd());
         eng_window_free(gw);
         return NULL;
      }
 
-   vendor = glGetString(GL_VENDOR);
-   renderer = glGetString(GL_RENDERER);
-   version = glGetString(GL_VERSION);
+   vendor = glGetString_thread_cmd(GL_VENDOR);
+   renderer = glGetString_thread_cmd(GL_RENDERER);
+   version = glGetString_thread_cmd(GL_VERSION);
    if (!vendor) vendor   = (unsigned char *)"-UNKNOWN-";
    if (!renderer) renderer = (unsigned char *)"-UNKNOWN-";
    if (!version) version  = (unsigned char *)"-UNKNOWN-";
@@ -241,7 +241,7 @@ eng_window_free(Outbuf *gw)
      }
 
    SET_RESTORE_CONTEXT();
-   eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, 
+   eglMakeCurrent_thread_cmd(gw->egl_disp, EGL_NO_SURFACE,
                   EGL_NO_SURFACE, EGL_NO_CONTEXT);
 
    if (gw->egl_context[0] != context)
@@ -256,13 +256,83 @@ eng_window_free(Outbuf *gw)
      {
         if (context) eglDestroyContext(gw->egl_disp, context);
         eglTerminate(gw->egl_disp);
-        eglReleaseThread();
+        eglReleaseThread_thread_cmd();
         context = EGL_NO_CONTEXT;
      }
 
    free(gw);
 }
 
+typedef struct
+{
+   Outbuf *return_value;
+   Evas *evas;
+   Evas_Engine_Info_Wayland_Egl *einfo;
+   int w;
+   int h;
+   Render_Engine_Swap_Mode swap_mode;
+   int depth_bits;
+   int stencil_bits;
+   int msaa_bits;
+} Evas_Thread_Command_eng_window_new;
+
+static void
+_gl_thread_eng_window_new(void *data)
+{
+   Evas_Thread_Command_eng_window_new *thread_param =
+      (Evas_Thread_Command_eng_window_new *)data;
+
+   evas_gl_thread_begin();
+
+   thread_param->return_value = _orig_eng_window_new(thread_param->evas,
+                                                     thread_param->einfo,
+                                                     thread_param->w,
+                                                     thread_param->h,
+                                                     thread_param->swap_mode,
+                                                     thread_param->depth_bits,
+                                                     thread_param->stencil_bits,
+                                                     thread_param->msaa_bits);
+
+   evas_gl_thread_end();
+}
+
+Outbuf *
+eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode,
+               int depth_bits, int stencil_bits, int msaa_bits)
+{
+   /* eng_window_new() is moved into the worker thread that minimizes driver issue with EGL use*/
+   if (!evas_gl_thread_enabled())
+     {
+        return _orig_eng_window_new(evas,
+                                    einfo,
+                                    w,
+                                    h,
+                                    swap_mode,
+                                    depth_bits,
+                                    stencil_bits,
+                                    msaa_bits);
+     }
+
+   Evas_Thread_Command_eng_window_new thread_param_local;
+   Evas_Thread_Command_eng_window_new *thread_param = &thread_param_local;
+   thread_param->evas = evas;
+   thread_param->einfo = einfo;
+   thread_param->w = w;
+   thread_param->h = h;
+   thread_param->swap_mode = swap_mode;
+   thread_param->depth_bits = depth_bits;
+   thread_param->stencil_bits = stencil_bits;
+   thread_param->msaa_bits = msaa_bits;
+
+   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
+                              _gl_thread_eng_window_new,
+                              thread_param,
+                              EVAS_GL_THREAD_MODE_FINISH);
+
+   return thread_param->return_value;
+
+}
+
 void
 eng_window_use(Outbuf *gw)
 {
@@ -272,7 +342,7 @@ eng_window_use(Outbuf *gw)
 
    if (_evas_gl_wl_window)
      {
-        if (eglGetCurrentContext() != _evas_gl_wl_window->egl_context[0])
+        if (eglGetCurrentContext_thread_cmd() != _evas_gl_wl_window->egl_context[0])
           force = EINA_TRUE;
      }
 
@@ -291,7 +361,7 @@ eng_window_use(Outbuf *gw)
              if (gw->egl_surface[0] != EGL_NO_SURFACE)
                {
                   SET_RESTORE_CONTEXT();
-                  if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0],
+                  if (eglMakeCurrent_thread_cmd(gw->egl_disp, gw->egl_surface[0],
                                      gw->egl_surface[0],
                                      gw->egl_context[0]) == EGL_FALSE)
                     ERR("eglMakeCurrent() failed!");
@@ -319,7 +389,7 @@ eng_window_unsurf(Outbuf *gw)
    if (_evas_gl_wl_window == gw)
      {
         SET_RESTORE_CONTEXT();
-        eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, 
+        eglMakeCurrent_thread_cmd(gw->egl_disp, EGL_NO_SURFACE,
                        EGL_NO_SURFACE, EGL_NO_CONTEXT);
         if (gw->egl_surface[0] != EGL_NO_SURFACE)
           eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
@@ -349,7 +419,7 @@ eng_window_resurf(Outbuf *gw)
      }
 
    SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0],
+   if (eglMakeCurrent_thread_cmd(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0],
                       gw->egl_context[0]) == EGL_FALSE)
      ERR("eglMakeCurrent() failed!");
 
@@ -411,7 +481,7 @@ eng_outbuf_swap_mode_get(Outbuf *ob)
         Render_Engine_Swap_Mode swap_mode;
         EGLint age = 0;
 
-        if (!eglQuerySurface(ob->egl_disp, ob->egl_surface[0], 
+        if (!eglQuerySurface_thread_cmd(ob->egl_disp, ob->egl_surface[0],
                              EGL_BUFFER_AGE_EXT, &age))
           age = 0;
 
@@ -493,7 +563,7 @@ _damage_rect_set(Outbuf *ob, int x, int y, int w, int h)
      return;
 
    _convert_glcoords(rects, ob, x, y, w, h);
-   glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
+   glsym_eglSetDamageRegion(ob->egl_disp, ob->egl_surface[0], rects, 1);
 }
 
 void *
@@ -542,8 +612,8 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
 
    if (!ob->vsync)
      {
-        if (ob->info->vsync) eglSwapInterval(ob->egl_disp, 1);
-        else eglSwapInterval(ob->egl_disp, 0);
+        if (ob->info->vsync) eglSwapInterval_thread_cmd(ob->egl_disp, 1);
+        else eglSwapInterval_thread_cmd(ob->egl_disp, 0);
         ob->vsync = EINA_TRUE;
      }
 
@@ -566,15 +636,15 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
                   _convert_glcoords(&result[i], ob, r->x, r->y, r->w, r->h);
                   i += 4;
                }
-             if (glsym_eglSetDamageRegionKHR)
-                glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], result, num);
+             if (glsym_eglSetDamageRegion)
+                glsym_eglSetDamageRegion(ob->egl_disp, ob->egl_surface[0], result, num);
 
              glsym_eglSwapBuffersWithDamage(ob->egl_disp, ob->egl_surface[0],
                                             result, num);
           }
      }
    else
-      eglSwapBuffers(ob->egl_disp, ob->egl_surface[0]);
+      eglSwapBuffers_thread_cmd(ob->egl_disp, ob->egl_surface[0]);
 
    if (ob->info->callback.post_swap)
      ob->info->callback.post_swap(ob->info->callback.data, ob->evas);
@@ -640,9 +710,9 @@ void
 eng_gl_context_use(Context_3D *ctx)
 {
    SET_RESTORE_CONTEXT();
-   if (eglMakeCurrent(ctx->display, ctx->surface, 
+   if (eglMakeCurrent_thread_cmd(ctx->display, ctx->surface,
                       ctx->surface, ctx->context) == EGL_FALSE)
      {
-        ERR("eglMakeCurrent Failed: %#x", eglGetError());
+        ERR("eglMakeCurrent Failed: %#x", eglGetError_thread_cmd());
      }
 }