From f3abb1079a9766646dd0eda2f8a1633f8efff516 Mon Sep 17 00:00:00 2001 From: Henry Song Date: Wed, 25 Jul 2012 16:12:22 +0100 Subject: [PATCH] gl: translate proper matrix depending up type of gl_operand Fixes radial-gradiant-mask-source. --- src/cairo-gl-operand.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c index 033d45e7b..ee6c08e60 100644 --- a/src/cairo-gl-operand.c +++ b/src/cairo-gl-operand.c @@ -364,8 +364,26 @@ void _cairo_gl_operand_translate (cairo_gl_operand_t *operand, double tx, double ty) { - operand->texture.attributes.matrix.x0 -= tx * operand->texture.attributes.matrix.xx; - operand->texture.attributes.matrix.y0 -= ty * operand->texture.attributes.matrix.yy; + switch (operand->type) { + case CAIRO_GL_OPERAND_TEXTURE: + operand->texture.attributes.matrix.x0 -= tx * operand->texture.attributes.matrix.xx; + operand->texture.attributes.matrix.y0 -= ty * operand->texture.attributes.matrix.yy; + break; + + case CAIRO_GL_OPERAND_LINEAR_GRADIENT: + case CAIRO_GL_OPERAND_RADIAL_GRADIENT_A0: + case CAIRO_GL_OPERAND_RADIAL_GRADIENT_NONE: + case CAIRO_GL_OPERAND_RADIAL_GRADIENT_EXT: + operand->gradient.m.x0 -= tx * operand->gradient.m.xx; + operand->gradient.m.y0 -= ty * operand->gradient.m.yy; + break; + + case CAIRO_GL_OPERAND_NONE: + case CAIRO_GL_OPERAND_CONSTANT: + case CAIRO_GL_OPERAND_COUNT: + default: + break; + } } static cairo_status_t