Alexandre Julliard : winex11: Copy the existing surface bits when a dirty rectangle is specified in UpdateLayeredWindow .

Alexandre Julliard julliard at winehq.org
Wed Oct 3 13:20:34 CDT 2012


Module: wine
Branch: master
Commit: dbff4f422c943a837f0098e921f831eb4a94ac11
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dbff4f422c943a837f0098e921f831eb4a94ac11

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Oct  3 00:08:30 2012 +0200

winex11: Copy the existing surface bits when a dirty rectangle is specified in UpdateLayeredWindow.

---

 dlls/winex11.drv/window.c |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 5d7e315..ad18eff 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2398,17 +2398,26 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO
     if (!(hdc = CreateCompatibleDC( 0 ))) goto done;
 
     SelectObject( hdc, dib );
-    if (!(ret = GdiAlphaBlend( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
-                               info->hdcSrc,
-                               rect.left + (info->pptSrc ? info->pptSrc->x : 0),
-                               rect.top + (info->pptSrc ? info->pptSrc->y : 0),
-                               rect.right - rect.left, rect.bottom - rect.top,
-                               (info->dwFlags & ULW_ALPHA) ? *info->pblend : blend )))
-        goto done;
 
     surface->funcs->lock( surface );
-    memcpy( dst_bits, src_bits, bmi->bmiHeader.biSizeImage );
-    add_bounds_rect( surface->funcs->get_bounds( surface ), &rect );
+
+    if (info->prcDirty)
+    {
+        memcpy( src_bits, dst_bits, bmi->bmiHeader.biSizeImage );
+        PatBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS );
+    }
+    ret = GdiAlphaBlend( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
+                         info->hdcSrc,
+                         rect.left + (info->pptSrc ? info->pptSrc->x : 0),
+                         rect.top + (info->pptSrc ? info->pptSrc->y : 0),
+                         rect.right - rect.left, rect.bottom - rect.top,
+                         (info->dwFlags & ULW_ALPHA) ? *info->pblend : blend );
+    if (ret)
+    {
+        memcpy( dst_bits, src_bits, bmi->bmiHeader.biSizeImage );
+        add_bounds_rect( surface->funcs->get_bounds( surface ), &rect );
+    }
+
     surface->funcs->unlock( surface );
     surface->funcs->flush( surface );
 




More information about the wine-cvs mailing list