mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-06 02:40:14 +01:00
Fix broken dmxShmPutImage implementation.
This commit is contained in:
parent
cb8c3e79ad
commit
84eda62ada
1 changed files with 25 additions and 21 deletions
|
|
@ -119,44 +119,48 @@ dmxShmPutImage (DrawablePtr pDraw,
|
|||
XLIB_PROLOGUE (dmxScreen);
|
||||
image = XCreateImage (dmxScreen->beDisplay,
|
||||
dmxScreen->beVisuals[vIndex].visual,
|
||||
depth, format, 0, data, sw, sh,
|
||||
depth, format, 0, data, w, h,
|
||||
BitmapPad (dmxScreen->beDisplay),
|
||||
(format == ZPixmap) ?
|
||||
PixmapBytePad (sw, depth) : BitmapBytePad (sw));
|
||||
PixmapBytePad (w, depth) : BitmapBytePad (w));
|
||||
XLIB_EPILOGUE (dmxScreen);
|
||||
|
||||
if (image)
|
||||
{
|
||||
RegionRec reg, clip;
|
||||
RegionRec reg;
|
||||
BoxRec src, dst;
|
||||
BoxPtr pBox;
|
||||
int nBox;
|
||||
|
||||
src.x1 = dx - sx;
|
||||
src.y1 = dy - sy;
|
||||
src.x2 = src.x1 + sw;
|
||||
src.y2 = src.y1 + sh;
|
||||
src.x2 = src.x1 + w;
|
||||
src.y2 = src.y1 + h;
|
||||
|
||||
dst.x1 = dx;
|
||||
dst.y1 = dy;
|
||||
dst.x2 = dst.x1 + w;
|
||||
dst.y2 = dst.y1 + h;
|
||||
dst.x2 = dst.x1 + sw;
|
||||
dst.y2 = dst.y1 + sh;
|
||||
|
||||
if (src.x1 < dst.x1)
|
||||
src.x1 = dst.x1;
|
||||
if (src.y1 < dst.y1)
|
||||
src.y1 = dst.y1;
|
||||
if (src.x2 > dst.x2)
|
||||
src.x2 = dst.x2;
|
||||
if (src.y2 > dst.y2)
|
||||
src.y2 = dst.y2;
|
||||
if (src.x1 > dst.x1)
|
||||
dst.x1 = src.x1;
|
||||
if (src.y1 > dst.y1)
|
||||
dst.y1 = src.y1;
|
||||
if (src.x2 < dst.x2)
|
||||
dst.x2 = src.x2;
|
||||
if (src.y2 < dst.y2)
|
||||
dst.y2 = src.y2;
|
||||
|
||||
REGION_INIT (pGC->pScreen, ®, &src, 0);
|
||||
REGION_INIT (pGC->pScreen, &clip, &miEmptyBox, 0);
|
||||
|
||||
REGION_COPY (pGC->pScreen, &clip, pGC->pCompositeClip);
|
||||
REGION_TRANSLATE (pGC->pScreen, &clip, -pDraw->x, -pDraw->y);
|
||||
REGION_INTERSECT (pGC->pScreen, ®, ®, &clip);
|
||||
REGION_INIT (pGC->pScreen, ®, &dst, 0);
|
||||
|
||||
if (pGC->pCompositeClip)
|
||||
{
|
||||
REGION_TRANSLATE (pGC->pScreen, pGC->pCompositeClip,
|
||||
-pDraw->x, -pDraw->y);
|
||||
REGION_INTERSECT (pGC->pScreen, ®, ®, pGC->pCompositeClip);
|
||||
REGION_TRANSLATE (pGC->pScreen, pGC->pCompositeClip,
|
||||
pDraw->x, pDraw->y);
|
||||
}
|
||||
|
||||
nBox = REGION_NUM_RECTS (®);
|
||||
pBox = REGION_RECTS (®);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue