diff options
Diffstat (limited to 'src/cairo-glx-context.c')
-rw-r--r-- | src/cairo-glx-context.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cairo-glx-context.c b/src/cairo-glx-context.c index f519443d..e261cf88 100644 --- a/src/cairo-glx-context.c +++ b/src/cairo-glx-context.c @@ -209,6 +209,36 @@ cairo_glx_device_create (Display *dpy, GLXContext gl_ctx) return &ctx->base.base; } +Display * +cairo_glx_device_get_display (cairo_device_t *device) +{ + cairo_glx_context_t *ctx; + + if (device->backend->type != CAIRO_DEVICE_TYPE_GL) { + _cairo_error_throw (CAIRO_STATUS_DEVICE_TYPE_MISMATCH); + return NULL; + } + + ctx = (cairo_glx_context_t *) device; + + return ctx->display; +} + +GLXContext +cairo_glx_device_get_context (cairo_device_t *device) +{ + cairo_glx_context_t *ctx; + + if (device->backend->type != CAIRO_DEVICE_TYPE_GL) { + _cairo_error_throw (CAIRO_STATUS_DEVICE_TYPE_MISMATCH); + return NULL; + } + + ctx = (cairo_glx_context_t *) device; + + return ctx->context; +} + cairo_surface_t * cairo_gl_surface_create_for_window (cairo_device_t *device, Window win, |