[patch] gl: generate correct gradient color texture
"Henry (Yu) Song - SISA" <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <3955FA337689574EB32F94B12A7E6E9E1635C97E@sisaex01sj> |
commit 1454858833d290efbf49db9359065e227b4f8674 Author: Henry Song <[email protected]> Date: Mon Jul 9 09:49:13 2012 -0700 gl: pixman generates gradient color at the center of pixel. We need to adjust such accordingly in GL when generate gradient texture diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c index 5ac172f..ffb5468 100644 --- a/src/cairo-gl-gradient.c +++ b/src/cairo-gl-gradient.c @@ -124,9 +124,9 @@ _cairo_gl_gradient_render (const cairo_gl_context_t *ctx, pixman_stops[i].color.alpha = stops[i].color.alpha_short; } - p1.x = 0; + p1.x = _cairo_fixed_16_16_from_double (0.5); p1.y = 0; - p2.x = width << 16; + p2.x = _cairo_fixed_16_16_from_double (width - 0.5); p2.y = 0; gradient = pixman_image_create_linear_gradient (&p1, &p2, -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo