evas_gl.c | evas_gl.c | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
evas_gl = calloc(1, sizeof(Evas_GL)); | evas_gl = calloc(1, sizeof(Evas_GL)); | |||
if (!evas_gl) return NULL; | if (!evas_gl) return NULL; | |||
evas_gl->magic = MAGIC_EVAS_GL; | evas_gl->magic = MAGIC_EVAS_GL; | |||
evas_gl->evas = e; | evas_gl->evas = e; | |||
if (!evas_gl->evas->engine.func->gl_context_create) | if (!evas_gl->evas->engine.func->gl_context_create) | |||
{ | { | |||
ERR("GL engine not available\n"); | ERR("Evas GL engine not available."); | |||
free(evas_gl); | free(evas_gl); | |||
return NULL; | return NULL; | |||
} | } | |||
return evas_gl; | return evas_gl; | |||
} | } | |||
EAPI void | EAPI void | |||
evas_gl_free(Evas_GL *evas_gl) | evas_gl_free(Evas_GL *evas_gl) | |||
{ | { | |||
skipping to change at line 98 | skipping to change at line 98 | |||
evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height) | evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int height) | |||
{ | { | |||
Evas_GL_Surface *surf; | Evas_GL_Surface *surf; | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return NULL; | return NULL; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (!config) | if (!config) | |||
{ | { | |||
ERR("Invalid Config\n"); | ERR("Invalid Config Pointer!"); | |||
return NULL; | ||||
} | ||||
if ( (width <= 0) || (height <= 0)) | ||||
{ | ||||
ERR("Invalid surface dimensions: %d, %d", width, height); | ||||
return NULL; | return NULL; | |||
} | } | |||
surf = calloc(1, sizeof(Evas_GL_Surface)); | surf = calloc(1, sizeof(Evas_GL_Surface)); | |||
if (!surf) return NULL; | if (!surf) return NULL; | |||
surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas ->engine.data.output, config, width, height); | surf->data = evas_gl->evas->engine.func->gl_surface_create(evas_gl->evas ->engine.data.output, config, width, height); | |||
if (!surf->data) | if (!surf->data) | |||
{ | { | |||
ERR("Failed creating a surface from the engine\n"); | ERR("Failed creating a surface from the engine."); | |||
free(surf); | free(surf); | |||
return NULL; | return NULL; | |||
} | } | |||
// Keep track of the surface creations | // Keep track of the surface creations | |||
evas_gl->surfaces = eina_list_prepend(evas_gl->surfaces, surf); | evas_gl->surfaces = eina_list_prepend(evas_gl->surfaces, surf); | |||
return surf; | return surf; | |||
} | } | |||
EAPI void | EAPI void | |||
evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf) | evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf) | |||
{ | { | |||
// Magic | // Magic | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (!surf) | if (!surf) | |||
{ | { | |||
ERR("Trying to destroy a NULL surface pointer!\n"); | ERR("Trying to destroy a NULL surface pointer!"); | |||
return; | return; | |||
} | } | |||
// Call Engine's Surface Destroy | // Call Engine's Surface Destroy | |||
evas_gl->evas->engine.func->gl_surface_destroy(evas_gl->evas->engine.dat a.output, surf->data); | evas_gl->evas->engine.func->gl_surface_destroy(evas_gl->evas->engine.dat a.output, surf->data); | |||
// Remove it from the list | // Remove it from the list | |||
evas_gl->surfaces = eina_list_remove(evas_gl->surfaces, surf); | evas_gl->surfaces = eina_list_remove(evas_gl->surfaces, surf); | |||
// Delete the object | // Delete the object | |||
skipping to change at line 160 | skipping to change at line 166 | |||
// Magic | // Magic | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return NULL; | return NULL; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
// Allocate a context object | // Allocate a context object | |||
ctx = calloc(1, sizeof(Evas_GL_Context)); | ctx = calloc(1, sizeof(Evas_GL_Context)); | |||
if (!ctx) | if (!ctx) | |||
{ | { | |||
ERR("Unable to create a Evas_GL_Context object\n"); | ERR("Unable to create a Evas_GL_Context object"); | |||
return NULL; | return NULL; | |||
} | } | |||
// Call engine->gl_create_context | // Call engine->gl_create_context | |||
if (share_ctx) | if (share_ctx) | |||
{ | { | |||
ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl-> evas->engine.data.output, share_ctx->data); | ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl-> evas->engine.data.output, share_ctx->data); | |||
} | } | |||
else | else | |||
{ | { | |||
ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl-> evas->engine.data.output, NULL); | ctx->data = evas_gl->evas->engine.func->gl_context_create(evas_gl-> evas->engine.data.output, NULL); | |||
} | } | |||
// Set a few variables | // Set a few variables | |||
if (!ctx->data) | if (!ctx->data) | |||
{ | { | |||
ERR("Failed creating a context from the engine\n"); | ERR("Failed creating a context from the engine."); | |||
free(ctx); | free(ctx); | |||
return NULL; | return NULL; | |||
} | } | |||
// Keep track of the context creations | // Keep track of the context creations | |||
evas_gl->contexts = eina_list_prepend(evas_gl->contexts, ctx); | evas_gl->contexts = eina_list_prepend(evas_gl->contexts, ctx); | |||
return ctx; | return ctx; | |||
} | } | |||
skipping to change at line 199 | skipping to change at line 205 | |||
EAPI void | EAPI void | |||
evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx) | evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx) | |||
{ | { | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return; | return; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if (!ctx) | if (!ctx) | |||
{ | { | |||
ERR("Trying to destroy a NULL context pointer!\n"); | ERR("Trying to destroy a NULL context pointer!"); | |||
return; | return; | |||
} | } | |||
// Call Engine's destroy | // Call Engine's destroy | |||
evas_gl->evas->engine.func->gl_context_destroy(evas_gl->evas->engine.dat a.output, ctx->data); | evas_gl->evas->engine.func->gl_context_destroy(evas_gl->evas->engine.dat a.output, ctx->data); | |||
// Remove it from the list | // Remove it from the list | |||
evas_gl->contexts = eina_list_remove(evas_gl->contexts, ctx); | evas_gl->contexts = eina_list_remove(evas_gl->contexts, ctx); | |||
// Delete the object | // Delete the object | |||
skipping to change at line 223 | skipping to change at line 229 | |||
EAPI Eina_Bool | EAPI Eina_Bool | |||
evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Conte xt *ctx) | evas_gl_make_current(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Conte xt *ctx) | |||
{ | { | |||
Eina_Bool ret; | Eina_Bool ret; | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return EINA_FALSE; | return EINA_FALSE; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if ((!surf) || (!ctx)) | if ((surf) && (ctx)) | |||
ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl-> | ||||
evas->engine.data.output, surf->data, ctx->data); | ||||
else if ((!surf) && (!ctx)) | ||||
ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl-> evas->engine.data.output, NULL, NULL); | ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl-> evas->engine.data.output, NULL, NULL); | |||
else | else | |||
ret = (Eina_Bool)evas_gl->evas->engine.func->gl_make_current(evas_gl-> | { | |||
evas->engine.data.output, surf->data, ctx->data); | ERR("Bad match between surface: %p and context: %p", surf, ctx); | |||
return EINA_FALSE; | ||||
} | ||||
return ret; | return ret; | |||
} | } | |||
EAPI const char * | EAPI const char * | |||
evas_gl_string_query(Evas_GL *evas_gl, int name) | evas_gl_string_query(Evas_GL *evas_gl, int name) | |||
{ | { | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return EINA_FALSE; | return EINA_FALSE; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
skipping to change at line 258 | skipping to change at line 269 | |||
return (Evas_GL_Func)evas_gl->evas->engine.func->gl_proc_address_get(eva s_gl->evas->engine.data.output, name); | return (Evas_GL_Func)evas_gl->evas->engine.func->gl_proc_address_get(eva s_gl->evas->engine.data.output, name); | |||
} | } | |||
EAPI Eina_Bool | EAPI Eina_Bool | |||
evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Na tive_Surface *ns) | evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Na tive_Surface *ns) | |||
{ | { | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return EINA_FALSE; | return EINA_FALSE; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
if ((!surf) || (!ns)) | ||||
{ | ||||
ERR("Invalid input parameters!"); | ||||
return EINA_FALSE; | ||||
} | ||||
return (Eina_Bool)evas_gl->evas->engine.func->gl_native_surface_get(evas _gl->evas->engine.data.output, surf->data, ns); | return (Eina_Bool)evas_gl->evas->engine.func->gl_native_surface_get(evas _gl->evas->engine.data.output, surf->data, ns); | |||
} | } | |||
EAPI Evas_GL_API * | EAPI Evas_GL_API * | |||
evas_gl_api_get(Evas_GL *evas_gl) | evas_gl_api_get(Evas_GL *evas_gl) | |||
{ | { | |||
MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | MAGIC_CHECK(evas_gl, Evas_GL, MAGIC_EVAS_GL); | |||
return NULL; | return NULL; | |||
MAGIC_CHECK_END(); | MAGIC_CHECK_END(); | |||
End of changes. 10 change blocks. | ||||
10 lines changed or deleted | 27 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |