[ros-diffs] [amunger] 22139: Merged win32k fixes from trunk, per GreatLord. Revisions: 21995, 22010, 22014

amunger at svn.reactos.org amunger at svn.reactos.org
Thu Jun 1 04:09:12 CEST 2006


Author: amunger
Date: Thu Jun  1 06:09:11 2006
New Revision: 22139

URL: http://svn.reactos.ru/svn/reactos?rev=22139&view=rev
Log:
Merged win32k fixes from trunk, per GreatLord.
Revisions: 21995, 22010, 22014

Modified:
    branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib16bpp.c
    branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib32bpp.c
    branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/eng/xlate.c
    branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/objects/dibobj.c

Modified: branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib16bpp.c
URL: http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib16bpp.c?rev=22139&r1=22138&r2=22139&view=diff
==============================================================================
--- branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib16bpp.c (original)
+++ branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib16bpp.c Thu Jun  1 06:09:11 2006
@@ -687,8 +687,9 @@
 									
                   sx = ((DesX * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                   color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
+                  color = XLATEOBJ_iXlate(ColorTranslation, color);
                               
-				  *DestBits = XLATEOBJ_iXlate(ColorTranslation, color);				  				  
+				  *DestBits = color;				  				  
 				   DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
@@ -713,8 +714,8 @@
 									
                   sx = ((DesX * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                   color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
-                              
-				  *DestBits = XLATEOBJ_iXlate(ColorTranslation, color);				  				  
+                  color = XLATEOBJ_iXlate(ColorTranslation, color);            
+				  *DestBits = color;				  				  
 				   DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
@@ -740,8 +741,9 @@
 									
                   sx = ((DesX * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                   color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
+                  color = XLATEOBJ_iXlate(ColorTranslation, color);
                               
-				  *DestBits = XLATEOBJ_iXlate(ColorTranslation, color);				  				  
+				  *DestBits = color;				  				  
 				   DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
@@ -766,8 +768,9 @@
 									
                   sx = ((DesX * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                   color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
+                  color = XLATEOBJ_iXlate(ColorTranslation, color);
                               
-				  *DestBits = XLATEOBJ_iXlate(ColorTranslation, color);				  				  
+				  *DestBits = color;				  				  
 				   DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);

Modified: branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib32bpp.c
URL: http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib32bpp.c?rev=22139&r1=22138&r2=22139&view=diff
==============================================================================
--- branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib32bpp.c (original)
+++ branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/dib/dib32bpp.c Thu Jun  1 06:09:11 2006
@@ -609,7 +609,8 @@
             {			
                  sx = ((DesX  * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                  color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
-                 *DestBits =  XLATEOBJ_iXlate(ColorTranslation, color);
+                 color = XLATEOBJ_iXlate(ColorTranslation, color);
+                 *DestBits =  color;
             }
             
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
@@ -633,7 +634,8 @@
             {			
                  sx = ((DesX  * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                  color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
-                 *DestBits =  XLATEOBJ_iXlate(ColorTranslation, color);
+                 color = XLATEOBJ_iXlate(ColorTranslation, color);
+                 *DestBits =  color;
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
        }	  	   		
@@ -656,7 +658,8 @@
             {			
                  sx = ((DesX  * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                  color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
-                 *DestBits =  XLATEOBJ_iXlate(ColorTranslation, color);
+                 color = XLATEOBJ_iXlate(ColorTranslation, color);
+                 *DestBits = color;
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
        }	  	   
@@ -679,7 +682,8 @@
             {			
                  sx = ((DesX  * SrcSizeX) / DesSizeX) + SourceRect->left;  		
                  color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
-                 *DestBits =  XLATEOBJ_iXlate(ColorTranslation, color);
+                 color = XLATEOBJ_iXlate(ColorTranslation, color);
+                 *DestBits =  color;
             }
             DestBits = (PULONG)((ULONG_PTR)DestBits + DifflDelta);
        }	  

Modified: branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/eng/xlate.c
URL: http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/eng/xlate.c?rev=22139&r1=22138&r2=22139&view=diff
==============================================================================
--- branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/eng/xlate.c (original)
+++ branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/eng/xlate.c Thu Jun  1 06:09:11 2006
@@ -275,10 +275,15 @@
     */
 
 end:
+  if (PaletteDest != NULL)
+     if (PaletteDest != PaletteSource)
+         if (DestPalGDI != NULL)
+              PALETTE_UnlockPalette(DestPalGDI);
+     
+      
    if (PaletteSource != NULL)
       PALETTE_UnlockPalette(SourcePalGDI);
-   if (PaletteDest != NULL && PaletteDest != PaletteSource)
-      PALETTE_UnlockPalette(DestPalGDI);
+  
    return XlateObj;
 }
 

Modified: branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/objects/dibobj.c
URL: http://svn.reactos.ru/svn/reactos/branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/objects/dibobj.c?rev=22139&r1=22138&r2=22139&view=diff
==============================================================================
--- branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/objects/dibobj.c (original)
+++ branches/ros-branch-0_3_0/reactos/subsystems/win32/win32k/objects/dibobj.c Thu Jun  1 06:09:11 2006
@@ -758,17 +758,41 @@
 {
   PDC Dc;
   HBITMAP Bmp;
-
-  Dc = DC_LockDc(hDc);
-  if (NULL == Dc)
-    {
-      SetLastWin32Error(ERROR_INVALID_HANDLE);
-      return NULL;
-    }
-
-  Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
-
-  DC_UnlockDc(Dc);
+  
+ 
+  if (NULL == hDc)
+  {            
+       hDc =  IntGdiCreateDC(NULL, NULL, NULL, NULL,FALSE);
+       if (hDc == NULL)
+       {         
+          SetLastWin32Error(ERROR_INVALID_HANDLE);
+          return NULL;
+       }
+      Dc = DC_LockDc(hDc);
+      if (Dc == NULL)
+      {  
+          NtGdiDeleteObjectApp(hDc);          
+          SetLastWin32Error(ERROR_INVALID_HANDLE);
+          return NULL;
+      }
+      
+      Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);                      
+      DC_UnlockDc(Dc);
+      NtGdiDeleteObjectApp(hDc);  
+    }
+    else
+    {
+       Dc = DC_LockDc(hDc);
+       if (Dc == NULL)
+       {                    
+          SetLastWin32Error(ERROR_INVALID_HANDLE);
+          return NULL;
+       }
+       Bmp = IntCreateDIBitmap(Dc, Header, Init, Bits, Data, ColorUse);
+       DC_UnlockDc(Dc);
+    }
+
+  
 
   return Bmp;
 }




More information about the Ros-diffs mailing list