From 8e5873fcf5061cc7a04e7eba444433babb284c88 Mon Sep 17 00:00:00 2001 Message-Id: <8e5873fcf5061cc7a04e7eba444433babb284c88.1226931512.git.jon.turney@dronecode.org.uk> In-Reply-To: References: From: Jon TURNEY Date: Sun, 2 Nov 2008 18:27:14 +0000 Subject: [PATCH 06/32] Cygwin: update for changes to shadow framebuffer Signed-off-by: Jon TURNEY --- hw/xwin/win.h | 3 +++ hw/xwin/winscrinit.c | 32 +++++++++++++++++++++++++++----- hw/xwin/winshaddd.c | 2 +- hw/xwin/winshadddnl.c | 2 +- hw/xwin/winshadgdi.c | 2 +- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/hw/xwin/win.h b/hw/xwin/win.h index dc13ef9..5094bb8 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -314,6 +314,7 @@ typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr); typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin); +typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr); /* Typedef for DIX wrapper functions */ typedef int (*winDispatchProcPtr) (ClientPtr); @@ -564,6 +565,8 @@ typedef struct _winPrivScreenRec winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface; winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface; + winCreateScreenResourcesProc pwinCreateScreenResources; + #ifdef XWIN_MULTIWINDOW /* Window Procedures for MultiWindow mode */ winFinishCreateWindowsWindowProcPtr pwinFinishCreateWindowsWindow; diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index ee3c78b..96778ab 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -244,6 +244,25 @@ winScreenInit (int index, return TRUE; } +static Bool +winCreateScreenResources(ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + Bool result; + + result = pScreenPriv->pwinCreateScreenResources(pScreen); + + /* Now the screen bitmap has been wrapped in a pixmap, + add that to the Shadow framebuffer */ + if (!shadowAdd(pScreen, pScreen->devPrivate, + pScreenPriv->pwinShadowUpdate, NULL, 0, 0)) + { + ErrorF ("winCreateScreenResources - shadowAdd () failed\n"); + return FALSE; + } + + return result; +} /* See Porting Layer Definition - p. 20 */ Bool @@ -427,15 +446,18 @@ winFinishScreenInitFB (int index, ) { #if CYGDEBUG - winDebug ("winFinishScreenInitFB - Calling shadowInit ()\n"); + winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n"); #endif - if (!shadowInit (pScreen, - pScreenPriv->pwinShadowUpdate, - NULL)) + if (!shadowSetup(pScreen)) { - ErrorF ("winFinishScreenInitFB - shadowInit () failed\n"); + ErrorF ("winFinishScreenInitFB - shadowSetup () failed\n"); return FALSE; } + + /* Wrap CreateScreenResources so we can add the screen pixmap + to the Shadow framebuffer after it's been created */ + pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources; + pScreen->CreateScreenResources = winCreateScreenResources; } #ifdef XWIN_MULTIWINDOWEXTWM diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index a2c1dc9..5f5daeb 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -508,7 +508,7 @@ winShadowUpdateDD (ScreenPtr pScreen, { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = &pBuf->damage; + RegionPtr damage = shadowDamage(pBuf); HRESULT ddrval = DD_OK; RECT rcDest, rcSrc; POINT ptOrigin; diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 47cc382..630c720 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -584,7 +584,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen, { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = &pBuf->damage; + RegionPtr damage = shadowDamage(pBuf); HRESULT ddrval = DD_OK; RECT rcDest, rcSrc; POINT ptOrigin; diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 04cc2f7..d38e4f7 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -498,7 +498,7 @@ winShadowUpdateGDI (ScreenPtr pScreen, { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - RegionPtr damage = &pBuf->damage; + RegionPtr damage = shadowDamage(pBuf); DWORD dwBox = REGION_NUM_RECTS (damage); BoxPtr pBox = REGION_RECTS (damage); int x, y, w, h; -- 1.6.0.2