http://bugs.winehq.org/show_bug.cgi?id=20145
Summary: DrawIconEx() doesn't draw 1 bpp monochrome Icons correctly Product: Wine Version: 1.1.29 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: wilfried.pasquazzo@gmail.com
Created an attachment (id=23728) --> (http://bugs.winehq.org/attachment.cgi?id=23728) Test program to show differences between drawing 1 bpp icons in DrawIcon() and DrawIconEx()
The function DrawIconEx() doesn't handle Icons with 1 bpp correctly.
I've attached a test program that will draw many different icons in a line with DrawIcon() and the same line of icons below with DrawIconEx() and DI_DEFAULTSIZE, DI_NORMAL, DI_COMPAT flags set - which should normally result in the exact same output.
The drawn icons are (fltr):
1 bpp 2x2 "chessboard" field 32 bpp white, black, red, green, blue icons without alpha channel 32 bpp white, black, red, green, blue icons with increasing values of alpha
This works fine in WindowsXP with 32-bit color depth (I'll attach a screenshot later). In Wine the 1 bpp icon is distorted/squeezed, the 32-bit icons are however drawn correct.
I'll search where the handling of 1 bpp icons differs in those two functions and fix DrawIconEx() accordingly.
When this is fixed, the DrawIcon-Function could just call DrawIconEx with DI_DEFAULTSIZE, DI_NORMAL, DI_COMPAT flags (as suggested in http://msdn.microsoft.com/en-us/library/ms648065(VS.85).aspx and done by the test application) and therefore a lot of complicated, duplicated code could be removed from "dlls/user32/cursoricon.c".
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #1 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-09-24 09:36:49 --- Created an attachment (id=23729) --> (http://bugs.winehq.org/attachment.cgi?id=23729) Screenshot of test app in WinXp (32-bit color depth)
A Screenshot of the Test App in WinXP SP2. As can be seen, every line of icons looks the same.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #2 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-09-24 09:41:10 --- Created an attachment (id=23730) --> (http://bugs.winehq.org/attachment.cgi?id=23730) Screenshot of test app in Wine
The second line of Icons is identical to the first, except for the chessboard 1 bpp icon, that is squeezed vertically.
http://bugs.winehq.org/show_bug.cgi?id=20145
Wilfried Pasquazzo wilfried.pasquazzo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=20145
Wilfried Pasquazzo wilfried.pasquazzo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #3 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-09-24 10:38:32 --- I think I found the problem. The branching logic in DrawIconEx made 1 bpp Icons end up in a path with a DIBSection (that is intended for drawing offscreen with alpha) instead of a "normal" Bitmap as source for blitting.
I don't have time to submit a clean patch before this weekend, but that shouldn't be a problem, as this is just a minor annoyance.
http://bugs.winehq.org/show_bug.cgi?id=20145
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #23728|application/octet-stream |text/plain mime type| |
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #4 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-09-25 12:18:02 --- Created an attachment (id=23744) --> (http://bugs.winehq.org/attachment.cgi?id=23744) Patch for correct handling of 1 bpp Icons in DrawIconEx
Sent this patch plus 3 additional improvements for DrawIconEx() to wine-patch mailing list.
http://bugs.winehq.org/show_bug.cgi?id=20145
Gabriele Moabiti gabmoa@yahoo.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gabmoa@yahoo.it
--- Comment #5 from Gabriele Moabiti gabmoa@yahoo.it 2009-11-14 07:59:01 --- patch is (are) not accepted?
http://bugs.winehq.org/show_bug.cgi?id=20145
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wylda@volny.cz
--- Comment #6 from Wylda wylda@volny.cz 2009-11-16 18:54:18 --- (In reply to comment #0)
Created an attachment (id=23728)
--> (http://bugs.winehq.org/attachment.cgi?id=23728) [details]
Test program to show differences between drawing 1 bpp icons in DrawIcon() and DrawIconEx()
Could you please attach your test program also as .EXE so i can test it too? Thank you.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #7 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-11-17 12:55:50 --- Created an attachment (id=24808) --> (http://bugs.winehq.org/attachment.cgi?id=24808) Compiled icontest2.c
Here is the compiled icontest2.c program.
Bug still present in current git version.
Previous patch was not accepted, didn't get feedback on it. Likely because there seems to be no "real" application that exposes this bug. I only stumbled over it while fixing a different icon-related bug.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #8 from Wylda wylda@volny.cz 2009-11-17 18:16:55 ---
Confirming, patch in comment #4 _WORKS_ and cleanly applies to current git (wine-1.1.33-150-g4990ca0).
Please keep sending till somebody notice that and you receive an answer:
a. Thank you for contribution...
b. Good, but please divide in smaller parts etc.
c. Stop sending that everyday, we will never accept that (hopefully this won't happen)
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #9 from Vitaliy Margolen vitaliy@kievinfo.com 2009-11-17 23:31:34 --- Patches are not being picked up from bugzilla. Please send all patch to wine-patches@winehq.org mailing list.
http://bugs.winehq.org/show_bug.cgi?id=20145
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #10 from Wylda wylda@volny.cz 2009-11-20 00:30:22 ---
Hmmm... I see still not fixed in 1.1.33-259-g7782ebe. Did you send that patch to wine-patches@winehq.org mailing list, Wilfried?
http://bugs.winehq.org/show_bug.cgi?id=20145
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #11 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-11-20 09:05:45 --- Sorry for the long response times.
No, I didn't resend the patch yet, because I first wanted to search a bit more what the actual bug for this bad drawing of the icon is, instead of just avoiding the faulty part of the program that triggers it.
The problem is clearly related to the memcpy() between from the icons bitmap to the DIBSection. It seems that the DIBSection requires each line of the image to be at least 32 bit big, even if it is set to 1 bpp. The 1 bpp icon is however only aligned to 16 bit. Therefore the DIBSection simply ignored every other line of the icon when blitting, "thinking" those lines were just padding.
This problem therefore occurs only for small icons with very low bpp, like the 8x8 1 bpp icon used in the test program. 32-bit icons are always aligned anyway.
I'll write a new patch that directly targets this problematic line with memcpy().
http://bugs.winehq.org/show_bug.cgi?id=20145
Wilfried Pasquazzo wilfried.pasquazzo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #23744|0 |1 is obsolete| |
--- Comment #12 from Wilfried Pasquazzo wilfried.pasquazzo@gmail.com 2009-11-21 09:35:48 --- Created an attachment (id=24879) --> (http://bugs.winehq.org/attachment.cgi?id=24879) New version of the patch, that changes less for the same effect
Sent to wine-patches mailing list.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #13 from Wylda wylda@volny.cz 2009-12-18 07:23:29 ---
Still not fixed in 1.1.34 nor in 1.1.34-588-g6b78e24. What's up, patch was rejected or what Wilfried?
http://bugs.winehq.org/show_bug.cgi?id=20145
Nicolas Le Cam niko.lecam@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |niko.lecam@gmail.com
--- Comment #14 from Nicolas Le Cam niko.lecam@gmail.com 2009-12-22 04:33:10 --- Patch is marked pending [1] which means : * The patch is not obviously correct at first glance. Making a more convincing argument, preferably in the form of a test case, may help. * Waiting for feedback from the main developer in that area.
A test case would certainly help.
[1] http://source.winehq.org/patches/
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #15 from Wylda wylda@volny.cz 2010-01-05 16:32:12 ---
Still not fixed in wine-1.1.35-439-g2f529c3.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #16 from Wylda wylda@volny.cz 2010-02-27 16:02:46 ---
Still not fixed in wine-1.1.39-163-g583f0f0.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #17 from Wylda wylda@volny.cz 2010-03-06 23:54:50 ---
Still not fixed in wine-1.1.40.
http://bugs.winehq.org/show_bug.cgi?id=20145
--- Comment #18 from Wylda wylda@volny.cz 2010-03-19 16:03:11 ---
Still not fixed in wine-1.1.41, even if here is a patch which fixed it...
http://bugs.winehq.org/show_bug.cgi?id=20145
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #19 from Wylda wylda@volny.cz 2010-06-20 00:23:42 ---
Fixed in wine-1.2-rc4.
Particular commit (wine-1.1.43-611-ga59d79c): http://source.winehq.org/git/wine.git/?a=commit;h=a59d79c9a6ce3b9cd1acb88617...
http://bugs.winehq.org/show_bug.cgi?id=20145
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #20 from Alexandre Julliard julliard@winehq.org 2010-06-25 12:41:15 --- Closing bugs fixed in 1.2-rc5.