gl: Throw a _cairo_error when detecting a GLerror

This allows us to easily set an breakpoint and inspect cairo's state
when we do something illegal.
This commit is contained in:
Chris Wilson 2010-05-17 12:36:54 +01:00
parent 1c18ab02c8
commit 8695c41e80

View file

@ -206,8 +206,10 @@ cairo_private extern const cairo_surface_backend_t _cairo_gl_surface_backend;
cairo_private const char *_cairo_gl_error_to_string (GLenum err);
#define _cairo_gl_check_error() do { \
GLenum err; \
while ((err = glGetError ())) \
while ((err = glGetError ())) { \
fprintf (stderr, "%s:%d: GL error 0x%04x: %s\n", __FILE__,__LINE__, (int) err, _cairo_gl_error_to_string (err)); \
_cairo_error_throw (CAIRO_STATUS_DEVICE_ERROR); \
} \
} while (0)
static inline cairo_device_t *