aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_gl.c
diff options
context:
space:
mode:
authorSung Park <sungwoo@gmail.com>2012-05-03 02:33:18 +0000
committerSung Park <sungwoo@gmail.com>2012-05-03 02:33:18 +0000
commitef0e4dcaec30b772e1a9885430ce3431554b2728 (patch)
tree40c1efbf837a57f8fbe73f1d8d52c161154f4c82 /legacy/evas/src/lib/canvas/evas_gl.c
parentEcore_Wayland: Patch from Robert Bradford (rob@linux.intel.com) for (diff)
downloadefl-ef0e4dcaec30b772e1a9885430ce3431554b2728.tar.gz
Cleaned up some evas_gl code and added surface cap feature.
(Trying it again since this commit broke evas build yesterday.) Previously, evas_gl_surface_create() didn't actually do the render buffer attach to the the FBO. It was performed when the make_current was called for the first time. The issue was that even though the surface was successfully created with the given configuration, there was a possibility of make_current failing with the error message "FBO not complete" because of the surface configuration. So, I've added a piece of code that checks the FBO capabilities beforehand to set up a available surface configurations so that it doesn't have to fail during make_current for unsupported surface format. Also, I've changed the surface config in a way that once the user calls evas_gl_surface_create(), evas gl sets the config parameter with configuration that evas_gl is actually using. SVN revision: 70680
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_gl.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_gl.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_gl.c b/legacy/evas/src/lib/canvas/evas_gl.c
index 85ed851bb4..bccab2dd8d 100644
--- a/legacy/evas/src/lib/canvas/evas_gl.c
+++ b/legacy/evas/src/lib/canvas/evas_gl.c
@@ -39,7 +39,7 @@ evas_gl_new(Evas *e)
if (!evas_gl->evas->engine.func->gl_context_create)
{
- ERR("GL engine not available\n");
+ ERR("Evas GL engine not available.");
free(evas_gl);
return NULL;
}
@@ -96,7 +96,7 @@ evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int
if (!config)
{
- ERR("Invalid Config\n");
+ ERR("Invalid Config Pointer!");
return NULL;
}
@@ -108,7 +108,7 @@ evas_gl_surface_create(Evas_GL *evas_gl, Evas_GL_Config *config, int width, int
if (!surf->data)
{
- ERR("Failed creating a surface from the engine\n");
+ ERR("Failed creating a surface from the engine.");
free(surf);
return NULL;
}
@@ -129,7 +129,7 @@ evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf)
if (!surf)
{
- ERR("Trying to destroy a NULL surface pointer!\n");
+ ERR("Trying to destroy a NULL surface pointer!");
return;
}
@@ -158,7 +158,7 @@ evas_gl_context_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx)
ctx = calloc(1, sizeof(Evas_GL_Context));
if (!ctx)
{
- ERR("Unable to create a Evas_GL_Context object\n");
+ ERR("Unable to create a Evas_GL_Context object");
return NULL;
}
@@ -175,7 +175,7 @@ evas_gl_context_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx)
// Set a few variables
if (!ctx->data)
{
- ERR("Failed creating a context from the engine\n");
+ ERR("Failed creating a context from the engine.");
free(ctx);
return NULL;
}
@@ -197,7 +197,7 @@ evas_gl_context_destroy(Evas_GL *evas_gl, Evas_GL_Context *ctx)
if (!ctx)
{
- ERR("Trying to destroy a NULL context pointer!\n");
+ ERR("Trying to destroy a NULL context pointer!");
return;
}
@@ -256,6 +256,12 @@ evas_gl_native_surface_get(Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_
return EINA_FALSE;
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);
}