if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST)
{
if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) {
- if (pixman_region_n_rects (&pict->common.clip_region) == 1) {
+ if (pixman_region_n_rects (pict->common.src_clip) == 1) {
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
y = MOD(v.vector[1]>>16, pict->height);
x = MOD(v.vector[0]>>16, pict->width);
}
- if (pixman_region_contains_point (&pict->common.clip_region, x, y, &box))
+ if (pixman_region_contains_point (pict->common.src_clip, x, y, &box))
*(buffer + i) = fetch ((pixman_image_t *)pict, bits + y*stride, x, indexed);
else
*(buffer + i) = 0;
}
}
} else {
- if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
- box = pict->common.clip_region.extents;
+ if (pixman_region_n_rects(pict->common.src_clip) == 1) {
+ box = pict->common.src_clip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
y = v.vector[1]>>16;
x = v.vector[0]>>16;
}
- if (pixman_region_contains_point (&pict->common.clip_region, x, y, &box))
+ if (pixman_region_contains_point (pict->common.src_clip, x, y, &box))
*(buffer + i) = fetch((pixman_image_t *)pict, bits + y*stride, x, indexed);
else
*(buffer + i) = 0;
unit.vector[1] -= unit.vector[2] / 2;
if (pict->common.repeat == PIXMAN_REPEAT_NORMAL) {
- if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
+ if (pixman_region_n_rects(pict->common.src_clip) == 1) {
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
b = bits + y1*stride;
- tl = pixman_region_contains_point(&pict->common.clip_region, x1, y1, &box)
+ tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box)
? fetch((pixman_image_t *)pict, b, x1, indexed) : 0;
- tr = pixman_region_contains_point(&pict->common.clip_region, x2, y1, &box)
+ tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box)
? fetch((pixman_image_t *)pict, b, x2, indexed) : 0;
b = bits + (y2)*stride;
- bl = pixman_region_contains_point(&pict->common.clip_region, x1, y2, &box)
+ bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box)
? fetch((pixman_image_t *)pict, b, x1, indexed) : 0;
- br = pixman_region_contains_point(&pict->common.clip_region, x2, y2, &box)
+ br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box)
? fetch((pixman_image_t *)pict, b, x2, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
}
}
} else {
- if (pixman_region_n_rects(&pict->common.clip_region) == 1) {
- box = pict->common.clip_region.extents;
+ if (pixman_region_n_rects(pict->common.src_clip) == 1) {
+ box = pict->common.src_clip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
b = bits + (y1)*stride;
x_off = x1;
- tl = pixman_region_contains_point(&pict->common.clip_region, x1, y1, &box)
+ tl = pixman_region_contains_point(pict->common.src_clip, x1, y1, &box)
? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0;
- tr = pixman_region_contains_point(&pict->common.clip_region, x2, y1, &box)
+ tr = pixman_region_contains_point(pict->common.src_clip, x2, y1, &box)
? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0;
b += stride;
- bl = pixman_region_contains_point(&pict->common.clip_region, x1, y2, &box)
+ bl = pixman_region_contains_point(pict->common.src_clip, x1, y2, &box)
? fetch((pixman_image_t *)pict, b, x_off, indexed) : 0;
- br = pixman_region_contains_point(&pict->common.clip_region, x2, y2, &box)
+ br = pixman_region_contains_point(pict->common.src_clip, x2, y2, &box)
? fetch((pixman_image_t *)pict, b, x_off + 1, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
for (x = x1; x < x2; x++) {
if (*p) {
int tx = (pict->common.repeat == PIXMAN_REPEAT_NORMAL) ? MOD (x, pict->width) : x;
- if (pixman_region_contains_point (&pict->common.clip_region, tx, ty, &box)) {
+ if (pixman_region_contains_point (pict->common.src_clip, tx, ty, &box)) {
uint32_t *b = bits + (ty)*stride;
uint32_t c = fetch((pixman_image_t *)pict, b, tx, indexed);
#include "pixman.h"
#include "pixman-private.h"
-enum
-{
- PIXMAN_BAD_VALUE,
- PIXMAN_BAD_ALLOC
-};
-
static void
init_source_image (source_image_t *image)
{
if (image)
{
image_common_t *common = &image->common;
-
+
+ pixman_region_init (&common->full_region);
pixman_region_init (&common->clip_region);
+ common->src_clip = &common->full_region;
common->has_client_clip = FALSE;
common->transform = NULL;
common->repeat = PIXMAN_REPEAT_NONE;
if (common->ref_count == 0)
{
pixman_region_fini (&common->clip_region);
+ pixman_region_fini (&common->full_region);
if (common->transform)
free (common->transform);
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
{
*/
image->bits.indexed = NULL;
- reset_clip_region (image);
+ pixman_region_fini (&image->common.full_region);
+ pixman_region_init_rect (&image->common.full_region, 0, 0,
+ image->bits.width, image->bits.height);
+ reset_clip_region (image);
return image;
}