summaryrefslogtreecommitdiff
path: root/fb/fbpict.c
diff options
context:
space:
mode:
Diffstat (limited to 'fb/fbpict.c')
-rw-r--r--fb/fbpict.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/fb/fbpict.c b/fb/fbpict.c
index ead84d735..85b5171c5 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -185,15 +185,11 @@ fbComposite (CARD8 op,
pixman_image_composite (op, src, mask, dest,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height);
-
}
-
- if (src)
- pixman_image_unref (src);
- if (mask)
- pixman_image_unref (mask);
- if (dest)
- pixman_image_unref (dest);
+
+ free_pixman_pict (pSrc, src);
+ free_pixman_pict (pMask, mask);
+ free_pixman_pict (pDst, dest);
}
void
@@ -210,7 +206,7 @@ fbCompositeGeneral (CARD8 op,
CARD16 width,
CARD16 height)
{
- return fbComposite (op, pSrc, pMask, pDst,
+ fbComposite (op, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height);
}
@@ -295,9 +291,9 @@ create_bits_picture (PicturePtr pict,
pixman_image_t *image;
fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
-
- bits += yoff * stride + xoff;
-
+
+ bits = (CARD8*)bits + yoff * stride * sizeof(FbBits) + xoff * (bpp / 8);
+
image = pixman_image_create_bits (
pict->format,
pict->pDrawable->width, pict->pDrawable->height,
@@ -332,8 +328,6 @@ create_bits_picture (PicturePtr pict,
/* Indexed table */
if (pict->pFormat->index.devPrivate)
pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
-
- fbFinishAccess (pict->pDrawable);
return image;
}
@@ -379,7 +373,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
pixman_image_set_alpha_map (
image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
- pixman_image_unref (alpha_map);
+ free_pixman_pict (pict->alphaMap, alpha_map);
}
pixman_image_set_component_alpha (image, pict->componentAlpha);
@@ -403,6 +397,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
}
pixman_image_set_filter (image, filter, (pixman_fixed_t *)pict->filter_params, pict->filter_nparams);
+ pixman_image_set_source_clipping (image, TRUE);
}
pixman_image_t *
@@ -445,6 +440,13 @@ image_from_pict (PicturePtr pict,
return image;
}
+void
+free_pixman_pict (PicturePtr pict, pixman_image_t *image)
+{
+ if (image && pixman_image_unref (image) && pict->pDrawable)
+ fbFinishAccess (pict->pDrawable);
+}
+
Bool
fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{