Commit fd95d37c authored by Roman Gilg's avatar Roman Gilg
Browse files

Scale visible region

parent 97da8cc7
Pipeline #15077 failed with stages
in 53 seconds
......@@ -379,6 +379,9 @@ compSetOwnerSize(WindowPtr pWin, CARD16 ownerWidth, CARD16 ownerHeight, ClientPt
int
compSendOwnerSizeCoreEvents(WindowPtr pWin);
void
compScaleRegion(RegionPtr pRegion, double xscale, double yscale);
void
compScalePicture(WindowPtr pWin, PicturePtr picture, double *xscale, double *yscale);
......
......@@ -633,7 +633,7 @@ compScaleBox(BoxPtr pBox, double xscale, double yscale)
return pBox->x1 < pBox->x2 && pBox->y1 < pBox->y2;
}
static void
void
compScaleRegion(RegionPtr pRegion, double xscale, double yscale)
{
if (!compScaleBox(&pRegion->extents, xscale, yscale)) {
......
......@@ -2123,9 +2123,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
goto out;
}
// TODO: this is still in owner-size
pVisibleRegion = &pWin->borderClip;
/* If the drawable is a window, the rectangle must be contained within
* its bounds (including the border). */
if (x < -wBorderWidth(pWin) ||
......@@ -2136,6 +2133,9 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
goto out;
}
pVisibleRegion = RegionCreate(NullBox, 0);
RegionCopy(pVisibleRegion, &pWin->borderClip);
relx += pDraw->x;
rely += pDraw->y;
......@@ -2175,6 +2175,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
&error);
compScalePicture(pWin, pSrcPicture, &scaleX, &scaleY);
RegionTranslate(pVisibleRegion, -pPix->screen_x, -pPix->screen_y);
compScaleRegion(pVisibleRegion, 1./scaleX, 1./scaleY);
CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture,
0, 0, /* src_x, src_y */
0, 0, /* msk_x, msk_y */
......@@ -2328,6 +2332,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
out:
if (pDstPixmap)
FreePixmap(pDstPixmap);
if (pVisibleRegion)
RegionDestroy(pVisibleRegion);
return rc;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment