summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonsik Jung <sidein@samsung.com>2015-11-11 11:38:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-11-11 14:35:56 +0900
commit64890d260f9ee9607aa21e52761bba226a7b0bd1 (patch)
tree1887e0755b46955bebf27f04005f88c8b71d22d4
parent5ccd7830697b45480bfd4fbef455a07a1f222dca (diff)
EvasGL: Add error handling for GL_OES_EGL_image/EGL_Image_KHR
Summary: Add code for exception case for GL_OES_EGL_image/EGL_Image_KHR These EvasGL's extension functions does not have the code for exception case. e.g. EvasGLImage is NULL. Test Plan: Native Pixmap surface's example is created and changed EvasGLImage's value(e.g. valid data or NULL) Reviewers: raster, spacegrapher, jpeg Subscribers: scholb.kim, JoogabYun, dkdk, cedric Differential Revision: https://phab.enlightenment.org/D3284
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index fd6cb55..7c41575 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
@@ -249,6 +249,13 @@ _evgl_evasglDestroyImage(EvasGLImage image)
249{ 249{
250 EvasGLImage_EGL *img = image; 250 EvasGLImage_EGL *img = image;
251 251
252 if (!img)
253 {
254 ERR("EvasGLImage is NULL.");
255 evas_gl_common_error_set(NULL, EVAS_GL_BAD_PARAMETER);
256 return;
257 }
258
252 EXT_FUNC_EGL(eglDestroyImage)(img->dpy, img->img); 259 EXT_FUNC_EGL(eglDestroyImage)(img->dpy, img->img);
253 free(img); 260 free(img);
254} 261}
@@ -257,6 +264,34 @@ static void
257_evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image) 264_evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image)
258{ 265{
259 EvasGLImage_EGL *img = image; 266 EvasGLImage_EGL *img = image;
267 EVGL_Resource *rsc;
268 EVGL_Context *ctx;
269
270 if (!(rsc=_evgl_tls_resource_get()))
271 {
272 ERR("Unable to execute GL command. Error retrieving tls");
273 return;
274 }
275
276 if (!rsc->current_eng)
277 {
278 ERR("Unable to retrive Current Engine");
279 return;
280 }
281
282 ctx = rsc->current_ctx;
283 if (!ctx)
284 {
285 ERR("Unable to retrive Current Context");
286 return;
287 }
288
289 if (!img)
290 {
291 ERR("EvasGLImage is NULL");
292 EXT_FUNC(glEGLImageTargetTexture2DOES)(target, NULL);
293 return;
294 }
260 295
261 EXT_FUNC(glEGLImageTargetTexture2DOES)(target, img->img); 296 EXT_FUNC(glEGLImageTargetTexture2DOES)(target, img->img);
262} 297}
@@ -265,6 +300,34 @@ static void
265_evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image) 300_evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image)
266{ 301{
267 EvasGLImage_EGL *img = image; 302 EvasGLImage_EGL *img = image;
303 EVGL_Resource *rsc;
304 EVGL_Context *ctx;
305
306 if (!(rsc=_evgl_tls_resource_get()))
307 {
308 ERR("Unable to execute GL command. Error retrieving tls");
309 return;
310 }
311
312 if (!rsc->current_eng)
313 {
314 ERR("Unable to retrive Current Engine");
315 return;
316 }
317
318 ctx = rsc->current_ctx;
319 if (!ctx)
320 {
321 ERR("Unable to retrive Current Context");
322 return;
323 }
324
325 if (!img)
326 {
327 ERR("EvasGLImage is NULL");
328 EXT_FUNC(glEGLImageTargetRenderbufferStorageOES)(target, NULL);
329 return;
330 }
268 331
269 EXT_FUNC(glEGLImageTargetRenderbufferStorageOES)(target, img->img); 332 EXT_FUNC(glEGLImageTargetRenderbufferStorageOES)(target, img->img);
270} 333}