diff options
author | Andrea Canciani <ranma42@gmail.com> | 2010-12-17 11:04:53 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-01-02 18:33:14 +0100 |
commit | 200e147322a7a17dec91ad5f678a07fdfaf38de2 (patch) | |
tree | 1e55e96980b3f21ac8113177a255ae4df2482938 /src/cairo-gl-composite.c | |
parent | 6472864b2c424c0dfe4ff4e76eff8dfb896e60e8 (diff) |
pattern: Use double precision for gradient extreme objects
Using double precision for gradient extreme objects ensures that they
are preserved as specified when constructing the gradient pattern.
Fixes huge-linear, huge-radial.
Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
Diffstat (limited to 'src/cairo-gl-composite.c')
-rw-r--r-- | src/cairo-gl-composite.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c index 5057fa63..dbd5306c 100644 --- a/src/cairo-gl-composite.c +++ b/src/cairo-gl-composite.c @@ -170,14 +170,14 @@ _cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand, if (unlikely (status)) return status; - dx = _cairo_fixed_to_double (linear->p2.x - linear->p1.x); - dy = _cairo_fixed_to_double (linear->p2.y - linear->p1.y); + dx = linear->pd2.x - linear->pd1.x; + dy = linear->pd2.y - linear->pd1.y; sf = 1.0 / (dx * dx + dy * dy); dx *= sf; dy *= sf; - x0 = _cairo_fixed_to_double (linear->p1.x); - y0 = _cairo_fixed_to_double (linear->p1.y); + x0 = linear->pd1.x; + y0 = linear->pd1.y; offset = dx * x0 + dy * y0; if (_cairo_matrix_is_identity (&linear->base.base.matrix)) { @@ -203,12 +203,12 @@ _cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand, cairo_radial_pattern_t *radial = (cairo_radial_pattern_t *) gradient; double x0, y0, r0, x1, y1, r1; - x0 = _cairo_fixed_to_double (radial->c1.x); - x1 = _cairo_fixed_to_double (radial->c2.x); - y0 = _cairo_fixed_to_double (radial->c1.y); - y1 = _cairo_fixed_to_double (radial->c2.y); - r0 = _cairo_fixed_to_double (radial->r1); - r1 = _cairo_fixed_to_double (radial->r2); + x0 = radial->cd1.center.x; + x1 = radial->cd2.center.x; + y0 = radial->cd1.center.y; + y1 = radial->cd2.center.y; + r0 = radial->cd1.radius; + r1 = radial->cd2.radius; status = _cairo_gl_create_gradient_texture (dst, gradient, |