http://bugs.winehq.org/show_bug.cgi?id=17982
Summary: PatBlt cannot draw arbitrary parallelograms based on the world transform Product: Wine Version: 1.1.18 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: winex11.drv AssignedTo: wine-bugs@winehq.org ReportedBy: madewokherd@gmail.com
Using the functions SetGraphicsMode and (Set|Modify)WorldTransform, it is possible to define an arbitrary matrix to transform all points as things are drawn to device contexts. Using this matrix, it should be possible to apply arbitrary rotation/shear effects. Thus, rectangles drawn on the hdc can be transformed into arbitrary parallelograms.
This only works on systems where GM_ADVANCED is supported (NT but not 9x, according to MSDN).
I have written a test program that demonstrates this on Windows. On Wine, it can only draw rectangles.
http://bugs.winehq.org/show_bug.cgi?id=17982
--- Comment #1 from Vincent Povirk madewokherd@gmail.com 2009-04-08 17:19:35 --- Created an attachment (id=20342) --> (http://bugs.winehq.org/attachment.cgi?id=20342) C source code of test program
http://bugs.winehq.org/show_bug.cgi?id=17982
--- Comment #2 from Vincent Povirk madewokherd@gmail.com 2009-04-08 17:20:46 --- Created an attachment (id=20343) --> (http://bugs.winehq.org/attachment.cgi?id=20343) test program compiled to a .exe file
http://bugs.winehq.org/show_bug.cgi?id=17982
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|winex11.drv |gdi32
http://bugs.winehq.org/show_bug.cgi?id=17982
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
http://bugs.winehq.org/show_bug.cgi?id=17982
--- Comment #3 from Vincent Povirk madewokherd@gmail.com 2009-04-13 11:25:38 --- I've tested using a hatch and pattern brush on Windows. The brush pattern is not transformed. So apparently PatBlt is equivalent to calling Polygon with the four corners of the rectangle.
http://bugs.winehq.org/show_bug.cgi?id=17982
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Platform|Other |x86 Ever Confirmed|0 |1 OS/Version|other |Linux
--- Comment #4 from Austin English austinenglish@gmail.com 2010-09-23 01:12:00 CDT --- Still present in wine-1.3.3-116-g32089dc.
http://bugs.winehq.org/show_bug.cgi?id=17982
--- Comment #5 from butraxz@gmail.com 2013-05-11 05:14:36 CDT --- No update for over 900 days. No download. Is this still an issue in 1.5.30 or is this abandoned ?
http://bugs.winehq.org/show_bug.cgi?id=17982
--- Comment #6 from Bruno Jesus 00cpxxx@gmail.com 2013-05-11 10:06:48 CDT --- Still in wine 1.5.30. There is a testcase keyword and it's a 200kb program attached in comment 2. Please test it yourself next time =)
https://bugs.winehq.org/show_bug.cgi?id=17982
Alexander Almaleh sashoalm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sashoalm@gmail.com
--- Comment #7 from Alexander Almaleh sashoalm@gmail.com --- Created attachment 48984 --> https://bugs.winehq.org/attachment.cgi?id=48984 Patch that makes a "naive" solution to the problem by calling Polygon() inside PatBlt()
I have a patch that "naively" substitutes PatBlt() with an appropriate call to Polygon(), which does support world transform (I set a NULL_PEN temporarily because Polygon() uses the pen while PatBlt() does not).
This fixes the behavior of PatBlt(), however it might have performance consequences, depending on whether Polygon() is optimized when drawing normal rectangles.
If anyone is interested, I can improve it to call Polygon() only when needed - it will check if the rectangle is actually going to be inclined and call Polygon() only then.
I already tested that this approach works for PatBlt(), but only when using PAT_COPY. I have not yet tested with the other ROPs.
https://bugs.winehq.org/show_bug.cgi?id=17982
IvanDSM snesivan1@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |snesivan1@gmail.com
--- Comment #8 from IvanDSM snesivan1@gmail.com --- The test program is still only able to draw black rectangles as of Wine Staging 5.0.