summaryrefslogtreecommitdiff
path: root/hw/xwin/winshadddnl.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2010-09-29 22:54:22 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-01-19 14:02:37 +0000
commit09fd010902fad56735b8069b1becb80d85bd6a35 (patch)
tree2a46e39fd0bc561203e3bf44f496948a4f867144 /hw/xwin/winshadddnl.c
parent625ab9701fd75b879c1dafc05fa979591eea87c0 (diff)
Cygwin/X: DirectDraw engines shouldn't try to blit if the surface wasn't allocated
Fix winShadowUpdateDD(|NL) so we don't try to blit to primary surface if it didn't get allocated (Intel drivers, in particular, seem to like to issue a WM_DISPLAYCHANGE during a suspend/resume cycle, but not allow surface to be allocated right then) Also: Use winReleasePrimarySurfaceShadowDD(|NL) in winFreeFBShadowDD(|NL) rather than open coding it Don't mess about recreating surface if we're going to resize it anyhow Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Tested-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin/winshadddnl.c')
-rw-r--r--hw/xwin/winshadddnl.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index c74a2ff14..0a0b4ae13 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -546,25 +546,16 @@ winFreeFBShadowDDNL(ScreenPtr pScreen)
pScreenPriv->pddsShadow4 = NULL;
}
- /* Detach the clipper from the primary surface and release the clipper. */
+ /* Detach the clipper from the primary surface and release the primary surface, if there is one */
+ winReleasePrimarySurfaceShadowDDNL(pScreen);
+
+ /* Release the clipper object */
if (pScreenPriv->pddcPrimary)
{
- /* Detach the clipper */
- IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
- NULL);
-
- /* Release the clipper object */
IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
pScreenPriv->pddcPrimary = NULL;
}
- /* Release the primary surface, if there is one */
- if (pScreenPriv->pddsPrimary4)
- {
- IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
- pScreenPriv->pddsPrimary4 = NULL;
- }
-
/* Free the DirectDraw4 object, if there is one */
if (pScreenPriv->pdd4)
{
@@ -658,6 +649,10 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
|| pScreenPriv->fBadDepth) return;
+ /* Return immediately if we didn't get needed surfaces */
+ if (!pScreenPriv->pddsPrimary4 || !pScreenPriv->pddsShadow4)
+ return;
+
/* Get the origin of the window in the screen coords */
ptOrigin.x = pScreenInfo->dwXOffset;
ptOrigin.y = pScreenInfo->dwYOffset;