@@ -179,6 +179,12 @@ cairo_egl_device_create (EGLDisplay dpy, EGLContext egl)
}
}
+ status = _cairo_gl_dispatch_init (&ctx->base.dispatch, eglGetProcAddress);
+ if (unlikely (status)) {
+ free (ctx);
+ return _cairo_gl_context_create_in_error (status);
+ }
+
status = _cairo_gl_context_init (&ctx->base);
if (unlikely (status)) {
if (ctx->dummy_surface != EGL_NO_SURFACE)
@@ -262,6 +262,8 @@ struct _cairo_gl_context {
unsigned int vertex_size;
cairo_region_t *clip_region;
+ cairo_gl_dispatch_t dispatch;
+
void (*acquire) (void *ctx);
void (*release) (void *ctx);
@@ -193,6 +193,13 @@ cairo_glx_device_create (Display *dpy, GLXContext gl_ctx)
ctx->base.swap_buffers = _glx_swap_buffers;
ctx->base.destroy = _glx_destroy;
+ status = _cairo_gl_dispatch_init (&ctx->base.dispatch,
+ (cairo_gl_get_proc_addr_func_t) glXGetProcAddress);
+ if (unlikely (status)) {
+ free (ctx);
+ return _cairo_gl_context_create_in_error (status);
+ }
+
status = _cairo_gl_context_init (&ctx->base);
if (unlikely (status)) {
free (ctx);
@@ -199,6 +199,13 @@ cairo_wgl_device_create (HGLRC rc)
ctx->base.swap_buffers = _wgl_swap_buffers;
ctx->base.destroy = _wgl_destroy;
+ status = _cairo_gl_dispatch_init (&ctx->base.dispatch,
+ (cairo_gl_get_proc_addr_func_t) wglGetProcAddress);
+ if (unlikely (status)) {
+ free (ctx);
+ return _cairo_gl_context_create_in_error (status);
+ }
+
status = _cairo_gl_context_init (&ctx->base);
if (unlikely (status)) {
free (ctx);
From: Alexandros Frantzis <alexandros.frantzis@linaro.org> --- src/cairo-egl-context.c | 6 ++++++ src/cairo-gl-private.h | 2 ++ src/cairo-glx-context.c | 7 +++++++ src/cairo-wgl-context.c | 7 +++++++ 4 files changed, 22 insertions(+), 0 deletions(-)