[ros-diffs] [khornicek] 44253: - actually plug alpha blend in

khornicek at svn.reactos.org khornicek at svn.reactos.org
Sat Nov 21 15:11:32 CET 2009


Author: khornicek
Date: Sat Nov 21 15:11:32 2009
New Revision: 44253

URL: http://svn.reactos.org/svn/reactos?rev=44253&view=rev
Log:
- actually plug alpha blend in

Modified:
    branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c

Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c?rev=44253&r1=44252&r2=44253&view=diff
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Sat Nov 21 15:11:32 2009
@@ -25,12 +25,46 @@
 
 /* FUNCTIONS **************************************************************/
 
-BOOL CDECL RosDrv_AlphaBlend(NTDRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst, INT heightDst,
-                             NTDRV_PDEVICE *devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc,
+BOOL CDECL RosDrv_AlphaBlend(NTDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst,
+                             NTDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc,
                              BLENDFUNCTION blendfn)
 {
-    UNIMPLEMENTED;
-    return FALSE;
+    POINT pts[2], ptBrush;
+
+    /* map source coordinates */
+    if (physDevSrc)
+    {
+        pts[0].x = xSrc;
+        pts[0].y = ySrc;
+        pts[1].x = xSrc + widthSrc;
+        pts[1].y = ySrc + heightSrc;
+
+        LPtoDP(physDevSrc->hUserDC, pts, 2);
+        widthSrc = pts[1].x - pts[0].x;
+        heightSrc = pts[1].y - pts[0].y;
+        xSrc = pts[0].x;
+        ySrc = pts[0].y;
+    }
+
+    /* map dest coordinates */
+    pts[0].x = xDst;
+    pts[0].y = yDst;
+    pts[1].x = xDst + widthDst;
+    pts[1].y = yDst + heightDst;
+
+    LPtoDP(physDevDst->hUserDC, pts, 2);
+    widthDst = pts[1].x - pts[0].x;
+    heightDst = pts[1].y - pts[0].y;
+    xDst = pts[0].x;
+    yDst = pts[0].y;
+
+    /* Update brush origin */
+    GetBrushOrgEx(physDevDst->hUserDC, &ptBrush);
+    RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y);
+
+    return RosGdiAlphaBlend(physDevDst->hKernelDC, xDst, yDst, widthDst, heightDst,
+        physDevSrc->hKernelDC, xSrc, ySrc, widthSrc, heightSrc, blendfn);
+
 }
 
 BOOL CDECL RosDrv_Arc( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,




More information about the Ros-diffs mailing list