summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuanbo Weng <strgnm@gmail.com>2011-12-09 16:13:59 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-09 09:17:28 +0000
commit8d4425053d126ead3087fe59c69063bce3b42cb5 (patch)
treed94c429059c72be03756cc0ade06c893966c67fe
parent2a60e8deecd8f63671cd595012843a665187d695 (diff)
gl: fix bug in _cairo_gl_surface_embedded_operand_init()
The operand->texture.surface should be set to right value, not NULL. Otherwise, when doing _cairo_gl_surface_operand_init(), the texture.surface in operand struct will also be NULL, which is incorrect. This fix regression suite in 43 test cases(such as source-clip) in cairo/test/. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-gl-operand.c1
-rw-r--r--src/cairo-gl-surface.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 9b53b2ff..1cfd4157 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -254,7 +254,6 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
}
*operand = surface->operand;
- operand->texture.surface = surface;
operand->texture.attributes.matrix.x0 -= extents->x * operand->texture.attributes.matrix.xx;
operand->texture.attributes.matrix.y0 -= extents->y * operand->texture.attributes.matrix.yy;
return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 90b25949..ed43a515 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -360,7 +360,7 @@ _cairo_gl_surface_embedded_operand_init (cairo_gl_surface_t *surface)
memset (operand, 0, sizeof (cairo_gl_operand_t));
operand->type = CAIRO_GL_OPERAND_TEXTURE;
- operand->texture.surface = NULL;
+ operand->texture.surface = surface;
operand->texture.tex = surface->tex;
if (_cairo_gl_device_requires_power_of_two_textures (surface->base.device)) {