return FALSE;
memcpy (gradient->stops, stops, n_stops * sizeof (pixman_gradient_stop_t));
-
+
gradient->n_stops = n_stops;
gradient->stop_range = 0xffff;
allocate_image (void)
{
pixman_image_t *image = malloc (sizeof (pixman_image_t));
-
+
if (image)
{
image_common_t *common = &image->common;
if (image->type == BITS && image->bits.indexed)
free (image->bits.indexed);
#endif
-
+
#if 0
memset (image, 0xaa, sizeof (pixman_image_t));
#endif
free (image->gradient.stops);
}
-
+
if (image->type == BITS && image->bits.free_me)
free (image->bits.free_me);
-
+
free (image);
return TRUE;
pixman_image_t *img = allocate_image();
if (!img)
return NULL;
-
+
init_source_image (&img->solid.common);
-
+
img->type = SOLID;
img->solid.color = color_to_uint32 (color);
linear_gradient_t *linear;
return_val_if_fail (n_stops >= 2, NULL);
-
+
image = allocate_image();
-
+
if (!image)
return NULL;
linear = &image->linear;
-
+
if (!init_gradient (&linear->common, stops, n_stops))
{
free (image);
radial_gradient_t *radial;
return_val_if_fail (n_stops >= 2, NULL);
-
+
image = allocate_image();
if (!image)
}
image->type = RADIAL;
-
+
radial->c1.x = inner->x;
radial->c1.y = inner->y;
radial->c1.radius = inner_radius;
radial->A = (radial->cdx * radial->cdx
+ radial->cdy * radial->cdy
- radial->dr * radial->dr);
-
+
return image;
}
return NULL;
conical = &image->conical;
-
+
if (!init_gradient (&conical->common, stops, n_stops))
{
free (image);
int stride;
int buf_size;
int bpp;
-
+
bpp = PIXMAN_FORMAT_BPP (format);
- stride = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (uint32_t);
+ stride = ((width * bpp + FB_MASK) >> FB_SHIFT) * (int) sizeof (uint32_t);
buf_size = height * stride;
if (rowstride_bytes)
reset_clip_region (pixman_image_t *image)
{
pixman_region_fini (&image->common.clip_region);
-
+
if (image->type == BITS)
{
pixman_region_init_rect (&image->common.clip_region, 0, 0,
- image->bits.width, image->bits.height);
+ image->bits.width, image->bits.height);
}
else
{
pixman_image_t *image;
uint32_t *free_me = NULL;
- /* must be a whole number of uint32_t's
+ /* must be a whole number of uint32_t's
*/
return_val_if_fail (bits == NULL ||
- (rowstride_bytes % sizeof (uint32_t)) == 0, NULL);
+ (rowstride_bytes % sizeof (uint32_t)) == 0, NULL);
if (!bits)
{
if (!bits)
return NULL;
}
-
+
image = allocate_image();
if (!image)
return NULL;
-
+
image->type = BITS;
image->bits.format = format;
image->bits.width = width;
image->bits.height = height;
image->bits.bits = bits;
image->bits.free_me = free_me;
-
- image->bits.rowstride = rowstride_bytes / sizeof (uint32_t); /* we store it in number
+
+ image->bits.rowstride = rowstride_bytes / (int) sizeof (uint32_t); /* we store it in number
* of uint32_t's
*/
image->bits.indexed = NULL;
else
{
reset_clip_region (image);
-
+
return TRUE;
}
}
{ 0, 0, pixman_fixed_1 }
}
};
-
+
image_common_t *common = (image_common_t *)image;
if (common->transform == transform)
common->transform = NULL;
return TRUE;
}
-
+
if (common->transform == NULL)
common->transform = malloc (sizeof (pixman_transform_t));
if (common->transform == NULL)
image->common.repeat = repeat;
}
-pixman_bool_t
+pixman_bool_t
pixman_image_set_filter (pixman_image_t *image,
pixman_filter_t filter,
const pixman_fixed_t *params,
}
common->filter = filter;
-
+
if (common->filter_params)
free (common->filter_params);
int16_t y)
{
image_common_t *common = (image_common_t *)image;
-
+
return_if_fail (!alpha_map || alpha_map->type == BITS);
if (common->alpha_map != (bits_image_t *)alpha_map)
pixman_image_get_stride (pixman_image_t *image)
{
if (image->type == BITS)
- return image->bits.rowstride * sizeof (uint32_t);
+ return image->bits.rowstride * (int) sizeof (uint32_t);
return 0;
}
{
return FALSE;
}
-
+
if (PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_ABGR)
{
c = ((c & 0xff000000) >> 0) |
printf ("color: %x %x %x %x\n", color->alpha, color->red, color->green, color->blue);
printf ("pixel: %x\n", c);
#endif
-
+
*pixel = c;
return TRUE;
}
pixman_image_t *solid;
pixman_color_t c;
int i;
-
+
if (color->alpha == 0xffff)
{
if (op == PIXMAN_OP_OVER)
c.alpha = 0;
color = &c;
-
+
op = PIXMAN_OP_SRC;
}
if (op == PIXMAN_OP_SRC)
{
uint32_t pixel;
-
+
if (color_to_pixel (color, &pixel, dest->bits.format))
{
for (i = 0; i < n_rects; ++i)
pixman_region16_t fill_region;
int n_boxes, j;
pixman_box16_t *boxes;
-
+
pixman_region_init_rect (&fill_region, rects[i].x, rects[i].y, rects[i].width, rects[i].height);
pixman_region_intersect (&fill_region, &fill_region, &dest->common.clip_region);
return TRUE;
}
}
-
+
solid = pixman_image_create_solid_fill (color);
if (!solid)
return FALSE;
for (i = 0; i < n_rects; ++i)
{
const pixman_rectangle16_t *rect = &(rects[i]);
-
+
pixman_image_composite (op, solid, NULL, dest,
0, 0, 0, 0,
rect->x, rect->y,
rect->width, rect->height);
}
-
+
pixman_image_unref (solid);
return TRUE;
if (bpp == 16)
{
- stride = stride * sizeof (uint32_t) / 2;
+ stride = stride * (int) sizeof (uint32_t) / 2;
byte_line = (uint8_t *)(((uint16_t *)bits) + stride * y + x);
byte_width = 2 * width;
stride *= 2;
}
else
{
- stride = stride * sizeof (uint32_t) / 4;
+ stride = stride * (int) sizeof (uint32_t) / 4;
byte_line = (uint8_t *)(((uint32_t *)bits) + stride * y + x);
byte_width = 4 * width;
stride *= 4;
if (src_bpp == 16)
{
- src_stride = src_stride * sizeof (uint32_t) / 2;
- dst_stride = dst_stride * sizeof (uint32_t) / 2;
+ src_stride = src_stride * (int) sizeof (uint32_t) / 2;
+ dst_stride = dst_stride * (int) sizeof (uint32_t) / 2;
src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x));
dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
byte_width = 2 * width;
src_stride *= 2;
dst_stride *= 2;
} else if (src_bpp == 32) {
- src_stride = src_stride * sizeof (uint32_t) / 4;
- dst_stride = dst_stride * sizeof (uint32_t) / 4;
+ src_stride = src_stride * (int) sizeof (uint32_t) / 4;
+ dst_stride = dst_stride * (int) sizeof (uint32_t) / 4;
src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x));
dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
byte_width = 4 * width;
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
result.vector[j] = (pixman_fixed_48_16_t) v;
}
-
+
if (!result.vector[2])
return FALSE;
-
+
*vector = result;
return TRUE;
}
int height,
uint32_t xor)
{
- int byte_stride = stride * sizeof (uint32_t);
+ int byte_stride = stride * (int) sizeof (uint32_t);
uint8_t *dst = (uint8_t *) bits;
uint8_t v = xor & 0xff;
int i;
int height,
uint32_t xor)
{
- int short_stride = (stride * sizeof (uint32_t)) / sizeof (uint16_t);
+ int short_stride = (stride * (int) sizeof (uint32_t)) / (int) sizeof (uint16_t);
uint16_t *dst = (uint16_t *)bits;
uint16_t v = xor & 0xffff;
int i;
uint32_t xor)
{
int i;
-
+
bits = bits + y * stride + x;
-
+
while (height--)
{
for (i = 0; i < width; ++i)
printf ("filling: %d %d %d %d (stride: %d, bpp: %d) pixel: %x\n",
x, y, width, height, stride, bpp, xor);
#endif
-
+
#ifdef USE_MMX
if (!pixman_have_mmx() || !pixman_fill_mmx (bits, stride, bpp, x, y, width, height, xor))
#endif
case 8:
pixman_fill8 (bits, stride, x, y, width, height, xor);
break;
-
+
case 16:
pixman_fill16 (bits, stride, x, y, width, height, xor);
break;
-
+
case 32:
pixman_fill32 (bits, stride, x, y, width, height, xor);
break;
break;
}
}
-
+
return TRUE;
}
-
+
/*
* Compute the smallest value no less than y which is on a
{
pixman_fixed_t f = pixman_fixed_frac(y);
pixman_fixed_t i = pixman_fixed_floor(y);
-
+
f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
if (f > Y_FRAC_LAST(n))
{
{
pixman_fixed_t f = pixman_fixed_frac(y);
pixman_fixed_t i = pixman_fixed_floor (y);
-
+
f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n);
if (f < Y_FRAC_FIRST(n))
{
pixman_fixed_48_16_t ne;
e->x += n * e->stepx;
-
+
ne = e->e + n * (pixman_fixed_48_16_t) e->dx;
-
+
if (n >= 0)
{
if (ne > 0)
{
pixman_fixed_t stepx;
pixman_fixed_48_16_t ne;
-
+
ne = n * (pixman_fixed_48_16_t) e->dx;
stepx = n * e->stepx;
if (ne > 0)
e->dx = -dx % dy;
e->e = 0;
}
-
+
_pixman_edge_tMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small);
_pixman_edge_tMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big);
}