Evas GL: Add safety checks for missing functions

This commit is contained in:
Jean-Philippe Andre 2014-09-01 21:12:29 +09:00
parent 49f79f0a73
commit 0ee951fc21
1 changed files with 14 additions and 0 deletions

View File

@ -377,6 +377,13 @@ evas_gl_current_context_get(Evas_GL *evas_gl)
return NULL;
MAGIC_CHECK_END();
if (!evas_gl->evas->engine.func->gl_current_context_get)
{
CRI("Can not get current context with this engine: %s",
evas_gl->evas->engine.module->definition->name);
return NULL;
}
internal_ctx = evas_gl->evas->engine.func->gl_current_context_get(evas_gl->evas->engine.data.output);
if (!internal_ctx)
return NULL;
@ -408,6 +415,13 @@ evas_gl_current_surface_get(Evas_GL *evas_gl)
return NULL;
MAGIC_CHECK_END();
if (!evas_gl->evas->engine.func->gl_current_surface_get)
{
CRI("Can not get current surface with this engine: %s",
evas_gl->evas->engine.module->definition->name);
return NULL;
}
internal_sfc = evas_gl->evas->engine.func->gl_current_surface_get(evas_gl->evas->engine.data.output);
if (!internal_sfc)
return NULL;