diff options
-rw-r--r-- | src/cairo-gl-private.h | 1 | ||||
-rw-r--r-- | src/cairo-gl-surface.c | 22 | ||||
-rw-r--r-- | src/cairo-glx-context.c | 1 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index 475f14aa5..5e0095c37 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -322,6 +322,7 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx); cairo_private void _cairo_gl_surface_init (cairo_device_t *device, cairo_gl_surface_t *surface, + cairo_color_space_t *color_space, cairo_content_t content, int width, int height); diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 9774705b9..baa83b12e 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -206,6 +206,7 @@ _cairo_gl_operator_is_supported (cairo_operator_t op) void _cairo_gl_surface_init (cairo_device_t *device, cairo_gl_surface_t *surface, + cairo_color_space_t *color_space, cairo_content_t content, int width, int height) { @@ -213,7 +214,7 @@ _cairo_gl_surface_init (cairo_device_t *device, &_cairo_gl_surface_backend, device, content, - _cairo_color_space_from_cairo_content (content)); + color_space); surface->width = width; surface->height = height; @@ -222,6 +223,7 @@ _cairo_gl_surface_init (cairo_device_t *device, static cairo_surface_t * _cairo_gl_surface_create_scratch_for_texture (cairo_gl_context_t *ctx, + cairo_color_space_t *color_space, cairo_content_t content, GLuint tex, int width, @@ -235,7 +237,7 @@ _cairo_gl_surface_create_scratch_for_texture (cairo_gl_context_t *ctx, if (unlikely (surface == NULL)) return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); - _cairo_gl_surface_init (&ctx->base, surface, content, width, height); + _cairo_gl_surface_init (&ctx->base, surface, color_space, content, width, height); surface->tex = tex; /* Create the texture used to store the surface's data. */ @@ -249,6 +251,7 @@ _cairo_gl_surface_create_scratch_for_texture (cairo_gl_context_t *ctx, static cairo_surface_t * _cairo_gl_surface_create_scratch (cairo_gl_context_t *ctx, + cairo_color_space_t *color_space, cairo_content_t content, int width, int height) @@ -259,7 +262,7 @@ _cairo_gl_surface_create_scratch (cairo_gl_context_t *ctx, glGenTextures (1, &tex); surface = (cairo_gl_surface_t *) - _cairo_gl_surface_create_scratch_for_texture (ctx, content, + _cairo_gl_surface_create_scratch_for_texture (ctx, color_space, content, tex, width, height); if (unlikely (surface->base.status)) return &surface->base; @@ -371,7 +374,9 @@ cairo_gl_surface_create (cairo_device_t *abstract_device, return _cairo_surface_create_in_error (status); surface = (cairo_gl_surface_t *) - _cairo_gl_surface_create_scratch (ctx, content, width, height); + _cairo_gl_surface_create_scratch (ctx, + _cairo_color_space_from_cairo_content (content), + content, width, height); if (unlikely (surface->base.status)) { status = _cairo_gl_context_release (ctx, surface->base.status); cairo_surface_destroy (&surface->base); @@ -445,7 +450,9 @@ cairo_gl_surface_create_for_texture (cairo_device_t *abstract_device, return _cairo_surface_create_in_error (status); surface = (cairo_gl_surface_t *) - _cairo_gl_surface_create_scratch_for_texture (ctx, content, + _cairo_gl_surface_create_scratch_for_texture (ctx, + _cairo_color_space_from_cairo_content (content), + content, tex, width, height); status = _cairo_gl_context_release (ctx, status); @@ -546,6 +553,7 @@ cairo_gl_surface_swapbuffers (cairo_surface_t *abstract_surface) static cairo_surface_t * _cairo_gl_surface_create_similar (void *abstract_surface, + cairo_color_space_t *color_space, cairo_content_t content, int width, int height) @@ -569,7 +577,7 @@ _cairo_gl_surface_create_similar (void *abstract_surface, goto RELEASE; } - surface = _cairo_gl_surface_create_scratch (ctx, content, width, height); + surface = _cairo_gl_surface_create_scratch (ctx, color_space, content, width, height); RELEASE: status = _cairo_gl_context_release (ctx, status); @@ -665,6 +673,7 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst, cairo_surface_t *tmp; tmp = _cairo_gl_surface_create_scratch (ctx, + dst->base.color_space, dst->base.content, width, height); if (unlikely (tmp->status)) { @@ -897,6 +906,7 @@ _cairo_gl_surface_clone_similar (void *abstract_surface, clone = (cairo_gl_surface_t *) _cairo_gl_surface_create_similar (&surface->base, + src->color_space, src->content, width, height); if (clone == NULL) diff --git a/src/cairo-glx-context.c b/src/cairo-glx-context.c index 83963fbc4..bad1dbdc9 100644 --- a/src/cairo-glx-context.c +++ b/src/cairo-glx-context.c @@ -260,6 +260,7 @@ cairo_gl_surface_create_for_window (cairo_device_t *device, return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); _cairo_gl_surface_init (device, &surface->base, + CAIRO_COLOR_SPACE_DEVICE_RGB, CAIRO_CONTENT_COLOR_ALPHA, width, height); surface->win = win; |