summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-06-18 10:50:21 +0200
committerBenjamin Otte <otte@redhat.com>2010-06-18 16:31:52 +0200
commit8048d3aa0a11ab1c054887682b8b2a899a87da0e (patch)
treeb9f23695d14541342b918176a4bfc8c973a70192
parentf4da5048bf87df0651ec83ca3f1ad6a5af7eb16d (diff)
gl: Remove custom fprintf fudging on GL errors
Now that we probably call _cairo_error() on every GL error, there is no need to use custom methods to catch those errors. The usual breakpoint is enough.
-rw-r--r--src/cairo-gl-private.h7
-rw-r--r--src/cairo-gl-surface.c20
2 files changed, 1 insertions, 26 deletions
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index 2ae1e1ee..daba72a3 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -223,23 +223,18 @@ typedef struct _cairo_gl_composite {
cairo_private extern const cairo_surface_backend_t _cairo_gl_surface_backend;
-cairo_private const char *_cairo_gl_error_to_string (GLenum err);
static cairo_always_inline cairo_status_t
-_do_cairo_gl_check_error (const char *file, int line)
+_cairo_gl_check_error (void)
{
cairo_status_t status = CAIRO_STATUS_SUCCESS;
GLenum err;
while (unlikely ((err = glGetError ()))) {
- fprintf (stderr, "%s:%d: GL error 0x%04x: %s\n",
- file, line, (int) err,
- _cairo_gl_error_to_string (err));
status = _cairo_error (CAIRO_STATUS_DEVICE_ERROR);
}
return status;
}
-#define _cairo_gl_check_error() _do_cairo_gl_check_error(__FILE__, __LINE__)
static inline cairo_device_t *
_cairo_gl_context_create_in_error (cairo_status_t status)
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index e6aa6550..88d58e88 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -74,26 +74,6 @@ static cairo_bool_t _cairo_surface_is_gl (cairo_surface_t *surface)
return surface->backend == &_cairo_gl_surface_backend;
}
-const char *_cairo_gl_error_to_string (GLenum err)
-{
- switch ((int) err) {
- case GL_NO_ERROR:
- ASSERT_NOT_REACHED;
- return "success";
-
- case GL_INVALID_ENUM: return "invalid enum";
- case GL_INVALID_VALUE: return "invalid value";
- case GL_INVALID_OPERATION: return "invalid operation";
- case GL_STACK_OVERFLOW: return "stack overflow";
- case GL_STACK_UNDERFLOW: return "stack underflow";
- case GL_OUT_OF_MEMORY: return "out of memory";
- case GL_INVALID_FRAMEBUFFER_OPERATION_EXT: return "invalid framebuffer operation";
-
- default:
- return "unknown error";
- }
-}
-
cairo_bool_t
_cairo_gl_get_image_format_and_type (pixman_format_code_t pixman_format,
GLenum *internal_format, GLenum *format,