summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-06-20 13:12:27 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-06-20 13:12:27 -0400
commit7ef93ace73d524f181b90c50edd3903e24915ed7 (patch)
treedd281a780f04c94b5620737516d50ff7308f02de
parent3074d57b560d5ec9be2a0e1a6846012698f51208 (diff)
Store the conical angle in floating point radians, not fixed point degreesconical
This is a slight simplification.
-rw-r--r--pixman/pixman-conical-gradient.c8
-rw-r--r--pixman/pixman-private.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/pixman/pixman-conical-gradient.c b/pixman/pixman-conical-gradient.c
index d06dd0b9..01a9b67b 100644
--- a/pixman/pixman-conical-gradient.c
+++ b/pixman/pixman-conical-gradient.c
@@ -70,7 +70,6 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
double rx = x + 0.5;
double ry = y + 0.5;
double rz = 1.;
- double a = pixman_fixed_to_double ((conical->angle * M_PI) / 180.0);
_pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
@@ -108,7 +107,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
{
if (!mask || *mask++)
{
- double t = coordinates_to_parameter (rx, ry, a);
+ double t = coordinates_to_parameter (rx, ry, conical->angle);
*buffer = _pixman_gradient_walker_pixel (
&walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
@@ -143,7 +142,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
x -= conical->center.x / 65536.;
y -= conical->center.y / 65536.;
- t = coordinates_to_parameter (x, y, a);
+ t = coordinates_to_parameter (x, y, conical->angle);
*buffer = _pixman_gradient_walker_pixel (
&walker, (pixman_fixed_48_16_t)pixman_double_to_fixed (t));
@@ -187,7 +186,8 @@ pixman_image_create_conical_gradient (pixman_point_fixed_t * center,
image->type = CONICAL;
conical->center = *center;
- conical->angle = MOD (angle, 360 << 16);
+ conical->angle =
+ (pixman_fixed_to_double (MOD (angle, 360 << 16)) / 180.0) * M_PI;
image->common.property_changed = conical_gradient_property_changed;
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 5b0eff38..8718fcb1 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -161,7 +161,7 @@ struct conical_gradient
{
gradient_t common;
pixman_point_fixed_t center;
- pixman_fixed_t angle;
+ double angle;
};
struct bits_image