https://bugs.winehq.org/show_bug.cgi?id=37431
Bug ID: 37431 Summary: Incorrect handling of SetBkMode(dc, TRANSPARENT) with hatch brush Product: Wine Version: 1.6.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 Assignee: wine-bugs@winehq.org Reporter: matteo@mitalia.net Distribution: ---
Created attachment 49789 --> https://bugs.winehq.org/attachment.cgi?id=49789 Sample program
On some kind of DCs (tested: memory DCs, DC provided by BeginPaint) a hatch brush (created by CreateHatchBrush) performs fills incorrectly when setting the background mode of the DC to TRANSPARENT. The pixels that should be transparent are black instead (see attachments for example); ExtTextOut in the same conditions instead performs correctly.
Interestingly, the behavior seems to be correct when painting over the screen DC (obtained via GetDC(NULL)). The attached sample program (also at https://bitbucket.org/mitalia/hatchbrushbug/src/hatchbrushbug.cpp) demonstrates the problem.
My tests were performed with the wine 1.6.2 packages shipped with KUbuntu 14.04 x86-64; the problem is present also compiling a winelib executable with wineg++. Native works fine.
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #1 from Matteo Italia matteo@mitalia.net --- Created attachment 49790 --> https://bugs.winehq.org/attachment.cgi?id=49790 Broken output for draw on WM_PAINT DC on wine
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #2 from Matteo Italia matteo@mitalia.net --- Created attachment 49791 --> https://bugs.winehq.org/attachment.cgi?id=49791 Correct output for draw on WM_PAINT DC on wine
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #3 from Matteo Italia matteo@mitalia.net --- Created attachment 49792 --> https://bugs.winehq.org/attachment.cgi?id=49792 Correct output for draw on WM_PAINT DC on Windows
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #4 from Matteo Italia matteo@mitalia.net --- Created attachment 49793 --> https://bugs.winehq.org/attachment.cgi?id=49793 Correct output for draw on screen DC on Windows
https://bugs.winehq.org/show_bug.cgi?id=37431
Matteo Italia matteo@mitalia.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #49791|Correct output for draw on |Correct output for draw on description|WM_PAINT DC on wine |screen DC on wine
https://bugs.winehq.org/show_bug.cgi?id=37431
Matteo Italia matteo@mitalia.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Ubuntu
https://bugs.winehq.org/show_bug.cgi?id=37431
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, regression, | |source, testcase Status|UNCONFIRMED |NEW CC| |wylda@volny.cz Ever confirmed|0 |1
--- Comment #5 from Wylda wylda@volny.cz --- Confirming. I see it bad in all the following versions: * 1.7.{29,26,23,20,12,10,5,0} * 1.5.{31,20}
But works correctly under wine-1.5.10. I will try to pinpoint the commint...
https://bugs.winehq.org/show_bug.cgi?id=37431
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |julliard@winehq.org Version|1.6.2 |1.5.19 Regression SHA1| |7339308e16fa50665f1dc0312fd | |6e3432c63fe09
--- Comment #6 from Wylda wylda@volny.cz ---
Broken by commit wine-1.5.18-142-g7339308:
commit 7339308e16fa50665f1dc0312fd6e3432c63fe09 Author: Alexandre Julliard julliard@winehq.org Date: Thu Nov 29 17:59:37 2012 +0100
gdi32: Add faster implementation of the pattern_rects primitive when we don't need an AND mask.
Revert makes that problem go away.
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #7 from Wylda wylda@volny.cz --- Created attachment 49816 --> https://bugs.winehq.org/attachment.cgi?id=49816 Sample program compiled by VS2010
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #8 from Wylda wylda@volny.cz --- I didn't bother with wine-1.6.2, but it's interesting, that the one case worked for you. For me both were wrong. (ok, there are two more "opaque" cases on right mouse clicks, but there were correct in all wine versions).
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #9 from Matteo Italia matteo@mitalia.net --- I didn't check the code, but when seeing the result I thought that maybe the screen DC is "more magic" because it has to interact with X and/or the compositor in some way. If that's of any use, on all the machines where I tested the bug I use KWin as compositing window manager.
https://bugs.winehq.org/show_bug.cgi?id=37431
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |55f24da978c8ad6553a7b8fa874 | |a60648dc61e44 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- This is fixed with 55f24da978c8ad6553a7b8fa874a60648dc61e44.
https://bugs.winehq.org/show_bug.cgi?id=37431
--- Comment #11 from Matteo Italia matteo@mitalia.net --- Just tested, I can confirm that the problem has been fixed. Great work (and incredible response time), thank you!
https://bugs.winehq.org/show_bug.cgi?id=37431
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.30.