gdi32: Reselect objects into the DC only if scaling factors change

Dmitry Timoshkov dmitry at codeweavers.com
Wed Apr 23 03:24:53 CDT 2008


Hello,

while investigating various EMF related problems I noticed that XP doesn't
generate EMR_SELECTOBJECT records on every DC mapping change, but only if
the scaling actually has changed.

Changelog:
    gdi32: Reselect objects into the DC only if scaling factors change.
---
 dlls/gdi32/dc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index debbde8..cb4de19 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -315,7 +315,8 @@ void DC_UpdateXforms( DC *dc )
 
     /* Reselect the font and pen back into the dc so that the size
        gets updated. */
-    if(memcmp(&oldworld2vport, &dc->xformWorld2Vport, sizeof(oldworld2vport)))
+    if (oldworld2vport.eM11 != dc->xformWorld2Vport.eM11 ||
+        oldworld2vport.eM22 != dc->xformWorld2Vport.eM22)
     {
         SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT));
         SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_PEN));
-- 
1.5.4.5






More information about the wine-patches mailing list