[COMPOSITE] Composite used for pixmap population on redirect. (Bug #7447)
compNewPixmap copies bits from the parent window to the redirected child pixmap to populate the pixmap with reasonable data. It cannot always use CopyArea as that only works across matching depths. Use Composite when the depths do not match.
This commit is contained in:
parent
1afdf8b0a9
commit
f98dfec79d
|
@ -461,7 +461,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
WindowPtr pParent = pWin->parent;
|
WindowPtr pParent = pWin->parent;
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
GCPtr pGC;
|
|
||||||
|
|
||||||
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth);
|
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth);
|
||||||
|
|
||||||
|
@ -471,7 +470,9 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
|
||||||
pPixmap->screen_x = x;
|
pPixmap->screen_x = x;
|
||||||
pPixmap->screen_y = y;
|
pPixmap->screen_y = y;
|
||||||
|
|
||||||
pGC = GetScratchGC (pWin->drawable.depth, pScreen);
|
if (pParent->drawable.depth == pWin->drawable.depth)
|
||||||
|
{
|
||||||
|
GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy bits from the parent into the new pixmap so that it will
|
* Copy bits from the parent into the new pixmap so that it will
|
||||||
|
@ -491,6 +492,42 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h)
|
||||||
w, h, 0, 0);
|
w, h, 0, 0);
|
||||||
FreeScratchGC (pGC);
|
FreeScratchGC (pGC);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PictFormatPtr pSrcFormat = compWindowFormat (pParent);
|
||||||
|
PictFormatPtr pDstFormat = compWindowFormat (pWin);
|
||||||
|
XID inferiors = IncludeInferiors;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
PicturePtr pSrcPicture = CreatePicture (None,
|
||||||
|
&pParent->drawable,
|
||||||
|
pSrcFormat,
|
||||||
|
CPSubwindowMode,
|
||||||
|
&inferiors,
|
||||||
|
serverClient, &error);
|
||||||
|
|
||||||
|
PicturePtr pDstPicture = CreatePicture (None,
|
||||||
|
&pPixmap->drawable,
|
||||||
|
pDstFormat,
|
||||||
|
0, 0,
|
||||||
|
serverClient, &error);
|
||||||
|
|
||||||
|
if (pSrcPicture && pDstPicture)
|
||||||
|
{
|
||||||
|
CompositePicture (PictOpSrc,
|
||||||
|
pSrcPicture,
|
||||||
|
NULL,
|
||||||
|
pDstPicture,
|
||||||
|
x - pParent->drawable.x,
|
||||||
|
y - pParent->drawable.y,
|
||||||
|
0, 0, 0, 0, w, h);
|
||||||
|
}
|
||||||
|
if (pSrcPicture)
|
||||||
|
FreePicture (pSrcPicture, 0);
|
||||||
|
if (pDstPicture)
|
||||||
|
FreePicture (pDstPicture, 0);
|
||||||
|
}
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,9 @@ compCheckTree (ScreenPtr pScreen);
|
||||||
#define compCheckTree(s)
|
#define compCheckTree(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
PictFormatPtr
|
||||||
|
compWindowFormat (WindowPtr pWin);
|
||||||
|
|
||||||
void
|
void
|
||||||
compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
||||||
|
|
||||||
|
|
|
@ -685,7 +685,7 @@ compGetWindowVisual (WindowPtr pWin)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PictFormatPtr
|
PictFormatPtr
|
||||||
compWindowFormat (WindowPtr pWin)
|
compWindowFormat (WindowPtr pWin)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
Loading…
Reference in New Issue