AmoxT
2010-Jun-16 09:59 UTC
[Wine] Poor performance while drawing text input fields and buttons
Poor performance while drawing text input fields and buttons with GDI commands using winex11.drv Hello, I have noticed that an application compiled under wnidows that makes extensive use of GDI drawing commands, even when it is run in the latest 1.2rc3 vesion of wine, shows a slow down while drawing a window with a lot of buttons and text input fields. I have tried to do verbose debug of the application with the command"WINEDEBUG=+relay wine App.exe" and the result was that I saw a huge amount of ntdll.RtlEnterCriticalSection() and ntdll.RtlLeaveCriticalSection(). These calls were made while drawing the graphical elements, so I have commented out the following rows in the file winex11.drv/x11drv_main.c: void CDECL wine_tsx11_lock(void) { // EnterCriticalSection( &X11DRV_CritSection ); } void CDECL wine_tsx11_unlock(void) { // LeaveCriticalSection( &X11DRV_CritSection ); } After this I have compiled and installed wine 1.2rc3 and I am going to test the drawing performance of App.exe with this modified version of wine. Is this a good solution or maybe there are other solutions that I should try in order to speed-up the drawing of buttons and text input fields with winex11.drv? Thanks in advance, Amox
arquitecto
2010-Jun-16 10:44 UTC
[Wine] Re: Poor performance while drawing text input fields and buttons
I think this is the same problem that is happening with me. http://forum.winehq.org/viewtopic.php?t=8697 My windows app makes use of wingdi wich is the same that is causing troubles with you.
AmoxT
2010-Jun-16 13:06 UTC
[Wine] Re: Poor performance while drawing text input fields and buttons
Well, actually the removal of enter/leave for the critical sections was not of any use... I achieved no speedup. The drawing of the buttons and of the text input field seems to be slow because of the following calls: 0009:Call gdi32.SetBkColor(00000250,00c8d0d4) ret=004327f3 0009:Ret gdi32.SetBkColor() retval=00ffffff ret=004327f3 0009:Call gdi32.SetTextColor(00000250,00000000) ret=004327d9 0009:Ret gdi32.SetTextColor() retval=00000000 ret=004327d9 0009:Call gdi32.SetBkColor(00000250,00ffffff) ret=004327f3 0009:Ret gdi32.SetBkColor() retval=00ffffff ret=004327f3 0009:Call gdi32.SetTextColor(00000250,00000000) ret=004327d9 0009:Ret gdi32.SetTextColor() retval=00000000 ret=004327d9 0009:Call gdi32.SetBkColor(00000250,00ffffff) ret=004327f3 0009:Ret gdi32.SetBkColor() retval=00ffffff ret=004327f3 Is it possible to reduce in any way the time that each of these spend? Thanks, Amox
AmoxT
2010-Jun-17 04:35 UTC
[Wine] Re: Poor performance while drawing text input fields and buttons
Well, actually the problem was in the file dlls/winex11.drv/bitblt.c in the function Code: /*********************************************************************** * X11DRV_StretchBlt */ BOOL CDECL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop ) because after issuing the command> WINEDEBUG=+bitblt wine ./App.exethere were a lot of trace:bitblt:X11DRV_StretchBlt rectdst=25,1 1x13 orgdst=10,10 visdst=(25,1)-(26,14) trace:bitblt:X11DRV_StretchBlt rectsrc=0,0 1x13 orgsrc=0,0 vissrc=(0,0)-(1,13) trace:bitblt:BitBlt hdcSrc=0x3ed0 0,0 -> hdcDest=0x1ec8 25,1 1x13 rop=660046 trace:bitblt:X11DRV_StretchBlt rectdst=25,1 1x13 orgdst=10,10 visdst=(25,1)-(26,14) trace:bitblt:X11DRV_StretchBlt rectsrc=0,0 1x13 orgsrc=0,0 vissrc=(0,0)-(1,13) that were synchronized with the slow display of the buttons and text input fields. Can anyone provivde me an optimized version of this function? Thanks very much Amox