It serves no purpose anymore now that the source_class_t field is gone.
uint32_t * buffer,
const uint32_t *mask)
{
- source_image_t *source = (source_image_t *)image;
- gradient_t *gradient = (gradient_t *)source;
+ gradient_t *gradient = (gradient_t *)image;
conical_gradient_t *conical = (conical_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
double ry = y + 0.5;
double rz = 1.;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
- if (source->common.transform)
+ if (image->common.transform)
{
pixman_vector_t v;
v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
- cx = source->common.transform->matrix[0][0] / 65536.;
- cy = source->common.transform->matrix[1][0] / 65536.;
- cz = source->common.transform->matrix[2][0] / 65536.;
+ cx = image->common.transform->matrix[0][0] / 65536.;
+ cy = image->common.transform->matrix[1][0] / 65536.;
+ cz = image->common.transform->matrix[2][0] / 65536.;
rx = v.vector[0] / 65536.;
ry = v.vector[1] / 65536.;
rz = v.vector[2] / 65536.;
affine =
- source->common.transform->matrix[2][0] == 0 &&
+ image->common.transform->matrix[2][0] == 0 &&
v.vector[2] == pixman_fixed_1;
}
int width,
int height)
{
- source_image_t *source = (source_image_t *)image;
linear_gradient_t *linear = (linear_gradient_t *)image;
pixman_vector_t v;
pixman_fixed_32_32_t l;
class = SOURCE_IMAGE_CLASS_UNKNOWN;
- if (source->common.transform)
+ if (image->common.transform)
{
/* projective transformation */
- if (source->common.transform->matrix[2][0] != 0 ||
- source->common.transform->matrix[2][1] != 0 ||
- source->common.transform->matrix[2][2] == 0)
+ if (image->common.transform->matrix[2][0] != 0 ||
+ image->common.transform->matrix[2][1] != 0 ||
+ image->common.transform->matrix[2][2] == 0)
{
return class;
}
- v.vector[0] = source->common.transform->matrix[0][1];
- v.vector[1] = source->common.transform->matrix[1][1];
- v.vector[2] = source->common.transform->matrix[2][2];
+ v.vector[0] = image->common.transform->matrix[0][1];
+ v.vector[1] = image->common.transform->matrix[1][1];
+ v.vector[2] = image->common.transform->matrix[2][2];
}
else
{
pixman_fixed_32_32_t l;
pixman_fixed_48_16_t dx, dy;
gradient_t *gradient = (gradient_t *)image;
- source_image_t *source = (source_image_t *)image;
linear_gradient_t *linear = (linear_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
/* reference point is the center of the pixel */
v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2;
v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- if (source->common.transform)
+ if (image->common.transform)
{
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
-
- unit.vector[0] = source->common.transform->matrix[0][0];
- unit.vector[1] = source->common.transform->matrix[1][0];
- unit.vector[2] = source->common.transform->matrix[2][0];
+
+ unit.vector[0] = image->common.transform->matrix[0][0];
+ unit.vector[1] = image->common.transform->matrix[1][0];
+ unit.vector[2] = image->common.transform->matrix[2][0];
}
else
{
* Images
*/
typedef struct image_common image_common_t;
-typedef struct source_image source_image_t;
typedef struct solid_fill solid_fill_t;
typedef struct gradient gradient_t;
typedef struct linear_gradient linear_gradient_t;
pixman_format_code_t extended_format_code;
};
-struct source_image
-{
- image_common_t common;
-};
-
struct solid_fill
{
- source_image_t common;
+ image_common_t common;
pixman_color_t color;
uint32_t color_32;
struct gradient
{
- source_image_t common;
+ image_common_t common;
int n_stops;
pixman_gradient_stop_t *stops;
int stop_range;
image_type_t type;
image_common_t common;
bits_image_t bits;
- source_image_t source;
gradient_t gradient;
linear_gradient_t linear;
conical_gradient_t conical;
*/
gradient_t *gradient = (gradient_t *)image;
- source_image_t *source = (source_image_t *)image;
radial_gradient_t *radial = (radial_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
- if (source->common.transform)
+ if (image->common.transform)
{
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
- unit.vector[0] = source->common.transform->matrix[0][0];
- unit.vector[1] = source->common.transform->matrix[1][0];
- unit.vector[2] = source->common.transform->matrix[2][0];
+ unit.vector[0] = image->common.transform->matrix[0][0];
+ unit.vector[1] = image->common.transform->matrix[1][0];
+ unit.vector[2] = image->common.transform->matrix[2][0];
}
else
{
radial->delta.radius,
radial->mindr,
&walker,
- source->common.repeat);
+ image->common.repeat);
}
b += db;
radial->delta.radius,
radial->mindr,
&walker,
- source->common.repeat);
+ image->common.repeat);
}
else
{
*buffer = 0;
}
}
-
+
++buffer;
v.vector[0] += unit.vector[0];