}
static void
-bits_image_fetch_transformed (bits_image_t * pict, int x, int y, int width,
- uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+bits_image_fetch_transformed (pixman_image_t * pict, int x, int y, int width,
+ uint32_t *buffer, uint32_t *mask,
+ uint32_t maskBits)
{
uint32_t *bits;
int32_t stride;
int32_t *coords;
int i;
- bits = pict->bits;
- stride = pict->rowstride;
+ bits = pict->bits.bits;
+ stride = pict->bits.rowstride;
/* reference point is the center of the pixel */
v.vector[0] = pixman_int_to_fixed(x) + pixman_fixed_1 / 2;
v.vector[1] += unit.vector[1];
}
- bits_image_fetch_filtered (pict, tmp_buffer, n_pixels);
+ bits_image_fetch_filtered (&pict->bits, tmp_buffer, n_pixels);
for (j = 0; j < n_pixels; ++j)
buffer[i++] = tmp_buffer[j];
}
static void
-bits_image_fetch_solid_32 (bits_image_t * image,
+bits_image_fetch_solid_32 (pixman_image_t * image,
int x, int y, int width,
uint32_t *buffer,
uint32_t *mask, uint32_t maskBits)
color[0] = 0;
color[1] = 0;
- image->fetch_pixels_raw_32 (image, color, 1);
+ image->bits.fetch_pixels_raw_32 (&image->bits, color, 1);
end = buffer + width;
while (buffer < end)
}
static void
-bits_image_fetch_solid_64 (bits_image_t * image,
+bits_image_fetch_solid_64 (pixman_image_t * image,
int x, int y, int width,
- uint64_t *buffer, void *unused, uint32_t unused2)
+ uint32_t *b,
+ uint32_t *unused,
+ uint32_t unused2)
{
uint32_t color[2];
- uint64_t *end;
uint32_t *coords = (uint32_t *)color;
-
+ uint64_t *buffer = (uint64_t *)b;
+ uint64_t *end;
+
coords[0] = 0;
coords[1] = 1;
- image->fetch_pixels_raw_64 (image, (uint64_t *)color, 1);
+ image->bits.fetch_pixels_raw_64 (&image->bits, (uint64_t *)color, 1);
end = buffer + width;
while (buffer < end)
}
static void
-bits_image_fetch_untransformed_32 (bits_image_t * image,
+bits_image_fetch_untransformed_32 (pixman_image_t * image,
int x, int y, int width,
- uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+ uint32_t *buffer,
+ uint32_t *mask, uint32_t maskBits)
{
if (image->common.repeat == PIXMAN_REPEAT_NONE)
- bits_image_fetch_untransformed_repeat_none (image, FALSE, x, y, width, buffer);
+ {
+ bits_image_fetch_untransformed_repeat_none (
+ &image->bits, FALSE, x, y, width, buffer);
+ }
else
- bits_image_fetch_untransformed_repeat_normal (image, FALSE, x, y, width, buffer);
+ {
+ bits_image_fetch_untransformed_repeat_normal (
+ &image->bits, FALSE, x, y, width, buffer);
+ }
}
static void
-bits_image_fetch_untransformed_64 (bits_image_t * image,
+bits_image_fetch_untransformed_64 (pixman_image_t * image,
int x, int y, int width,
- uint64_t *buffer, void *unused, uint32_t unused2)
+ uint32_t *buffer,
+ uint32_t *unused, uint32_t unused2)
{
if (image->common.repeat == PIXMAN_REPEAT_NONE)
{
- bits_image_fetch_untransformed_repeat_none (image, TRUE, x, y,
- width, (uint32_t *)buffer);
+ bits_image_fetch_untransformed_repeat_none (
+ &image->bits, TRUE, x, y, width, buffer);
}
else
{
- bits_image_fetch_untransformed_repeat_normal (image, TRUE, x, y,
- width, (uint32_t *)buffer);
+ bits_image_fetch_untransformed_repeat_normal (
+ &image->bits, TRUE, x, y, width, buffer);
}
}
if (bits->common.alpha_map)
{
image->common.get_scanline_64 =
- (scanFetchProc)_pixman_image_get_scanline_64_generic;
+ _pixman_image_get_scanline_64_generic;
image->common.get_scanline_32 =
- (scanFetchProc)bits_image_fetch_transformed;
+ bits_image_fetch_transformed;
}
else if ((bits->common.repeat != PIXMAN_REPEAT_NONE) &&
bits->width == 1 &&
bits->height == 1)
{
- image->common.get_scanline_64 = (scanFetchProc)bits_image_fetch_solid_64;
- image->common.get_scanline_32 = (scanFetchProc)bits_image_fetch_solid_32;
+ image->common.get_scanline_64 = bits_image_fetch_solid_64;
+ image->common.get_scanline_32 = bits_image_fetch_solid_32;
}
else if (!bits->common.transform &&
bits->common.filter != PIXMAN_FILTER_CONVOLUTION &&
bits->common.repeat == PIXMAN_REPEAT_NORMAL))
{
image->common.get_scanline_64 =
- (scanFetchProc)bits_image_fetch_untransformed_64;
+ bits_image_fetch_untransformed_64;
image->common.get_scanline_32 =
- (scanFetchProc)bits_image_fetch_untransformed_32;
+ bits_image_fetch_untransformed_32;
}
else
{
image->common.get_scanline_64 =
- (scanFetchProc)_pixman_image_get_scanline_64_generic;
+ _pixman_image_get_scanline_64_generic;
image->common.get_scanline_32 =
- (scanFetchProc)bits_image_fetch_transformed;
+ bits_image_fetch_transformed;
}
bits->store_scanline_64 = bits_image_store_scanline_64;
/*
* By default, just evaluate the image at 32bpp and expand. Individual image
* types can plug in a better scanline getter if they want to. For example
- * we could produce smoother gradients by evaluating them at higher color depth, but
- * that's a project for the future.
+ * we could produce smoother gradients by evaluating them at higher color
+ * depth, but that's a project for the future.
*/
void
-_pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y, int width,
- uint64_t *buffer, uint64_t *mask, uint32_t maskBits)
+_pixman_image_get_scanline_64_generic (pixman_image_t * pict,
+ int x, int y, int width,
+ uint32_t *buffer,
+ uint32_t *mask, uint32_t maskBits)
{
uint32_t *mask8 = NULL;
- // Contract the mask image, if one exists, so that the 32-bit fetch function
- // can use it.
+ // Contract the mask image, if one exists, so that the 32-bit fetch
+ // function can use it.
if (mask) {
mask8 = pixman_malloc_ab(width, sizeof(uint32_t));
if (!mask8)
return;
- pixman_contract(mask8, mask, width);
+ pixman_contract (mask8, (uint64_t *)mask, width);
}
// Fetch the source image into the first half of buffer.
maskBits);
// Expand from 32bpp to 64bpp in place.
- pixman_expand(buffer, (uint32_t*)buffer, PIXMAN_a8r8g8b8, width);
+ pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, width);
- free(mask8);
+ free (mask8);
}
pixman_image_t *