hw/xwin: Add a flag to track which windows have been drawn to using WGL.

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon TURNEY 2010-10-11 16:25:03 +01:00
parent 98c6d91a48
commit b0b54338e2
5 changed files with 34 additions and 2 deletions

View File

@ -16,7 +16,11 @@ if XWIN_MULTIWINDOWEXTWM
DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
endif
DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM)
if XWIN_GLX_WINDOWS
DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
endif
DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS)
INCLUDES = -I$(top_srcdir)/miext/rootless

View File

@ -61,6 +61,9 @@ HWND winGetWindowInfo(WindowPtr pWin)
{
/* copy window handle */
hwnd = pWinPriv->hWnd;
/* mark GLX active on that hwnd */
pWinPriv->fWglUsed = TRUE;
}
return hwnd;

View File

@ -110,7 +110,10 @@ winCreateWindowMultiWindow (WindowPtr pWin)
pWinPriv->hWnd = NULL;
pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
pWinPriv->fXKilled = FALSE;
#ifdef XWIN_GLX_WINDOWS
pWinPriv->fWglUsed = FALSE;
#endif
return fResult;
}
@ -652,6 +655,11 @@ winDestroyWindowsWindow (WindowPtr pWin)
winDestroyIcon(hIcon);
winDestroyIcon(hIconSm);
#ifdef XWIN_GLX_WINDOWS
/* No longer note WGL used on this window */
pWinPriv->fWglUsed = FALSE;
#endif
/* Process all messages on our queue */
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{

View File

@ -472,6 +472,20 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
return 0;
}
#ifdef XWIN_GLX_WINDOWS
if (pWinPriv->fWglUsed)
{
/*
For regions which are being drawn by GL, the shadow framebuffer doesn't have the
correct bits, so don't bitblt from the shadow framebuffer
XXX: For now, just leave it alone, but ideally we want to send an expose event to
the window so it really redraws the affected region...
*/
ValidateRect(hwnd, &(ps.rcPaint));
}
else
#endif
/* Try to copy from the shadow buffer */
if (!BitBlt (hdcUpdate,
ps.rcPaint.left, ps.rcPaint.top,

View File

@ -80,6 +80,9 @@ typedef struct
winPrivScreenPtr pScreenPriv;
Bool fXKilled;
HDWP hDwp;
#ifdef XWIN_GLX_WINDOWS
Bool fWglUsed;
#endif
/* Privates used by primary fb DirectDraw server */
LPDDSURFACEDESC pddsdPrimary;