[cairo] [patch] gl: fix gl operand translation
Henry (Yu) Song - SISA
hsong at sisa.samsung.com
Tue Jul 24 15:11:43 PDT 2012
commit 9890479b7edc17c3d558682354a0a37d193ff432
Author: Henry Song <henry.song at samsung.com>
Date: Tue Jul 24 15:07:19 2012 -0700
gl: translate proper matrix depending up type of gl_operand
fix bug in test case radial-gradient-mask-source
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 033d45e..40afec4 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -364,8 +364,24 @@ 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120724/f23d1b1f/attachment.html>
More information about the cairo
mailing list