diff options
Diffstat (limited to 'composite/compinit.c')
-rw-r--r-- | composite/compinit.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/composite/compinit.c b/composite/compinit.c index 276ed75f8..e1a765684 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -77,6 +77,8 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->CopyWindow = cs->CopyWindow; pScreen->PositionWindow = cs->PositionWindow; + pScreen->GetImage = cs->GetImage; + free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); ret = (*pScreen->CloseScreen) (index, pScreen); @@ -129,6 +131,25 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) return ret; } +static void +compGetImage (DrawablePtr pDrawable, + int sx, int sy, + int w, int h, + unsigned int format, + unsigned long planemask, + char *pdstLine) +{ + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen (pScreen); + + pScreen->GetImage = cs->GetImage; + if (pDrawable->type == DRAWABLE_WINDOW) + compScreenUpdate (pScreen); + (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; +} + /* * Add alternate visuals -- always expose an ARGB32 and RGB24 visual */ @@ -361,6 +382,9 @@ compScreenInit (ScreenPtr pScreen) cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; + dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs); RegisterRealChildHeadProc(CompositeRealChildHead); |