Author: jgardou
Date: Tue Aug 31 20:38:49 2010
New Revision: 48670
URL: 
http://svn.reactos.org/svn/reactos?rev=48670&view=rev
Log:
[WIN32K]
  - Get rid of old code, when surfaces didn't have palettes by default
Modified:
    branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Tue
Aug 31 20:38:49 2010
@@ -328,7 +328,6 @@
     PGDIOBJ apObj[2];
     RECTL rcDest, rcSrc;
     SURFACE *BitmapDest, *BitmapSrc = NULL;
-    PPALETTE PalSourceGDI;
     ULONG TransparentColor = 0;
     BOOL Ret = FALSE;
     EXLATEOBJ exlo;
@@ -394,25 +393,10 @@
         goto done;
     }
-    if (BitmapSrc->ppal)
-    {
-        GDIOBJ_IncrementShareCount(&BitmapSrc->ppal->BaseObject);
-        PalSourceGDI = BitmapSrc->ppal ;
-    }
-    else
-        PalSourceGDI = PALETTE_ShareLockPalette(pPrimarySurface->devinfo.hpalDefault)
;
-
-    if(!PalSourceGDI)
-    {
-        SetLastWin32Error(ERROR_INVALID_HANDLE);
-        goto done;
-    }
-
     /* Translate Transparent (RGB) Color to the source palette */
-    EXLATEOBJ_vInitialize(&exlo, &gpalRGB, PalSourceGDI, 0, 0, 0);
+    EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0);
     TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor);
     EXLATEOBJ_vCleanup(&exlo);
-    PALETTE_ShareUnlockPalette(PalSourceGDI);
     EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Tue
Aug 31 20:38:49 2010
@@ -430,7 +430,6 @@
     BOOL bInRect = FALSE;
     SURFACE *psurf;
     SURFOBJ *pso;
-    PPALETTE ppal;
     EXLATEOBJ exlo;
     HBITMAP hBmpTmp;
@@ -456,25 +455,8 @@
         psurf = dc->dclevel.pSurface;
         if (psurf)
         {
-            pso = &psurf->SurfObj;
-            if (psurf->ppal)
-            {
-                ppal = psurf->ppal;
-                GDIOBJ_IncrementShareCount(&ppal->BaseObject);
-            }
-            else
-                ppal = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault);
-
-            if (psurf->SurfObj.iBitmapFormat == BMF_1BPP &&
!psurf->hSecure)
-            {
-                /* FIXME: palette should be gpalMono already ! */
-                EXLATEOBJ_vInitialize(&exlo, &gpalMono, &gpalRGB, 0,
0xffffff, 0);
-            }
-            else
-            {
-                EXLATEOBJ_vInitialize(&exlo, ppal, &gpalRGB, 0, 0xffffff, 0);
-            }
-
+                       pso = &psurf->SurfObj;
+            EXLATEOBJ_vInitialize(&exlo, psurf->ppal, &gpalRGB, 0, 0xffffff,
0);
             // check if this DC has a DIB behind it...
             if (pso->pvScan0) // STYPE_BITMAP == pso->iType
             {
@@ -484,7 +466,6 @@
             }
             EXLATEOBJ_vCleanup(&exlo);
-            PALETTE_ShareUnlockPalette(ppal);
         }
     }
     DC_UnlockDc(dc);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Tue
Aug 31 20:38:49 2010
@@ -1061,7 +1061,6 @@
     PDC dc;
     PDC_ATTR   pdcattr;
     SURFACE    *psurf = NULL;
-    PPALETTE   ppal;
     EXLATEOBJ  exlo;
     BOOL       Ret = FALSE;
     RECTL      DestRect;
@@ -1106,16 +1105,7 @@
         goto cleanup;
     }
-    if (psurf->ppal)
-    {
-        ppal = psurf->ppal;
-        GDIOBJ_IncrementShareCount(&ppal->BaseObject);
-    }
-    else
-        // Destination palette obtained from the hDC
-        ppal = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault);
-
-    EXLATEOBJ_vInitialize(&exlo, &gpalRGB, ppal, 0, 0xffffff, 0);
+    EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0xffffff, 0);
     /* Only solid fills supported for now
      * How to support pattern brushes and non standard surfaces (not offering dib
functions):
@@ -1125,7 +1115,6 @@
     Ret = DIB_XXBPP_FloodFillSolid(&psurf->SurfObj,
&dc->eboFill.BrushObject, &DestRect, &Pt, ConvColor, FillType);
     EXLATEOBJ_vCleanup(&exlo);
-    PALETTE_ShareUnlockPalette(ppal);
 cleanup:
     DC_UnlockDc(dc);
Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c [iso-8859-1]
(original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Tue
Aug 31 20:38:49 2010
@@ -3173,7 +3173,6 @@
     BOOLEAN Render;
     POINT Start;
     BOOL DoBreak = FALSE;
-    PPALETTE ppalDst;
     USHORT DxShift;
     // TODO: Write test-cases to exactly match real Windows in different
@@ -3443,21 +3442,10 @@
     psurf = dc->dclevel.pSurface ;
     SurfObj = &psurf->SurfObj ;
-    /* Create the xlateobj */
-    if (psurf->ppal)
-    {
-        ppalDst = psurf->ppal;
-        GDIOBJ_IncrementShareCount(&ppalDst->BaseObject);
-    }
-    else
-        // Destination palette obtained from the hDC
-        ppalDst = PALETTE_ShareLockPalette(dc->ppdev->devinfo.hpalDefault);
-    ASSERT(ppalDst);
-    EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, ppalDst, 0, 0, 0);
-    EXLATEOBJ_vInitialize(&exloDst2RGB, ppalDst, &gpalRGB, 0, 0, 0);
-    PALETTE_ShareUnlockPalette(ppalDst);
-
-    if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ &
DIRTY_BACKGROUND))
+    EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);
+    EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0);
+
+       if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ &
DIRTY_BACKGROUND))
         DC_vUpdateBackgroundBrush(dc) ;
     if(dc->pdcattr->ulDirty_ & DIRTY_TEXT)