winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
7 participants
787 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11.drv: Invalidate the DCE when the window format is changed.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 12b4930f96e93d81dce0bc250346938754d92361 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12b4930f96e93d81dce0bc250…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:57:09 2007 +0200 winex11.drv: Invalidate the DCE when the window format is changed. --- dlls/winex11.drv/window.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index b0a7460..122370f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -177,6 +177,7 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id ) data->fbconfig_id = fbconfig_id; SetPropA(hwnd, fbconfig_id_prop, (HANDLE)data->fbconfig_id); + invalidate_dce( hwnd, &data->window_rect ); return TRUE; }
1
0
0
0
Alexandre Julliard : gdi32: Update the DC in most OpenGL functions.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 9aee0b4157ba05a9303bdb89a84240f22c90a11d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9aee0b4157ba05a9303bdb89a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:56:56 2007 +0200 gdi32: Update the DC in most OpenGL functions. --- dlls/gdi32/opengl.c | 18 ++++++++++-------- dlls/gdi32/painting.c | 10 ++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 137349d..164f279 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -65,16 +65,17 @@ static DC* OPENGL_GetDefaultDC(void) HGLRC WINAPI wglCreateContext(HDC hdc) { HGLRC ret = 0; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); TRACE("(%p)\n",hdc); if (!dc) return 0; + update_dc( dc ); if (!dc->funcs->pwglCreateContext) FIXME(" :stub\n"); else ret = dc->funcs->pwglCreateContext(dc->physDev); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -195,21 +196,22 @@ static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglr TRACE("hDrawDC: (%p), hReadDC: (%p) hglrc: (%p)\n", hDrawDC, hReadDC, hglrc); /* Both hDrawDC and hReadDC need to be valid */ - DrawDC = DC_GetDCPtr( hDrawDC); + DrawDC = get_dc_ptr( hDrawDC ); if (!DrawDC) return FALSE; - ReadDC = DC_GetDCPtr( hReadDC); + ReadDC = get_dc_ptr( hReadDC ); if (!ReadDC) { - DC_ReleaseDCPtr(DrawDC); + release_dc_ptr( DrawDC ); return FALSE; } + update_dc( DrawDC ); + update_dc( ReadDC ); if (!DrawDC->funcs->pwglMakeContextCurrentARB) FIXME(" :stub\n"); else ret = DrawDC->funcs->pwglMakeContextCurrentARB(DrawDC->physDev, ReadDC->physDev, hglrc); - DC_ReleaseDCPtr(DrawDC); - DC_ReleaseDCPtr(ReadDC); - + release_dc_ptr( DrawDC ); + release_dc_ptr( ReadDC ); return ret; } diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 987510f..1b8d6aa 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -394,16 +394,17 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat, INT WINAPI GetPixelFormat( HDC hdc ) { INT ret = 0; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); TRACE("(%p)\n",hdc); if (!dc) return 0; + update_dc( dc ); if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n"); else ret = dc->funcs->pGetPixelFormat(dc->physDev); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -460,12 +461,13 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes, BOOL WINAPI SwapBuffers( HDC hdc ) { INT bRet = FALSE; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); TRACE("(%p)\n",hdc); if (!dc) return TRUE; + update_dc( dc ); if (!dc->funcs->pSwapBuffers) { FIXME(" :stub\n"); @@ -473,7 +475,7 @@ BOOL WINAPI SwapBuffers( HDC hdc ) } else bRet = dc->funcs->pSwapBuffers(dc->physDev); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return bRet; }
1
0
0
0
Alexandre Julliard : gdi32: Replace remaining instance of DC_GetDCUpdate by get_dc_ptr+update_dc.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 99a258311c725e3b931f123259a0732738be9125 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99a258311c725e3b931f12325…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:49:37 2007 +0200 gdi32: Replace remaining instance of DC_GetDCUpdate by get_dc_ptr+update_dc. --- dlls/gdi32/dc.c | 68 +++++++++++++++----------------------------------- dlls/gdi32/font.c | 9 +++--- dlls/gdi32/opengl.c | 11 ++++--- 3 files changed, 32 insertions(+), 56 deletions(-) diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index adf88cc..fe51253 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -177,32 +177,6 @@ DC *DC_GetDCPtr( HDC hdc ) return dc; } -/*********************************************************************** - * DC_GetDCUpdate - * - * Retrieve a DC ptr while making sure the visRgn is updated. - * This function may call up to USER so the GDI lock should _not_ - * be held when calling it. - */ -DC *DC_GetDCUpdate( HDC hdc ) -{ - DC *dc = DC_GetDCPtr( hdc ); - if (!dc) return NULL; - while (InterlockedExchange( &dc->dirty, 0 )) - { - DCHOOKPROC proc = dc->hookThunk; - if (proc) - { - DWORD_PTR data = dc->dwHookData; - DC_ReleaseDCPtr( dc ); - proc( hdc, DCHC_INVALIDVISRGN, data, 0 ); - if (!(dc = DC_GetDCPtr( hdc ))) break; - /* otherwise restart the loop in case it became dirty again in the meantime */ - } - } - return dc; -} - /*********************************************************************** * DC_ReleaseDCPtr @@ -488,20 +462,21 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs ) { DC *dc, *dcs; - if (!(dc = DC_GetDCUpdate( hdc ))) return; - if (!(dcs = DC_GetDCPtr( hdcs ))) + if (!(dc = get_dc_ptr( hdc ))) return; + if (!(dcs = get_dc_ptr( hdcs ))) { - DC_ReleaseDCPtr( dc ); - return; + release_dc_ptr( dc ); + return; } if (!dcs->flags & DC_SAVED) { - DC_ReleaseDCPtr( dc ); - DC_ReleaseDCPtr( dcs ); - return; + release_dc_ptr( dc ); + release_dc_ptr( dcs ); + return; } TRACE("%p %p\n", hdc, hdcs ); + update_dc( dc ); dc->flags = dcs->flags & ~DC_SAVED; dc->layout = dcs->layout; dc->hDevice = dcs->hDevice; @@ -569,8 +544,8 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs ) SetBkColor( hdc, dcs->backgroundColor); SetTextColor( hdc, dcs->textColor); GDISelectPalette( hdc, dcs->hPalette, FALSE ); - DC_ReleaseDCPtr( dcs ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); + release_dc_ptr( dcs ); } @@ -653,22 +628,23 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) BOOL success; TRACE("%p %d\n", hdc, level ); - dc = DC_GetDCUpdate( hdc ); - if(!dc) return FALSE; + if (!(dc = get_dc_ptr( hdc ))) return FALSE; if(abs(level) > dc->saveLevel || level == 0) { - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return FALSE; } - + + update_dc( dc ); + if(dc->funcs->pRestoreDC) { success = dc->funcs->pRestoreDC( dc->physDev, level ); if(level < 0) level = dc->saveLevel + level + 1; if(success) dc->saveLevel = level - 1; - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return success; } @@ -677,10 +653,10 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) while (dc->saveLevel >= level) { HDC hdcs = dc->saved_dc; - if (!(dcs = DC_GetDCPtr( hdcs ))) + if (!(dcs = get_dc_ptr( hdcs ))) { - DC_ReleaseDCPtr( dc ); - return FALSE; + success = FALSE; + break; } dc->saved_dc = dcs->saved_dc; dcs->saved_dc = 0; @@ -692,12 +668,10 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level ) * returning FALSE but still destroying the saved DC state */ success=FALSE; } - DC_ReleaseDCPtr( dcs ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dcs ); DeleteDC( hdcs ); - if (!(dc = DC_GetDCPtr( hdc ))) return FALSE; } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return success; } diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 0cc7339..b5ec980 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1879,7 +1879,7 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, BOOL done_extents = FALSE; INT width = 0, xwidth = 0, ywidth = 0; DWORD type; - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); INT breakRem; if (!dc) return FALSE; @@ -1891,15 +1891,16 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags, if (!dc->funcs->pExtTextOut && !PATH_IsPathOpen(dc->path)) { - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } + update_dc( dc ); type = GetObjectType(hdc); if(type == OBJ_METADC || type == OBJ_ENHMETADC) { ret = dc->funcs->pExtTextOut(dc->physDev, x, y, flags, lprect, str, count, lpDx); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -2198,7 +2199,7 @@ done: if(reordered_str != str) HeapFree(GetProcessHeap(), 0, reordered_str); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); if (ret && (lf.lfUnderline || lf.lfStrikeOut)) { diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c index 97ecaf6..137349d 100644 --- a/dlls/gdi32/opengl.c +++ b/dlls/gdi32/opengl.c @@ -55,8 +55,8 @@ static DC* OPENGL_GetDefaultDC(void) { if(!default_hdc) default_hdc = CreateDCA("DISPLAY", NULL, NULL, NULL); - - return DC_GetDCPtr(default_hdc); + + return get_dc_ptr(default_hdc); } /*********************************************************************** @@ -169,16 +169,17 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) if(hglrc == NULL) dc = OPENGL_GetDefaultDC(); else - dc = DC_GetDCUpdate( hdc ); + dc = get_dc_ptr( hdc ); TRACE("hdc: (%p), hglrc: (%p)\n", hdc, hglrc); if (!dc) return FALSE; + update_dc( dc ); if (!dc->funcs->pwglMakeCurrent) FIXME(" :stub\n"); else ret = dc->funcs->pwglMakeCurrent(dc->physDev,hglrc); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -294,7 +295,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR func) if (!dc->funcs->pwglGetProcAddress) FIXME(" :stub\n"); else ret = dc->funcs->pwglGetProcAddress(func); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); /* At the moment we implement one WGL extension which requires a HDC. When we * are looking up this call and when the Extension is available (that is the case
1
0
0
0
Alexandre Julliard : gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the bitmap functions.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: baa8d225435f3bc029825b7601ca34a580b5e293 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=baa8d225435f3bc029825b760…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:48:56 2007 +0200 gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the bitmap functions. --- dlls/gdi32/bitblt.c | 61 ++++++++++++++++++++++++++------------------------- dlls/gdi32/dib.c | 44 ++++++++++++++++++++++-------------- 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index 0aaf186..4a814b7 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bitblt); BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, INT width, INT height, DWORD rop) { - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); BOOL bRet = FALSE; if (!dc) return FALSE; @@ -43,9 +43,10 @@ BOOL WINAPI PatBlt( HDC hdc, INT left, INT top, if (dc->funcs->pPatBlt) { TRACE("%p %d,%d %dx%d %06x\n", hdc, left, top, width, height, rop ); + update_dc( dc ); bRet = dc->funcs->pPatBlt( dc->physDev, left, top, width, height, rop ); } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return bRet; } @@ -59,22 +60,23 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, BOOL ret = FALSE; DC *dcDst, *dcSrc; - if ((dcDst = DC_GetDCUpdate( hdcDst )) && dcDst->funcs->pBitBlt) + if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE; + + if (dcDst->funcs->pBitBlt) { - DC_ReleaseDCPtr( dcDst ); - /* FIXME: there is a race condition here */ - dcSrc = DC_GetDCUpdate( hdcSrc ); - dcDst = DC_GetDCPtr( hdcDst ); + update_dc( dcDst ); + dcSrc = get_dc_ptr( hdcSrc ); + if (dcSrc) update_dc( dcSrc ); TRACE("hdcSrc=%p %d,%d -> hdcDest=%p %d,%d %dx%d rop=%06x\n", hdcSrc, xSrc, ySrc, hdcDst, xDst, yDst, width, height, rop); ret = dcDst->funcs->pBitBlt( dcDst->physDev, xDst, yDst, width, height, dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, rop ); - DC_ReleaseDCPtr( dcDst ); - if (dcSrc) DC_ReleaseDCPtr( dcSrc ); + release_dc_ptr( dcDst ); + if (dcSrc) release_dc_ptr( dcSrc ); } - else if(dcDst && dcDst->funcs->pStretchDIBits) + else if (dcDst->funcs->pStretchDIBits) { BITMAP bm; BITMAPINFOHEADER info_hdr; @@ -82,7 +84,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, LPVOID bits; INT lines; - DC_ReleaseDCPtr( dcDst ); + release_dc_ptr( dcDst ); if(GetObjectType( hdcSrc ) != OBJ_MEMDC) { @@ -118,8 +120,7 @@ BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, HeapFree(GetProcessHeap(), 0, bits); return (lines == height); } - else if(dcDst) - DC_ReleaseDCPtr( dcDst ); + else release_dc_ptr( dcDst ); return ret; } @@ -137,13 +138,14 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, BOOL ret = FALSE; DC *dcDst, *dcSrc; - if ((dcDst = DC_GetDCUpdate( hdcDst )) && dcDst->funcs->pStretchBlt) + if (!(dcDst = get_dc_ptr( hdcDst ))) return FALSE; + + if (dcDst->funcs->pStretchBlt) { - DC_ReleaseDCPtr( dcDst ); - /* FIXME: there is a race condition here */ - if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) + if ((dcSrc = get_dc_ptr( hdcSrc ))) { - dcDst = DC_GetDCPtr( hdcDst ); + update_dc( dcDst ); + update_dc( dcSrc ); TRACE("%p %d,%d %dx%d -> %p %d,%d %dx%d rop=%06x\n", hdcSrc, xSrc, ySrc, widthSrc, heightSrc, @@ -152,11 +154,11 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, ret = dcDst->funcs->pStretchBlt( dcDst->physDev, xDst, yDst, widthDst, heightDst, dcSrc->physDev, xSrc, ySrc, widthSrc, heightSrc, rop ); - DC_ReleaseDCPtr( dcDst ); - DC_ReleaseDCPtr( dcSrc ); + release_dc_ptr( dcDst ); + release_dc_ptr( dcSrc ); } } - else if(dcDst && dcDst->funcs->pStretchDIBits) + else if (dcDst->funcs->pStretchDIBits) { BITMAP bm; BITMAPINFOHEADER info_hdr; @@ -164,7 +166,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, LPVOID bits; INT lines; - DC_ReleaseDCPtr( dcDst ); + release_dc_ptr( dcDst ); if(GetObjectType( hdcSrc ) != OBJ_MEMDC) return FALSE; @@ -196,8 +198,7 @@ BOOL WINAPI StretchBlt( HDC hdcDst, INT xDst, INT yDst, HeapFree(GetProcessHeap(), 0, bits); return (lines == heightSrc); } - else if(dcDst) - DC_ReleaseDCPtr( dcDst ); + else release_dc_ptr( dcDst ); return ret; } @@ -496,11 +497,11 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig BOOL ret = FALSE; DC *dcDst, *dcSrc; - if ((dcSrc = DC_GetDCUpdate( hdcSrc ))) DC_ReleaseDCPtr( dcSrc ); - /* FIXME: there is a race condition here */ - if ((dcDst = DC_GetDCUpdate( hdcDst ))) + dcSrc = get_dc_ptr( hdcSrc ); + if ((dcDst = get_dc_ptr( hdcDst ))) { - dcSrc = DC_GetDCPtr( hdcSrc ); + if (dcSrc) update_dc( dcSrc ); + update_dc( dcDst ); TRACE("%p %d,%d %dx%d -> %p %d,%d %dx%d op=%02x flags=%02x srcconstalpha=%02x alphafmt=%02x\n", hdcSrc, xSrc, ySrc, widthSrc, heightSrc, hdcDst, xDst, yDst, widthDst, heightDst, @@ -510,9 +511,9 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig ret = dcDst->funcs->pAlphaBlend( dcDst->physDev, xDst, yDst, widthDst, heightDst, dcSrc ? dcSrc->physDev : NULL, xSrc, ySrc, widthSrc, heightSrc, blendFunction ); - if (dcSrc) DC_ReleaseDCPtr( dcSrc ); - DC_ReleaseDCPtr( dcDst ); + release_dc_ptr( dcDst ); } + if (dcSrc) release_dc_ptr( dcSrc ); return ret; } diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 9be02d8..ac2c9b0 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -193,15 +193,15 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, if (!bits || !info) return 0; - dc = DC_GetDCUpdate( hdc ); - if(!dc) return FALSE; + if (!(dc = get_dc_ptr( hdc ))) return FALSE; if(dc->funcs->pStretchDIBits) { + update_dc( dc ); heightSrc = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst, heightDst, xSrc, ySrc, widthSrc, heightSrc, bits, info, wUsage, dwRop); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); } else /* use StretchBlt */ { @@ -213,7 +213,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, WORD planes, bpp; DWORD compr, size; - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, &planes, &bpp, &compr, &size ) == -1) { @@ -303,29 +303,35 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan, BITMAPOBJ *bitmap; INT result = 0; - if (!(dc = DC_GetDCUpdate( hdc ))) + if (!(dc = get_dc_ptr( hdc ))) { if (coloruse == DIB_RGB_COLORS) FIXME( "shouldn't require a DC for DIB_RGB_COLORS\n" ); return 0; } + update_dc( dc ); + if (!(bitmap = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) { - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return 0; } if (!bitmap->funcs && !BITMAP_SetOwnerDC( hbitmap, dc )) goto done; - if (bitmap->funcs && bitmap->funcs->pSetDIBits) - result = bitmap->funcs->pSetDIBits( dc->physDev, hbitmap, startscan, lines, + result = lines; + if (bitmap->funcs) + { + if (bitmap->funcs != dc->funcs) + ERR( "not supported: DDB bitmap %p not belonging to device %p\n", hbitmap, hdc ); + else if (dc->funcs->pSetDIBits) + result = dc->funcs->pSetDIBits( dc->physDev, hbitmap, startscan, lines, bits, info, coloruse ); - else - result = lines; + } done: GDI_ReleaseObj( hbitmap ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return result; } @@ -343,18 +349,21 @@ INT WINAPI SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, if (!bits) return 0; - if (!(dc = DC_GetDCUpdate( hdc ))) return 0; + if (!(dc = get_dc_ptr( hdc ))) return 0; if(dc->funcs->pSetDIBitsToDevice) + { + update_dc( dc ); ret = dc->funcs->pSetDIBitsToDevice( dc->physDev, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, bits, info, coloruse ); + } else { FIXME("unimplemented on hdc %p\n", hdc); ret = 0; } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -563,14 +572,15 @@ INT WINAPI GetDIBits( return 0; } core_header = (bitmap_type == 0); - if (!(dc = DC_GetDCUpdate( hdc ))) + if (!(dc = get_dc_ptr( hdc ))) { SetLastError( ERROR_INVALID_PARAMETER ); return 0; } + update_dc( dc ); if (!(bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) { - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return 0; } @@ -622,7 +632,7 @@ INT WINAPI GetDIBits( memset( palEntry, 0, sizeof(palEntry) ); if (!GetPaletteEntries( dc->hPalette, 0, 1 << bmp->bitmap.bmBitsPixel, palEntry )) { - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); GDI_ReleaseObj( hbitmap ); return 0; } @@ -1019,7 +1029,7 @@ INT WINAPI GetDIBits( } TRACE("biWidth = %d, biHeight = %d\n", width, height); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); GDI_ReleaseObj( hbitmap ); return lines; }
1
0
0
0
Alexandre Julliard : gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the painting functions.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: f3f792d06485af893609b85dcc4a181c5c30b058 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3f792d06485af893609b85dc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:48:27 2007 +0200 gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the painting functions. --- dlls/gdi32/painting.c | 231 +++++++++++++++++++++++++++++++------------------ 1 files changed, 148 insertions(+), 83 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f3f792d06485af893609b…
1
0
0
0
Alexandre Julliard : gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the clipping functions.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: f486f24b96f17ecd414ab3199e4b8289af01209a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f486f24b96f17ecd414ab3199…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:46:29 2007 +0200 gdi32: Replace DC_GetDCUpdate by get_dc_ptr+update_dc in the clipping functions. --- dlls/gdi32/clipping.c | 71 +++++++++++++++++++++++++++++-------------------- 1 files changed, 42 insertions(+), 29 deletions(-) diff --git a/dlls/gdi32/clipping.c b/dlls/gdi32/clipping.c index 9229bf9..8b019c6 100644 --- a/dlls/gdi32/clipping.c +++ b/dlls/gdi32/clipping.c @@ -118,15 +118,16 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) { INT retval; RECT rect; - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); if (!dc) return ERROR; TRACE("%p %p %d\n", hdc, hrgn, fnMode ); + update_dc( dc ); if (dc->funcs->pExtSelectClipRgn) { retval = dc->funcs->pExtSelectClipRgn( dc->physDev, hrgn, fnMode ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return retval; } @@ -140,7 +141,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) else { FIXME("Unimplemented: hrgn NULL in mode: %d\n", fnMode); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ERROR; } } @@ -156,7 +157,7 @@ INT WINAPI ExtSelectClipRgn( HDC hdc, HRGN hrgn, INT fnMode ) } CLIPPING_UpdateGCRegion( dc ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return GetClipBox(hdc, &rect); } @@ -190,11 +191,12 @@ INT16 WINAPI SelectVisRgn16( HDC16 hdc16, HRGN16 hrgn ) INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y ) { INT ret = SIMPLEREGION; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return ERROR; TRACE("%p %d,%d\n", hdc, x, y ); + update_dc( dc ); if(dc->funcs->pOffsetClipRgn) { ret = dc->funcs->pOffsetClipRgn( dc->physDev, x, y ); @@ -205,7 +207,7 @@ INT WINAPI OffsetClipRgn( HDC hdc, INT x, INT y ) MulDiv( y, dc->vportExtY, dc->wndExtY ) ); CLIPPING_UpdateGCRegion( dc ); } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -217,12 +219,14 @@ INT16 WINAPI OffsetVisRgn16( HDC16 hdc16, INT16 x, INT16 y ) { INT16 retval; HDC hdc = HDC_32( hdc16 ); - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); + if (!dc) return ERROR; TRACE("%p %d,%d\n", hdc, x, y ); + update_dc( dc ); retval = OffsetRgn( dc->hVisRgn, x, y ); CLIPPING_UpdateGCRegion( dc ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return retval; } @@ -235,11 +239,12 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, { HRGN newRgn; INT ret; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return ERROR; TRACE("%p %dx%d,%dx%d\n", hdc, left, top, right, bottom ); + update_dc( dc ); if(dc->funcs->pExcludeClipRect) { ret = dc->funcs->pExcludeClipRect( dc->physDev, left, top, right, bottom ); @@ -264,7 +269,7 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, } if (ret != ERROR) CLIPPING_UpdateGCRegion( dc ); } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -275,11 +280,12 @@ INT WINAPI ExcludeClipRect( HDC hdc, INT left, INT top, INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom ) { INT ret; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return ERROR; TRACE("%p %d,%d - %d,%d\n", hdc, left, top, right, bottom ); + update_dc( dc ); if(dc->funcs->pIntersectClipRect) { ret = dc->funcs->pIntersectClipRect( dc->physDev, left, top, right, bottom ); @@ -314,7 +320,7 @@ INT WINAPI IntersectClipRect( HDC hdc, INT left, INT top, INT right, INT bottom } if (ret != ERROR) CLIPPING_UpdateGCRegion( dc ); } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -328,7 +334,7 @@ INT16 WINAPI ExcludeVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right, INT16 ret; POINT pt[2]; HDC hdc = HDC_32( hdc16 ); - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); if (!dc) return ERROR; pt[0].x = left; @@ -343,11 +349,12 @@ INT16 WINAPI ExcludeVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right, if (!(tempRgn = CreateRectRgn( pt[0].x, pt[0].y, pt[1].x, pt[1].y ))) ret = ERROR; else { + update_dc( dc ); ret = CombineRgn( dc->hVisRgn, dc->hVisRgn, tempRgn, RGN_DIFF ); DeleteObject( tempRgn ); } if (ret != ERROR) CLIPPING_UpdateGCRegion( dc ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -361,7 +368,7 @@ INT16 WINAPI IntersectVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right INT16 ret; POINT pt[2]; HDC hdc = HDC_32( hdc16 ); - DC * dc = DC_GetDCUpdate( hdc ); + DC * dc = get_dc_ptr( hdc ); if (!dc) return ERROR; pt[0].x = left; @@ -373,15 +380,15 @@ INT16 WINAPI IntersectVisRect16( HDC16 hdc16, INT16 left, INT16 top, INT16 right TRACE("%p %d,%d - %d,%d\n", hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y); - if (!(tempRgn = CreateRectRgn( pt[0].x, pt[0].y, pt[1].x, pt[1].y ))) ret = ERROR; else { + update_dc( dc ); ret = CombineRgn( dc->hVisRgn, dc->hVisRgn, tempRgn, RGN_AND ); DeleteObject( tempRgn ); } if (ret != ERROR) CLIPPING_UpdateGCRegion( dc ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -394,7 +401,7 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) POINT pt; BOOL ret; HRGN clip; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); TRACE("%p %d,%d\n", hdc, x, y ); if (!dc) return FALSE; @@ -402,9 +409,10 @@ BOOL WINAPI PtVisible( HDC hdc, INT x, INT y ) pt.x = x; pt.y = y; LPtoDP( hdc, &pt, 1 ); + update_dc( dc ); ret = PtInRegion( dc->hVisRgn, pt.x, pt.y ); if (ret && (clip = get_clip_region(dc))) ret = PtInRegion( clip, pt.x, pt.y ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -417,13 +425,14 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect ) RECT tmpRect; BOOL ret; HRGN clip; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return FALSE; TRACE("%p %d,%dx%d,%d\n", hdc, rect->left, rect->top, rect->right, rect->bottom ); tmpRect = *rect; LPtoDP( hdc, (POINT *)&tmpRect, 2 ); + update_dc( dc ); if ((clip = get_clip_region(dc))) { HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 ); @@ -432,7 +441,7 @@ BOOL WINAPI RectVisible( HDC hdc, const RECT* rect ) DeleteObject( hrgn ); } else ret = RectInRegion( dc->hVisRgn, &tmpRect ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -444,8 +453,10 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect ) { INT ret; HRGN clip; - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return ERROR; + + update_dc( dc ); if ((clip = get_clip_region(dc))) { HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 ); @@ -455,7 +466,7 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect ) } else ret = GetRgnBox( dc->hVisRgn, rect ); DPtoLP( hdc, (LPPOINT)rect, 2 ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -505,21 +516,22 @@ HRGN16 WINAPI SaveVisRgn16( HDC16 hdc16 ) { struct saved_visrgn *saved; HDC hdc = HDC_32( hdc16 ); - DC *dc = DC_GetDCUpdate( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return 0; TRACE("%p\n", hdc ); + update_dc( dc ); if (!(saved = HeapAlloc( GetProcessHeap(), 0, sizeof(*saved) ))) goto error; if (!(saved->hrgn = CreateRectRgn( 0, 0, 0, 0 ))) goto error; CombineRgn( saved->hrgn, dc->hVisRgn, 0, RGN_COPY ); saved->next = dc->saved_visrgn; dc->saved_visrgn = saved; - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return HRGN_16(saved->hrgn); error: - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); HeapFree( GetProcessHeap(), 0, saved ); return 0; } @@ -569,7 +581,7 @@ INT16 WINAPI RestoreVisRgn16( HDC16 hdc16 ) INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, INT iCode) { HRGN rgn; - DC *dc = DC_GetDCPtr( hDC ); + DC *dc = get_dc_ptr( hDC ); if (!dc) return -1; @@ -587,15 +599,16 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, INT iCode) if(!rgn) rgn = dc->hMetaRgn; break; case SYSRGN: /* == 4 */ + update_dc( dc ); rgn = dc->hVisRgn; break; default: WARN("Unknown code %d\n", iCode); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return -1; } if (rgn) CombineRgn( hRgn, rgn, 0, RGN_COPY ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); /* On Windows NT/2000, the SYSRGN returned is in screen coordinates */ if (iCode == SYSRGN && !(GetVersion() & 0x80000000))
1
0
0
0
Chris Robinson : wgl: Store the fbconfig id with the window when a pixel format is set.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: d9571c9e6fa0b8f255815c5128c2859348ea70e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d9571c9e6fa0b8f255815c512…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Sat Sep 15 13:02:32 2007 -0700 wgl: Store the fbconfig id with the window when a pixel format is set. --- dlls/opengl32/tests/opengl.c | 25 +++++++++++++++++++++++++ dlls/winex11.drv/dce.c | 7 +++++++ dlls/winex11.drv/event.c | 2 ++ dlls/winex11.drv/init.c | 1 + dlls/winex11.drv/opengl.c | 35 +++++++++++++++++++++++++++++++++++ dlls/winex11.drv/window.c | 32 ++++++++++++++++++++++++++++++++ dlls/winex11.drv/x11drv.h | 9 ++++++++- 7 files changed, 110 insertions(+), 1 deletions(-) diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 268bece..2d08cfb 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -294,6 +294,29 @@ static void test_make_current_read(HDC hdc) ok(hread == hdc, "wglGetCurrentReadDCARB failed for wglMakeContextCurrent\n"); } +static void test_dc(HWND hwnd, HDC hdc) +{ + int pf1, pf2; + HDC hdc2; + + /* Get another DC and make sure it has the same pixel format */ + hdc2 = GetDC(hwnd); + if(hdc != hdc2) + { + pf1 = GetPixelFormat(hdc); + pf2 = GetPixelFormat(hdc2); + ok(pf1 == pf2, "Second DC does not have the same format (%d != %d)\n", pf1, pf2); + } + else + skip("Could not get a different DC for the window\n"); + + if(hdc2) + { + ReleaseDC(hwnd, hdc2); + hdc2 = NULL; + } +} + START_TEST(opengl) { HWND hwnd; @@ -336,6 +359,8 @@ START_TEST(opengl) res = SetPixelFormat(hdc, iPixelFormat, &pfd); ok(res, "SetPixelformat failed: %x\n", GetLastError()); + test_dc(hwnd, hdc); + hglrc = wglCreateContext(hdc); res = wglMakeCurrent(hdc, hglrc); ok(res, "wglMakeCurrent failed!\n"); diff --git a/dlls/winex11.drv/dce.c b/dlls/winex11.drv/dce.c index 72c5429..aa37a4a 100644 --- a/dlls/winex11.drv/dce.c +++ b/dlls/winex11.drv/dce.c @@ -148,9 +148,15 @@ static void update_visible_region( struct dce *dce ) if (top == dce->hwnd && ((data = X11DRV_get_win_data( dce->hwnd )) != NULL) && IsIconic( dce->hwnd ) && data->icon_window) + { escape.drawable = data->icon_window; + escape.fbconfig_id = 0; + } else + { escape.drawable = X11DRV_get_whole_window( top ); + escape.fbconfig_id = X11DRV_get_fbconfig_id( dce->hwnd ); + } escape.code = X11DRV_SET_DRAWABLE; escape.mode = IncludeInferiors; @@ -185,6 +191,7 @@ static void release_dce( struct dce *dce ) escape.drawable_rect = virtual_screen_rect; SetRect( &escape.dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left, virtual_screen_rect.bottom - virtual_screen_rect.top ); + escape.fbconfig_id = 0; ExtEscape( dce->hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); } diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index f3010de..d06ade8 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -958,6 +958,8 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) return X11DRV_AcquireClipboard( hwnd ); case WM_X11DRV_DELETE_WINDOW: return SendMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 ); + case WM_X11DRV_SET_WIN_FORMAT: + return X11DRV_set_win_format( hwnd, (XID)wp ); default: FIXME( "got window msg %x hwnd %p wp %lx lp %lx\n", msg, hwnd, wp, lp ); return 0; diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 4bb44f2..0946257 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -340,6 +340,7 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID physDev->dc_rect = data->dc_rect; physDev->drawable = data->drawable; physDev->drawable_rect = data->drawable_rect; + physDev->current_pf = pixelformat_from_fbconfig_id( data->fbconfig_id ); wine_tsx11_lock(); XSetSubwindowMode( gdi_display, physDev->gc, data->mode ); wine_tsx11_unlock(); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 156a574..fc33143 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -935,6 +935,20 @@ static WineGLPixelFormat* ConvertPixelFormatGLXtoWGL(Display *display, int fmt_i return NULL; } +int pixelformat_from_fbconfig_id(XID fbconfig_id) +{ + WineGLPixelFormat *fmt; + + if (!fbconfig_id) return 0; + + fmt = ConvertPixelFormatGLXtoWGL(gdi_display, fbconfig_id); + if(fmt) + return fmt->iPixelFormat; + /* This will happen on hwnds without a pixel format set; it's ok */ + return 0; +} + + /** * X11DRV_ChoosePixelFormat * @@ -1349,6 +1363,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, const PIXELFORMATDESCRIPTOR *ppfd) { WineGLPixelFormat *fmt; int value; + HWND hwnd; TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd); @@ -1371,6 +1386,21 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, return 0; } + pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_DRAWABLE_TYPE, &value); + + hwnd = WindowFromDC(physDev->hdc); + if(hwnd) { + if(!(value&GLX_WINDOW_BIT)) { + WARN("Pixel format %d is not compatible for window rendering\n", iPixelFormat); + return 0; + } + + if(!SendMessageW(hwnd, WM_X11DRV_SET_WIN_FORMAT, (WPARAM)fmt->fmt_id, 0)) { + ERR("Couldn't set format of the window, returning failure\n"); + return 0; + } + } + physDev->current_pf = iPixelFormat; if (TRACE_ON(opengl)) { @@ -3345,6 +3375,11 @@ XVisualInfo *X11DRV_setup_opengl_visual( Display *display ) #else /* no OpenGL includes */ +int pixelformat_from_fbconfig_id(XID fbconfig_id) +{ + return 0; +} + /*********************************************************************** * ChoosePixelFormat (X11DRV.@) */ diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e55fcfd..b0a7460 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -55,6 +55,7 @@ static XContext win_data_context; static const char whole_window_prop[] = "__wine_x11_whole_window"; static const char icon_window_prop[] = "__wine_x11_icon_window"; +static const char fbconfig_id_prop[] = "__wine_x11_fbconfig_id"; static const char managed_prop[] = "__wine_x11_managed"; static const char visual_id_prop[] = "__wine_x11_visual_id"; @@ -166,6 +167,21 @@ void X11DRV_sync_window_style( Display *display, struct x11drv_win_data *data ) /*********************************************************************** + * X11DRV_set_win_format + */ +BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id ) +{ + struct x11drv_win_data *data; + + if (!(data = X11DRV_get_win_data(hwnd))) return FALSE; + + data->fbconfig_id = fbconfig_id; + SetPropA(hwnd, fbconfig_id_prop, (HANDLE)data->fbconfig_id); + return TRUE; +} + + +/*********************************************************************** * get_window_changes * * fill the window changes structure @@ -937,6 +953,7 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd ) data->hwnd = hwnd; data->whole_window = 0; data->icon_window = 0; + data->fbconfig_id = 0; data->xic = 0; data->managed = FALSE; data->dce = NULL; @@ -1229,6 +1246,21 @@ Window X11DRV_get_whole_window( HWND hwnd ) /*********************************************************************** + * X11DRV_get_fbconfig_id + * + * Return the GLXFBConfig ID of the drawable used by the window for + * OpenGL rendering. This is 0 for windows without a pixel format set. + */ +XID X11DRV_get_fbconfig_id( HWND hwnd ) +{ + struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); + + if (!data) return (XID)GetPropA( hwnd, fbconfig_id_prop ); + return data->fbconfig_id; +} + + +/*********************************************************************** * X11DRV_get_ic * * Return the X input context associated with a window diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1583411..f61dc98 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -485,6 +485,7 @@ struct x11drv_escape_set_drawable int mode; /* ClipByChildren or IncludeInferiors */ RECT dc_rect; /* DC rectangle relative to drawable */ RECT drawable_rect;/* Drawable rectangle relative to screen */ + XID fbconfig_id; /* fbconfig id used by the GL drawable */ }; struct x11drv_escape_set_dce @@ -633,7 +634,8 @@ extern DWORD EVENT_x11_time_to_win32_time(Time time); enum x11drv_window_messages { WM_X11DRV_ACQUIRE_SELECTION = 0x80001000, - WM_X11DRV_DELETE_WINDOW + WM_X11DRV_DELETE_WINDOW, + WM_X11DRV_SET_WIN_FORMAT }; /* x11drv private window data */ @@ -642,6 +644,7 @@ struct x11drv_win_data HWND hwnd; /* hwnd that this private data belongs to */ Window whole_window; /* X window for the complete window */ Window icon_window; /* X window for the icon */ + XID fbconfig_id; /* fbconfig id for the GL drawable this hwnd uses */ RECT window_rect; /* USER window rectangle relative to parent */ RECT whole_rect; /* X window rectangle for the whole window relative to parent */ RECT client_rect; /* client area relative to whole window */ @@ -656,8 +659,12 @@ struct x11drv_win_data extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ); extern Window X11DRV_get_whole_window( HWND hwnd ); +extern XID X11DRV_get_fbconfig_id( HWND hwnd ); extern BOOL X11DRV_is_window_rect_mapped( const RECT *rect ); extern XIC X11DRV_get_ic( HWND hwnd ); +extern BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig ); + +extern int pixelformat_from_fbconfig_id( XID fbconfig_id ); extern void alloc_window_dce( struct x11drv_win_data *data ); extern void free_window_dce( struct x11drv_win_data *data );
1
0
0
0
Chris Robinson : gdi32: Don' t hold the GDI lock when setting the pixel format.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 09c76ffbdcb802e1823cbb78aa982947ba41f970 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09c76ffbdcb802e1823cbb78a…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Sep 11 17:24:55 2007 -0700 gdi32: Don't hold the GDI lock when setting the pixel format. --- dlls/gdi32/painting.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 473f628..22912cc 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -351,7 +351,7 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { INT bRet = FALSE; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); TRACE("(%p,%d,%p)\n",hdc,iPixelFormat,ppfd); @@ -360,7 +360,7 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat, if (!dc->funcs->pSetPixelFormat) FIXME(" :stub\n"); else bRet = dc->funcs->pSetPixelFormat(dc->physDev,iPixelFormat,ppfd); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return bRet; }
1
0
0
0
Alexandre Julliard : itss/tests: We can now store binary files in the repository.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 14395a509a42b313c4a81037c18459401aee6e3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=14395a509a42b313c4a81037c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:15:26 2007 +0200 itss/tests: We can now store binary files in the repository. --- .gitignore | 1 - dlls/itss/tests/Makefile.in | 2 - dlls/itss/tests/data.chm | Bin 0 -> 10226 bytes dlls/itss/tests/rsrc.rc | 644 +------------------------------------------ 4 files changed, 1 insertions(+), 646 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=14395a509a42b313c4a81…
1
0
0
0
Alexandre Julliard : user32/tests: We can now store binary files in the repository.
by Alexandre Julliard
18 Sep '07
18 Sep '07
Module: wine Branch: master Commit: 2018b18638a7c5b6d5d64f2f83e7f8b66058bd5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2018b18638a7c5b6d5d64f2f8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Sep 17 16:12:03 2007 +0200 user32/tests: We can now store binary files in the repository. --- .gitignore | 1 - dlls/user32/tests/Makefile.in | 4 ---- dlls/user32/tests/resource.rc | 9 +-------- dlls/user32/tests/test_mono.bmp | Bin 0 -> 66 bytes 4 files changed, 1 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 97b7807..c55992b 100644 --- a/.gitignore +++ b/.gitignore @@ -464,7 +464,6 @@ dlls/user32/resources/user32.res dlls/user32/resources/version16.res dlls/user32/tests/*.ok dlls/user32/tests/resource.res -dlls/user32/tests/test_mono.bmp dlls/user32/tests/testlist.c dlls/user32/tests/user32_crosstest.exe dlls/usp10/libusp10.def diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 40fec5b..9fd26ec 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -30,10 +30,6 @@ CTESTS = \ RC_SRCS = resource.rc -RC_BINSRC = resource.rc -RC_BINARIES = \ - test_mono.bmp - @MAKE_TEST_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/user32/tests/resource.rc b/dlls/user32/tests/resource.rc index c2d5c30..31ec68f 100644 --- a/dlls/user32/tests/resource.rc +++ b/dlls/user32/tests/resource.rc @@ -97,15 +97,8 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14 END -/* BINRES test_mono.bmp */ +/* @makedep: test_mono.bmp */ 100 BITMAP test_mono.bmp -/* { - '42 4D 42 00 00 00 00 00 00 00 3E 00 00 00 28 00' - '00 00 02 00 00 00 01 00 00 00 01 00 01 00 00 00' - '00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00' - '00 00 00 00 00 00 00 00 00 00 FF FF FF 00 40 00' - '00 00' -} */ 1 MENU { diff --git a/dlls/user32/tests/test_mono.bmp b/dlls/user32/tests/test_mono.bmp new file mode 100644 index 0000000..0db4d81 Binary files /dev/null and b/dlls/user32/tests/test_mono.bmp differ
1
0
0
0
← Newer
1
...
41
42
43
44
45
46
47
...
79
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Results per page:
10
25
50
100
200