aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/fb
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/fb')
-rw-r--r--xorg-server/fb/fbbltone.c5
-rw-r--r--xorg-server/fb/fbpict.c2
-rw-r--r--xorg-server/fb/fbtrap.c63
3 files changed, 40 insertions, 30 deletions
diff --git a/xorg-server/fb/fbbltone.c b/xorg-server/fb/fbbltone.c
index 4a08a5a33..0e95aa3ff 100644
--- a/xorg-server/fb/fbbltone.c
+++ b/xorg-server/fb/fbbltone.c
@@ -26,6 +26,11 @@
#include "fb.h"
+#ifdef __clang__
+/* shift overflow is intentional */
+#pragma clang diagnostic ignored "-Wshift-overflow"
+#endif
+
/*
* Example: srcX = 13 dstX = 8 (FB unit 32 dstBpp 8)
*
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c
index fb26632bd..3113523a9 100644
--- a/xorg-server/fb/fbpict.c
+++ b/xorg-server/fb/fbpict.c
@@ -160,7 +160,7 @@ create_bits_picture (PicturePtr pict,
fbGetPixmapBitsData(pixmap, bits, stride, bpp);
image = pixman_image_create_bits (
- pict->format,
+ (pixman_format_code_t)pict->format,
pixmap->drawable.width, pixmap->drawable.height,
(uint32_t *)bits, stride * sizeof (FbStride));
diff --git a/xorg-server/fb/fbtrap.c b/xorg-server/fb/fbtrap.c
index 2f23d8564..9c2bcd516 100644
--- a/xorg-server/fb/fbtrap.c
+++ b/xorg-server/fb/fbtrap.c
@@ -29,6 +29,7 @@
#include "picturestr.h"
#include "mipict.h"
#include "fbpict.h"
+#include "damage.h"
void
fbAddTraps (PicturePtr pPicture,
@@ -37,13 +38,14 @@ fbAddTraps (PicturePtr pPicture,
int ntrap,
xTrap *traps)
{
- int image_xoff, image_yoff;
- pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+ pixman_image_t *image;
+ int dst_xoff, dst_yoff;
- if (!image)
+ if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
return;
- pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
+ pixman_add_traps (image, x_off + dst_xoff, y_off + dst_yoff,
+ ntrap, (pixman_trap_t *)traps);
free_pixman_pict (pPicture, image);
}
@@ -54,13 +56,15 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int x_off,
int y_off)
{
- int mask_xoff, mask_yoff;
- pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+ pixman_image_t *image;
+ int dst_xoff, dst_yoff;
- if (!image)
+ if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
return;
- pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
+ pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap,
+ x_off + dst_xoff,
+ y_off + dst_yoff);
free_pixman_pict (pPicture, image);
}
@@ -72,14 +76,15 @@ fbAddTriangles (PicturePtr pPicture,
int ntri,
xTriangle *tris)
{
- int image_xoff, image_yoff;
- pixman_image_t *image =
- image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+ pixman_image_t *image;
+ int dst_xoff, dst_yoff;
- if (!image)
+ if (!(image = image_from_pict (pPicture, FALSE, &dst_xoff, &dst_yoff)))
return;
- pixman_add_triangles (image, x_off, y_off, ntri, (pixman_triangle_t *)tris);
+ pixman_add_triangles (image,
+ dst_xoff + x_off, dst_yoff + y_off,
+ ntri, (pixman_triangle_t *)tris);
free_pixman_pict (pPicture, image);
}
@@ -100,8 +105,6 @@ fbShapes (CompositeShapesFunc composite,
PictFormatPtr maskFormat,
int16_t xSrc,
int16_t ySrc,
- int16_t xDst,
- int16_t yDst,
int nshapes,
int shape_size,
const uint8_t * shapes)
@@ -110,6 +113,8 @@ fbShapes (CompositeShapesFunc composite,
int src_xoff, src_yoff;
int dst_xoff, dst_yoff;
+ miCompositeSourceValidate (pSrc);
+
src = image_from_pict (pSrc, FALSE, &src_xoff, &src_yoff);
dst = image_from_pict (pDst, TRUE, &dst_xoff, &dst_yoff);
@@ -117,6 +122,8 @@ fbShapes (CompositeShapesFunc composite,
{
pixman_format_code_t format;
+ DamageRegionAppend (pDst->pDrawable, pDst->pCompositeClip);
+
if (!maskFormat)
{
int i;
@@ -131,8 +138,8 @@ fbShapes (CompositeShapesFunc composite,
composite (op, src, dst, format,
xSrc + src_xoff,
ySrc + src_yoff,
- xDst + dst_xoff,
- yDst + dst_yoff,
+ dst_xoff,
+ dst_yoff,
1, shapes + i * shape_size);
}
}
@@ -157,10 +164,12 @@ fbShapes (CompositeShapesFunc composite,
composite (op, src, dst, format,
xSrc + src_xoff,
ySrc + src_yoff,
- xDst + dst_xoff,
- yDst + dst_yoff,
+ dst_xoff,
+ dst_yoff,
nshapes, shapes);
}
+
+ DamageRegionProcessPending (pDst->pDrawable);
}
free_pixman_pict (pSrc, src);
@@ -177,14 +186,12 @@ fbTrapezoids (CARD8 op,
int ntrap,
xTrapezoid *traps)
{
- int xDst, yDst;
-
- xDst = traps[0].left.p1.x >> 16;
- yDst = traps[0].left.p1.y >> 16;
+ xSrc -= (traps[0].left.p1.x >> 16);
+ ySrc -= (traps[0].left.p1.y >> 16);
fbShapes ((CompositeShapesFunc)pixman_composite_trapezoids,
op, pSrc, pDst, maskFormat,
- xSrc, ySrc, xDst, yDst,
+ xSrc, ySrc,
ntrap, sizeof (xTrapezoid), (const uint8_t *)traps);
}
@@ -198,13 +205,11 @@ fbTriangles (CARD8 op,
int ntris,
xTriangle *tris)
{
- int xDst, yDst;
-
- xDst = tris[0].p1.x >> 16;
- yDst = tris[0].p1.y >> 16;
+ xSrc -= (tris[0].p1.x >> 16);
+ ySrc -= (tris[0].p1.y >> 16);
fbShapes ((CompositeShapesFunc)pixman_composite_triangles,
op, pSrc, pDst, maskFormat,
- xSrc, ySrc, xDst, yDst,
+ xSrc, ySrc,
ntris, sizeof (xTriangle), (const uint8_t *)tris);
}