[patch] gl: fix gl operand translation

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E16363EA9@sisaex01sj>
commit 9890479b7edc17c3d558682354a0a37d193ff432
Author: Henry Song <[email protected]>
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

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.