pixman: Use pSourceClip rather than pCompositeClip when fetching

This fixes the source-clip-scale test failures for most backends.
This commit is contained in:
Vladimir Vukicevic 2006-08-17 13:28:58 -07:00 committed by Carl Worth
parent 64d2feb9f6
commit 72e25648c4

View file

@ -3092,8 +3092,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
if (pict->filter == PIXMAN_FILTER_NEAREST || pict->filter == PIXMAN_FILTER_FAST)
{
if (pict->repeat == RepeatNormal) {
if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
if (PIXREGION_NUM_RECTS(pict->pSourceClip) == 1) {
box = pict->pSourceClip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
@ -3128,7 +3128,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y = MOD(v.vector[1]>>16, pict->pDrawable->height);
x = MOD(v.vector[0]>>16, pict->pDrawable->width);
}
if (pixman_region_contains_point (pict->pCompositeClip, x, y, &box))
if (pixman_region_contains_point (pict->pSourceClip, x, y, &box))
buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
else
buffer[i] = 0;
@ -3140,8 +3140,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
}
} else {
if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
if (PIXREGION_NUM_RECTS(pict->pSourceClip) == 1) {
box = pict->pSourceClip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
@ -3175,7 +3175,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y = v.vector[1]>>16;
x = v.vector[0]>>16;
}
if (pixman_region_contains_point (pict->pCompositeClip, x, y, &box))
if (pixman_region_contains_point (pict->pSourceClip, x, y, &box))
buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
else
buffer[i] = 0;
@ -3194,8 +3194,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
unit.vector[1] -= unit.vector[2]/2;
if (pict->repeat == RepeatNormal) {
if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
if (PIXREGION_NUM_RECTS(pict->pSourceClip) == 1) {
box = pict->pSourceClip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
@ -3298,14 +3298,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
b = bits + (y1 + pict->pDrawable->y)*stride;
tl = pixman_region_contains_point(pict->pCompositeClip, x1, y1, &box)
tl = pixman_region_contains_point(pict->pSourceClip, x1, y1, &box)
? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
tr = pixman_region_contains_point(pict->pCompositeClip, x2, y1, &box)
tr = pixman_region_contains_point(pict->pSourceClip, x2, y1, &box)
? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
b = bits + (y2 + pict->pDrawable->y)*stride;
bl = pixman_region_contains_point(pict->pCompositeClip, x1, y2, &box)
bl = pixman_region_contains_point(pict->pSourceClip, x1, y2, &box)
? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
br = pixman_region_contains_point(pict->pCompositeClip, x2, y2, &box)
br = pixman_region_contains_point(pict->pSourceClip, x2, y2, &box)
? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
@ -3329,8 +3329,8 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
}
} else {
if (PIXREGION_NUM_RECTS(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
if (PIXREGION_NUM_RECTS(pict->pSourceClip) == 1) {
box = pict->pSourceClip->extents;
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
@ -3431,14 +3431,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
b = bits + (y1 + pict->pDrawable->y)*stride;
x_off = x1 + pict->pDrawable->x;
tl = pixman_region_contains_point(pict->pCompositeClip, x1, y1, &box)
tl = pixman_region_contains_point(pict->pSourceClip, x1, y1, &box)
? fetch(b, x_off, indexed) : 0;
tr = pixman_region_contains_point(pict->pCompositeClip, x2, y1, &box)
tr = pixman_region_contains_point(pict->pSourceClip, x2, y1, &box)
? fetch(b, x_off + 1, indexed) : 0;
b += stride;
bl = pixman_region_contains_point(pict->pCompositeClip, x1, y2, &box)
bl = pixman_region_contains_point(pict->pSourceClip, x1, y2, &box)
? fetch(b, x_off, indexed) : 0;
br = pixman_region_contains_point(pict->pCompositeClip, x2, y2, &box)
br = pixman_region_contains_point(pict->pSourceClip, x2, y2, &box)
? fetch(b, x_off + 1, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
@ -3500,7 +3500,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
for (x = x1; x < x2; x++) {
if (*p) {
int tx = (pict->repeat == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x;
if (pixman_region_contains_point (pict->pCompositeClip, tx, ty, &box)) {
if (pixman_region_contains_point (pict->pSourceClip, tx, ty, &box)) {
FbBits *b = bits + (ty + pict->pDrawable->y)*stride;
CARD32 c = fetch(b, tx + pict->pDrawable->x, indexed);