summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:26 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:52:26 -0700
commit84c6d3332e2243b6074c995c05c8b50e29cefb4d (patch)
tree2b39c0022d0b6ece495b74c4c1a012f5483326be
parent9ba662bd636a21f8fe4f6620d947d623ad99316f (diff)
evas: remove unused engine data from error set/get code.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api.c2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.c10
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_gles1.c4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c50
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c2
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c70
7 files changed, 71 insertions, 71 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 25d5d6a..ceaab2b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -1357,7 +1357,7 @@ _evgl_glGetString(GLenum name)
1357 { 1357 {
1358 ERR("Current context is NULL, not calling glGetString"); 1358 ERR("Current context is NULL, not calling glGetString");
1359 // This sets evas_gl_error_get instead of eglGetError... 1359 // This sets evas_gl_error_get instead of eglGetError...
1360 evas_gl_common_error_set(NULL, EVAS_GL_BAD_CONTEXT); 1360 evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
1361 return NULL; 1361 return NULL;
1362 } 1362 }
1363 1363
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index 1169e79..4c63761 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -139,7 +139,7 @@ _evgl_egl_display_get(const char *function, Evas_GL *evgl)
139 if (!evgl_engine || !evgl_engine->funcs || !evgl_engine->funcs->display_get) 139 if (!evgl_engine || !evgl_engine->funcs || !evgl_engine->funcs->display_get)
140 { 140 {
141 ERR("%s: Invalid Engine... (Can't acccess EGL Display)\n", function); 141 ERR("%s: Invalid Engine... (Can't acccess EGL Display)\n", function);
142 evas_gl_common_error_set(NULL, EVAS_GL_BAD_DISPLAY); 142 evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
143 return EGL_NO_DISPLAY; 143 return EGL_NO_DISPLAY;
144 } 144 }
145 145
@@ -147,7 +147,7 @@ _evgl_egl_display_get(const char *function, Evas_GL *evgl)
147 { 147 {
148 if (evgl) goto fallback; 148 if (evgl) goto fallback;
149 ERR("%s: Unable to execute GL command. Error retrieving tls", function); 149 ERR("%s: Unable to execute GL command. Error retrieving tls", function);
150 evas_gl_common_error_set(NULL, EVAS_GL_NOT_INITIALIZED); 150 evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
151 return EGL_NO_DISPLAY; 151 return EGL_NO_DISPLAY;
152 } 152 }
153 153
@@ -155,7 +155,7 @@ _evgl_egl_display_get(const char *function, Evas_GL *evgl)
155 { 155 {
156 if (evgl) goto fallback; 156 if (evgl) goto fallback;
157 ERR("%s: no current engine set; ensure you've called evas_gl_make_current()", function); 157 ERR("%s: no current engine set; ensure you've called evas_gl_make_current()", function);
158 evas_gl_common_error_set(NULL, EVAS_GL_NOT_INITIALIZED); 158 evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
159 return EGL_NO_DISPLAY; 159 return EGL_NO_DISPLAY;
160 } 160 }
161 161
@@ -238,7 +238,7 @@ _evgl_evasglCreateImageForContext(Evas_GL *evasgl, Evas_GL_Context *evasctx,
238 if (!dpy || !evasgl) 238 if (!dpy || !evasgl)
239 { 239 {
240 ERR("Evas_GL can not be NULL here."); 240 ERR("Evas_GL can not be NULL here.");
241 evas_gl_common_error_set(NULL, EVAS_GL_BAD_DISPLAY); 241 evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
242 return NULL; 242 return NULL;
243 } 243 }
244 244
@@ -254,7 +254,7 @@ _evgl_evasglDestroyImage(EvasGLImage image)
254 if (!img) 254 if (!img)
255 { 255 {
256 ERR("EvasGLImage is NULL."); 256 ERR("EvasGLImage is NULL.");
257 evas_gl_common_error_set(NULL, EVAS_GL_BAD_PARAMETER); 257 evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
258 return; 258 return;
259 } 259 }
260 260
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
index 0619c03..7117751 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c
@@ -1120,14 +1120,14 @@ _evgl_gles1_glGetString(GLenum name)
1120 { 1120 {
1121 ERR("Current context is NULL, not calling glGetString"); 1121 ERR("Current context is NULL, not calling glGetString");
1122 // This sets evas_gl_error_get instead of glGetError... 1122 // This sets evas_gl_error_get instead of glGetError...
1123 evas_gl_common_error_set(NULL, EVAS_GL_BAD_CONTEXT); 1123 evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
1124 return NULL; 1124 return NULL;
1125 } 1125 }
1126 1126
1127 if (rsc->current_ctx->version != EVAS_GL_GLES_1_X) 1127 if (rsc->current_ctx->version != EVAS_GL_GLES_1_X)
1128 { 1128 {
1129 ERR("Invalid context version %d", (int) rsc->current_ctx->version); 1129 ERR("Invalid context version %d", (int) rsc->current_ctx->version);
1130 evas_gl_common_error_set(NULL, EVAS_GL_BAD_MATCH); 1130 evas_gl_common_error_set(EVAS_GL_BAD_MATCH);
1131 return NULL; 1131 return NULL;
1132 } 1132 }
1133 1133
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index d9deb99..6124cf8 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -564,8 +564,8 @@ EAPI void evas_gl_preload_render_unlock(evas_gl_make_current_cb make_cur
564EAPI void evas_gl_preload_render_relax(evas_gl_make_current_cb make_current, void *engine_data); 564EAPI void evas_gl_preload_render_relax(evas_gl_make_current_cb make_current, void *engine_data);
565EAPI void evas_gl_symbols(void *(*GetProcAddress)(const char *name), const char *extsn); 565EAPI void evas_gl_symbols(void *(*GetProcAddress)(const char *name), const char *extsn);
566 566
567EAPI void evas_gl_common_error_set(void *data, int error_enum); 567EAPI void evas_gl_common_error_set(int error_enum);
568EAPI int evas_gl_common_error_get(void *data); 568EAPI int evas_gl_common_error_get(void);
569EAPI void *evas_gl_common_current_context_get(void); 569EAPI void *evas_gl_common_current_context_get(void);
570 570
571typedef int (*Evas_GL_Preload)(void); 571typedef int (*Evas_GL_Preload)(void);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index c4d3541..bb80888 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -1782,7 +1782,7 @@ _evgl_direct_enabled(void)
1782} 1782}
1783 1783
1784EAPI void 1784EAPI void
1785evas_gl_common_error_set(void *data EINA_UNUSED, int error_enum) 1785evas_gl_common_error_set(int error_enum)
1786{ 1786{
1787 EVGL_Resource *rsc; 1787 EVGL_Resource *rsc;
1788 1788
@@ -1796,7 +1796,7 @@ evas_gl_common_error_set(void *data EINA_UNUSED, int error_enum)
1796} 1796}
1797 1797
1798EAPI int 1798EAPI int
1799evas_gl_common_error_get(void *data EINA_UNUSED) 1799evas_gl_common_error_get(void)
1800{ 1800{
1801 EVGL_Resource *rsc; 1801 EVGL_Resource *rsc;
1802 1802
@@ -2004,7 +2004,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
2004 if (!evgl_engine) 2004 if (!evgl_engine)
2005 { 2005 {
2006 ERR("Invalid EVGL Engine!"); 2006 ERR("Invalid EVGL Engine!");
2007 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ACCESS); 2007 evas_gl_common_error_set(EVAS_GL_BAD_ACCESS);
2008 return NULL; 2008 return NULL;
2009 } 2009 }
2010 dbg = evgl_engine->api_debug_mode; 2010 dbg = evgl_engine->api_debug_mode;
@@ -2012,7 +2012,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
2012 if (!cfg) 2012 if (!cfg)
2013 { 2013 {
2014 ERR("Invalid Config!"); 2014 ERR("Invalid Config!");
2015 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONFIG); 2015 evas_gl_common_error_set(EVAS_GL_BAD_CONFIG);
2016 return NULL; 2016 return NULL;
2017 } 2017 }
2018 2018
@@ -2021,7 +2021,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
2021 { 2021 {
2022 ERR("Requested surface size [%d, %d] is greater than max supported size [%d, %d]", 2022 ERR("Requested surface size [%d, %d] is greater than max supported size [%d, %d]",
2023 w, h, evgl_engine->caps.max_w, evgl_engine->caps.max_h); 2023 w, h, evgl_engine->caps.max_w, evgl_engine->caps.max_h);
2024 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_PARAMETER); 2024 evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
2025 return NULL; 2025 return NULL;
2026 } 2026 }
2027 2027
@@ -2030,7 +2030,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
2030 if (!sfc) 2030 if (!sfc)
2031 { 2031 {
2032 ERR("Surface allocation failed."); 2032 ERR("Surface allocation failed.");
2033 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2033 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2034 goto error; 2034 goto error;
2035 } 2035 }
2036 2036
@@ -2059,7 +2059,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
2059 if (!_internal_config_set(eng_data, sfc, cfg)) 2059 if (!_internal_config_set(eng_data, sfc, cfg))
2060 { 2060 {
2061 ERR("Unsupported Format!"); 2061 ERR("Unsupported Format!");
2062 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONFIG); 2062 evas_gl_common_error_set(EVAS_GL_BAD_CONFIG);
2063 goto error; 2063 goto error;
2064 } 2064 }
2065 sfc->cfg = cfg; 2065 sfc->cfg = cfg;
@@ -2092,7 +2092,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg,
2092 if (!evgl_engine) 2092 if (!evgl_engine)
2093 { 2093 {
2094 ERR("Invalid EVGL Engine!"); 2094 ERR("Invalid EVGL Engine!");
2095 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ACCESS); 2095 evas_gl_common_error_set(EVAS_GL_BAD_ACCESS);
2096 return NULL; 2096 return NULL;
2097 } 2097 }
2098 dbg = evgl_engine->api_debug_mode; 2098 dbg = evgl_engine->api_debug_mode;
@@ -2100,14 +2100,14 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg,
2100 if (!cfg) 2100 if (!cfg)
2101 { 2101 {
2102 ERR("Invalid Config!"); 2102 ERR("Invalid Config!");
2103 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONFIG); 2103 evas_gl_common_error_set(EVAS_GL_BAD_CONFIG);
2104 return NULL; 2104 return NULL;
2105 } 2105 }
2106 2106
2107 if (!evgl_engine->funcs->pbuffer_surface_create) 2107 if (!evgl_engine->funcs->pbuffer_surface_create)
2108 { 2108 {
2109 ERR("Engine can not create PBuffers"); 2109 ERR("Engine can not create PBuffers");
2110 evas_gl_common_error_set(eng_data, EVAS_GL_NOT_INITIALIZED); 2110 evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
2111 return NULL; 2111 return NULL;
2112 } 2112 }
2113 2113
@@ -2116,7 +2116,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg,
2116 if (!sfc) 2116 if (!sfc)
2117 { 2117 {
2118 ERR("Surface allocation failed."); 2118 ERR("Surface allocation failed.");
2119 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2119 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2120 goto error; 2120 goto error;
2121 } 2121 }
2122 2122
@@ -2135,7 +2135,7 @@ evgl_pbuffer_surface_create(void *eng_data, Evas_GL_Config *cfg,
2135 if (!_internal_config_set(eng_data, sfc, cfg)) 2135 if (!_internal_config_set(eng_data, sfc, cfg))
2136 { 2136 {
2137 ERR("Unsupported Format!"); 2137 ERR("Unsupported Format!");
2138 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONFIG); 2138 evas_gl_common_error_set(EVAS_GL_BAD_CONFIG);
2139 goto error; 2139 goto error;
2140 } 2140 }
2141 } 2141 }
@@ -2304,14 +2304,14 @@ evgl_context_create(void *eng_data, EVGL_Context *share_ctx,
2304 if (!evgl_engine) 2304 if (!evgl_engine)
2305 { 2305 {
2306 ERR("Invalid EVGL Engine!"); 2306 ERR("Invalid EVGL Engine!");
2307 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ACCESS); 2307 evas_gl_common_error_set(EVAS_GL_BAD_ACCESS);
2308 return NULL; 2308 return NULL;
2309 } 2309 }
2310 2310
2311 if ((version < EVAS_GL_GLES_1_X) || (version > EVAS_GL_GLES_3_X)) 2311 if ((version < EVAS_GL_GLES_1_X) || (version > EVAS_GL_GLES_3_X))
2312 { 2312 {
2313 ERR("Invalid context version number %d", version); 2313 ERR("Invalid context version number %d", version);
2314 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_PARAMETER); 2314 evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
2315 return NULL; 2315 return NULL;
2316 } 2316 }
2317 2317
@@ -2323,7 +2323,7 @@ evgl_context_create(void *eng_data, EVGL_Context *share_ctx,
2323 if (!ctx) 2323 if (!ctx)
2324 { 2324 {
2325 ERR("Error allocating context object."); 2325 ERR("Error allocating context object.");
2326 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2326 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2327 return NULL; 2327 return NULL;
2328 } 2328 }
2329 2329
@@ -2467,8 +2467,8 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2467 if ( (!evgl_engine) || ((sfc) && (!ctx)) ) 2467 if ( (!evgl_engine) || ((sfc) && (!ctx)) )
2468 { 2468 {
2469 ERR("Invalid Input: Engine: %p, Surface: %p, Context: %p", evgl_engine, sfc, ctx); 2469 ERR("Invalid Input: Engine: %p, Surface: %p, Context: %p", evgl_engine, sfc, ctx);
2470 if (!evgl_engine) evas_gl_common_error_set(eng_data, EVAS_GL_NOT_INITIALIZED); 2470 if (!evgl_engine) evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
2471 if (!ctx) evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONTEXT); 2471 if (!ctx) evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
2472 return 0; 2472 return 0;
2473 } 2473 }
2474 2474
@@ -2548,7 +2548,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2548 if (!_internal_resource_make_current(eng_data, sfc, ctx)) 2548 if (!_internal_resource_make_current(eng_data, sfc, ctx))
2549 { 2549 {
2550 ERR("Error doing a make current with internal surface. Context: %p", ctx); 2550 ERR("Error doing a make current with internal surface. Context: %p", ctx);
2551 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONTEXT); 2551 evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
2552 return 0; 2552 return 0;
2553 } 2553 }
2554 2554
@@ -2565,14 +2565,14 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2565 if (!evgl_api_get(eng_data, ctx->version, EINA_FALSE)) 2565 if (!evgl_api_get(eng_data, ctx->version, EINA_FALSE))
2566 { 2566 {
2567 ERR("Unable to get the list of GL APIs for version %d", ctx->version); 2567 ERR("Unable to get the list of GL APIs for version %d", ctx->version);
2568 evas_gl_common_error_set(eng_data, EVAS_GL_NOT_INITIALIZED); 2568 evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
2569 return 0; 2569 return 0;
2570 } 2570 }
2571 2571
2572 if (!_context_ext_check(ctx)) 2572 if (!_context_ext_check(ctx))
2573 { 2573 {
2574 ERR("Unable to check required extension for the current context"); 2574 ERR("Unable to check required extension for the current context");
2575 evas_gl_common_error_set(eng_data, EVAS_GL_NOT_INITIALIZED); 2575 evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
2576 return 0; 2576 return 0;
2577 } 2577 }
2578 } 2578 }
@@ -2592,7 +2592,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2592 if (!sfc->color_buf && !_surface_buffers_create(sfc)) 2592 if (!sfc->color_buf && !_surface_buffers_create(sfc))
2593 { 2593 {
2594 ERR("Unable to create specified surfaces."); 2594 ERR("Unable to create specified surfaces.");
2595 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2595 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2596 return 0; 2596 return 0;
2597 } 2597 }
2598 2598
@@ -2610,7 +2610,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2610 if (!_surface_buffers_allocate(eng_data, sfc, 0, 0, ctx->version)) 2610 if (!_surface_buffers_allocate(eng_data, sfc, 0, 0, ctx->version))
2611 { 2611 {
2612 ERR("Unable to destroy surface buffers!"); 2612 ERR("Unable to destroy surface buffers!");
2613 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2613 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2614 return 0; 2614 return 0;
2615 } 2615 }
2616 sfc->buffers_allocated = 0; 2616 sfc->buffers_allocated = 0;
@@ -2631,7 +2631,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2631 if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version)) 2631 if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version))
2632 { 2632 {
2633 ERR("Unable Create Specificed Surfaces. Unsupported format!"); 2633 ERR("Unable Create Specificed Surfaces. Unsupported format!");
2634 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2634 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2635 return 0; 2635 return 0;
2636 } 2636 }
2637 sfc->buffers_allocated = 1; 2637 sfc->buffers_allocated = 1;
@@ -2646,7 +2646,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2646 if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version)) 2646 if (!_surface_buffers_allocate(eng_data, sfc, sfc->w, sfc->h, ctx->version))
2647 { 2647 {
2648 ERR("Unable Create Allocate Memory for Surface."); 2648 ERR("Unable Create Allocate Memory for Surface.");
2649 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_ALLOC); 2649 evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
2650 return 0; 2650 return 0;
2651 } 2651 }
2652 sfc->buffers_allocated = 1; 2652 sfc->buffers_allocated = 1;
@@ -2829,7 +2829,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2829 if (!_surface_buffers_fbo_set(sfc, ctx->surface_fbo, ctx->version)) 2829 if (!_surface_buffers_fbo_set(sfc, ctx->surface_fbo, ctx->version))
2830 { 2830 {
2831 ERR("Attaching buffers to context fbo failed. Engine: %p Surface: %p Context FBO: %u", evgl_engine, sfc, ctx->surface_fbo); 2831 ERR("Attaching buffers to context fbo failed. Engine: %p Surface: %p Context FBO: %u", evgl_engine, sfc, ctx->surface_fbo);
2832 evas_gl_common_error_set(eng_data, EVAS_GL_BAD_CONTEXT); 2832 evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
2833 return 0; 2833 return 0;
2834 } 2834 }
2835 } 2835 }
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index a3e1990..67b5890 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1853,7 +1853,7 @@ eng_gl_surface_query(void *engine, void *surface, int attr, void *value)
1853 */ 1853 */
1854 default: break; 1854 default: break;
1855 } 1855 }
1856 evas_gl_common_error_set(engine, EVAS_GL_BAD_ATTRIBUTE); 1856 evas_gl_common_error_set(EVAS_GL_BAD_ATTRIBUTE);
1857 return EINA_FALSE; 1857 return EINA_FALSE;
1858 } 1858 }
1859#else 1859#else
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 45675ec..46e47bb 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -228,7 +228,7 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
228 if (!re) 228 if (!re)
229 { 229 {
230 ERR("Invalid Render Engine Data!"); 230 ERR("Invalid Render Engine Data!");
231 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 231 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
232 return 0; 232 return 0;
233 } 233 }
234 234
@@ -283,7 +283,7 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
283 if (!ret) 283 if (!ret)
284 { 284 {
285 ERR("glXMakeContextCurrent() failed!"); 285 ERR("glXMakeContextCurrent() failed!");
286 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 286 glsym_evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
287 return 0; 287 return 0;
288 } 288 }
289 return 1; 289 return 1;
@@ -308,7 +308,7 @@ evgl_eng_make_current(void *data, void *surface, void *context, int flush)
308 { 308 {
309 ERR("glXMakeContextCurrent() failed. Ret: %d! Context: %p Surface: %p", 309 ERR("glXMakeContextCurrent() failed. Ret: %d! Context: %p Surface: %p",
310 ret, (void *)ctx, (void *)sfc); 310 ret, (void *)ctx, (void *)sfc);
311 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 311 glsym_evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
312 return 0; 312 return 0;
313 } 313 }
314 } 314 }
@@ -327,7 +327,7 @@ evgl_eng_native_window_create(void *data)
327 if (!re) 327 if (!re)
328 { 328 {
329 ERR("Invalid Render Engine Data!"); 329 ERR("Invalid Render Engine Data!");
330 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 330 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
331 return NULL; 331 return NULL;
332 } 332 }
333 333
@@ -356,7 +356,7 @@ evgl_eng_native_window_create(void *data)
356 if (!win) 356 if (!win)
357 { 357 {
358 ERR("Creating native X window failed."); 358 ERR("Creating native X window failed.");
359 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 359 glsym_evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
360 return NULL; 360 return NULL;
361 } 361 }
362 362
@@ -372,14 +372,14 @@ evgl_eng_native_window_destroy(void *data, void *native_window)
372 if (!re) 372 if (!re)
373 { 373 {
374 ERR("Invalid Render Engine Data!"); 374 ERR("Invalid Render Engine Data!");
375 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 375 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
376 return 0; 376 return 0;
377 } 377 }
378 378
379 if (!native_window) 379 if (!native_window)
380 { 380 {
381 ERR("Inavlid native surface."); 381 ERR("Inavlid native surface.");
382 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_NATIVE_WINDOW); 382 glsym_evas_gl_common_error_set(EVAS_GL_BAD_NATIVE_WINDOW);
383 return 0; 383 return 0;
384 } 384 }
385 385
@@ -402,7 +402,7 @@ evgl_eng_window_surface_create(void *data, void *native_window EINA_UNUSED)
402 if (!re) 402 if (!re)
403 { 403 {
404 ERR("Invalid Render Engine Data!"); 404 ERR("Invalid Render Engine Data!");
405 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 405 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
406 return NULL; 406 return NULL;
407 } 407 }
408 408
@@ -444,7 +444,7 @@ evgl_eng_window_surface_destroy(void *data, void *surface)
444 if (!re) 444 if (!re)
445 { 445 {
446 ERR("Invalid Render Engine Data!"); 446 ERR("Invalid Render Engine Data!");
447 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 447 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
448 return 0; 448 return 0;
449 } 449 }
450 450
@@ -452,7 +452,7 @@ evgl_eng_window_surface_destroy(void *data, void *surface)
452 if (!surface) 452 if (!surface)
453 { 453 {
454 ERR("Invalid surface."); 454 ERR("Invalid surface.");
455 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_SURFACE); 455 glsym_evas_gl_common_error_set(EVAS_GL_BAD_SURFACE);
456 return 0; 456 return 0;
457 } 457 }
458 458
@@ -472,14 +472,14 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver
472 if (!re) 472 if (!re)
473 { 473 {
474 ERR("Invalid Render Engine Data!"); 474 ERR("Invalid Render Engine Data!");
475 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 475 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
476 return NULL; 476 return NULL;
477 } 477 }
478 478
479 if ((version < EVAS_GL_GLES_1_X) || (version > EVAS_GL_GLES_3_X)) 479 if ((version < EVAS_GL_GLES_1_X) || (version > EVAS_GL_GLES_3_X))
480 { 480 {
481 ERR("Invalid context version number %d", version); 481 ERR("Invalid context version number %d", version);
482 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_PARAMETER); 482 glsym_evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
483 return NULL; 483 return NULL;
484 } 484 }
485 485
@@ -488,7 +488,7 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver
488 ((!eng_get_ob(re)->gl_context) || (eng_get_ob(re)->gl_context->gles_version != EVAS_GL_GLES_3_X))) 488 ((!eng_get_ob(re)->gl_context) || (eng_get_ob(re)->gl_context->gles_version != EVAS_GL_GLES_3_X)))
489 { 489 {
490 ERR("GLES 3 version not supported!"); 490 ERR("GLES 3 version not supported!");
491 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_ATTRIBUTE); 491 glsym_evas_gl_common_error_set(EVAS_GL_BAD_ATTRIBUTE);
492 return NULL; 492 return NULL;
493 } 493 }
494 EGLContext context = EGL_NO_CONTEXT; 494 EGLContext context = EGL_NO_CONTEXT;
@@ -537,7 +537,7 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver
537 { 537 {
538 int err = eglGetError(); 538 int err = eglGetError();
539 ERR("Engine Context Creations Failed. Error: %#x.", err); 539 ERR("Engine Context Creations Failed. Error: %#x.", err);
540 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 540 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
541 return NULL; 541 return NULL;
542 } 542 }
543 543
@@ -564,8 +564,8 @@ evgl_eng_context_create(void *data, void *share_ctx, Evas_GL_Context_Version ver
564 if (!context) 564 if (!context)
565 { 565 {
566 ERR("Internal Resource Context Creations Failed."); 566 ERR("Internal Resource Context Creations Failed.");
567 if(!(eng_get_ob(re)->info->info.display)) glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_DISPLAY); 567 if(!(eng_get_ob(re)->info->info.display)) glsym_evas_gl_common_error_set(EVAS_GL_BAD_DISPLAY);
568 if(!(eng_get_ob(re)->win)) glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_NATIVE_WINDOW); 568 if(!(eng_get_ob(re)->win)) glsym_evas_gl_common_error_set(EVAS_GL_BAD_NATIVE_WINDOW);
569 return NULL; 569 return NULL;
570 } 570 }
571 571
@@ -583,8 +583,8 @@ evgl_eng_context_destroy(void *data, void *context)
583 if ((!re) || (!context)) 583 if ((!re) || (!context))
584 { 584 {
585 ERR("Invalid Render Input Data. Engine: %p, Context: %p", data, context); 585 ERR("Invalid Render Input Data. Engine: %p, Context: %p", data, context);
586 if (!re) glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 586 if (!re) glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
587 if (!context) glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_CONTEXT); 587 if (!context) glsym_evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
588 return 0; 588 return 0;
589 } 589 }
590 590
@@ -606,7 +606,7 @@ evgl_eng_string_get(void *data)
606 if (!re) 606 if (!re)
607 { 607 {
608 ERR("Invalid Render Engine Data!"); 608 ERR("Invalid Render Engine Data!");
609 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 609 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
610 return NULL; 610 return NULL;
611 } 611 }
612 612
@@ -639,7 +639,7 @@ evgl_eng_rotation_angle_get(void *data)
639 if (!re) 639 if (!re)
640 { 640 {
641 ERR("Invalid Render Engine Data!"); 641 ERR("Invalid Render Engine Data!");
642 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 642 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
643 return 0; 643 return 0;
644 } 644 }
645 645
@@ -648,7 +648,7 @@ evgl_eng_rotation_angle_get(void *data)
648 else 648 else
649 { 649 {
650 ERR("Unable to retrieve rotation angle."); 650 ERR("Unable to retrieve rotation angle.");
651 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_CONTEXT); 651 glsym_evas_gl_common_error_set(EVAS_GL_BAD_CONTEXT);
652 return 0; 652 return 0;
653 } 653 }
654} 654}
@@ -739,7 +739,7 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc,
739 || (num_config < 1)) 739 || (num_config < 1))
740 { 740 {
741 int err = eglGetError(); 741 int err = eglGetError();
742 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 742 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
743 ERR("eglChooseConfig failed with error %x", err); 743 ERR("eglChooseConfig failed with error %x", err);
744 return NULL; 744 return NULL;
745 } 745 }
@@ -770,7 +770,7 @@ evgl_eng_pbuffer_surface_create(void *data, EVGL_Surface *sfc,
770 if (!egl_sfc) 770 if (!egl_sfc)
771 { 771 {
772 int err = eglGetError(); 772 int err = eglGetError();
773 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 773 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
774 ERR("eglCreatePbufferSurface failed with error %x", err); 774 ERR("eglCreatePbufferSurface failed with error %x", err);
775 return NULL; 775 return NULL;
776 } 776 }
@@ -867,14 +867,14 @@ evgl_eng_pbuffer_surface_destroy(void *data, void *surface)
867 if (!data) 867 if (!data)
868 { 868 {
869 ERR("Invalid Render Engine Data!"); 869 ERR("Invalid Render Engine Data!");
870 glsym_evas_gl_common_error_set(NULL, EVAS_GL_NOT_INITIALIZED); 870 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
871 return 0; 871 return 0;
872 } 872 }
873 873
874 if (!surface) 874 if (!surface)
875 { 875 {
876 ERR("Invalid surface."); 876 ERR("Invalid surface.");
877 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_SURFACE); 877 glsym_evas_gl_common_error_set(EVAS_GL_BAD_SURFACE);
878 return 0; 878 return 0;
879 } 879 }
880 880
@@ -912,14 +912,14 @@ evgl_eng_indirect_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
912 912
913 if (!re || !evgl_sfc || !cfg) 913 if (!re || !evgl_sfc || !cfg)
914 { 914 {
915 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_PARAMETER); 915 glsym_evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
916 return NULL; 916 return NULL;
917 } 917 }
918 918
919 if ((w < 1) || (h < 1)) 919 if ((w < 1) || (h < 1))
920 { 920 {
921 ERR("Inconsistent parameters, not creating any surface!"); 921 ERR("Inconsistent parameters, not creating any surface!");
922 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_PARAMETER); 922 glsym_evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
923 return NULL; 923 return NULL;
924 } 924 }
925 925
@@ -940,7 +940,7 @@ evgl_eng_indirect_surface_create(EVGL_Engine *evgl EINA_UNUSED, void *data,
940 if (!px) 940 if (!px)
941 { 941 {
942 ERR("Failed to create XPixmap!"); 942 ERR("Failed to create XPixmap!");
943 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_ALLOC); 943 glsym_evas_gl_common_error_set(EVAS_GL_BAD_ALLOC);
944 return NULL; 944 return NULL;
945 } 945 }
946 946
@@ -1023,7 +1023,7 @@ try_again:
1023 { 1023 {
1024 int err = eglGetError(); 1024 int err = eglGetError();
1025 ERR("eglChooseConfig() can't find any configs, error: %x", err); 1025 ERR("eglChooseConfig() can't find any configs, error: %x", err);
1026 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 1026 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
1027 XFreePixmap(eng_get_ob(re)->disp, px); 1027 XFreePixmap(eng_get_ob(re)->disp, px);
1028 return NULL; 1028 return NULL;
1029 } 1029 }
@@ -1103,7 +1103,7 @@ try_again:
1103 { 1103 {
1104 int err = eglGetError(); 1104 int err = eglGetError();
1105 ERR("eglCreatePixmapSurface failed with error: %x", err); 1105 ERR("eglCreatePixmapSurface failed with error: %x", err);
1106 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 1106 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
1107 XFreePixmap(eng_get_ob(re)->disp, px); 1107 XFreePixmap(eng_get_ob(re)->disp, px);
1108 return NULL; 1108 return NULL;
1109 } 1109 }
@@ -1144,7 +1144,7 @@ evgl_eng_indirect_surface_destroy(void *data, EVGL_Surface *evgl_sfc)
1144 if (!re) 1144 if (!re)
1145 { 1145 {
1146 ERR("Invalid Render Engine Data!"); 1146 ERR("Invalid Render Engine Data!");
1147 glsym_evas_gl_common_error_set(data, EVAS_GL_NOT_INITIALIZED); 1147 glsym_evas_gl_common_error_set(EVAS_GL_NOT_INITIALIZED);
1148 return 0; 1148 return 0;
1149 } 1149 }
1150 1150
@@ -1152,7 +1152,7 @@ evgl_eng_indirect_surface_destroy(void *data, EVGL_Surface *evgl_sfc)
1152 if ((!evgl_sfc) || (!evgl_sfc->indirect_sfc)) 1152 if ((!evgl_sfc) || (!evgl_sfc->indirect_sfc))
1153 { 1153 {
1154 ERR("Invalid surface"); 1154 ERR("Invalid surface");
1155 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_SURFACE); 1155 glsym_evas_gl_common_error_set(EVAS_GL_BAD_SURFACE);
1156 return 0; 1156 return 0;
1157 } 1157 }
1158 1158
@@ -1162,7 +1162,7 @@ evgl_eng_indirect_surface_destroy(void *data, EVGL_Surface *evgl_sfc)
1162 if (!evgl_sfc->indirect_sfc_native) 1162 if (!evgl_sfc->indirect_sfc_native)
1163 { 1163 {
1164 ERR("Inconsistent parameters, not freeing XPixmap for indirect surface!"); 1164 ERR("Inconsistent parameters, not freeing XPixmap for indirect surface!");
1165 glsym_evas_gl_common_error_set(data, EVAS_GL_BAD_PARAMETER); 1165 glsym_evas_gl_common_error_set(EVAS_GL_BAD_PARAMETER);
1166 return 0; 1166 return 0;
1167 } 1167 }
1168 1168
@@ -1208,7 +1208,7 @@ evgl_eng_gles_context_create(void *data,
1208 { 1208 {
1209 int err = eglGetError(); 1209 int err = eglGetError();
1210 ERR("eglCreateContext failed with error 0x%x", err); 1210 ERR("eglCreateContext failed with error 0x%x", err);
1211 glsym_evas_gl_common_error_set(data, err - EGL_SUCCESS); 1211 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
1212 return NULL; 1212 return NULL;
1213 } 1213 }
1214 1214
@@ -1900,7 +1900,7 @@ eng_gl_error_get(void *engine)
1900#endif 1900#endif
1901 1901
1902end: 1902end:
1903 glsym_evas_gl_common_error_set(engine, EVAS_GL_SUCCESS); 1903 glsym_evas_gl_common_error_set(EVAS_GL_SUCCESS);
1904 return err; 1904 return err;
1905} 1905}
1906 1906