Author: tkreuzer
Date: Sat May 12 20:42:22 2012
New Revision: 56568
URL:
http://svn.reactos.org/svn/reactos?rev=56568&view=rev
Log:
[WIN32K]
Move SURFACE_iCompression to surface.c and implement SURFACE_vSetPalette
Modified:
branches/dib_rewrite/win32ss/gdi/eng/surface.c
branches/dib_rewrite/win32ss/gdi/eng/surface.h
branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c
Modified: branches/dib_rewrite/win32ss/gdi/eng/surface.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/sur…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/surface.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/surface.c [iso-8859-1] Sat May 12 20:42:22 2012
@@ -273,6 +273,25 @@
return psurf;
}
+ULONG
+NTAPI
+SURFACE_iCompression(
+ _In_ PSURFACE psurf)
+{
+ /* Check what compression the surface has */
+ if (psurf->SurfObj.iBitmapFormat == BMF_4RLE) return BI_RLE4;
+ if (psurf->SurfObj.iBitmapFormat == BMF_8RLE) return BI_RLE8;
+ if (psurf->SurfObj.iBitmapFormat == BMF_JPEG) return BI_JPEG;
+ if (psurf->SurfObj.iBitmapFormat == BMF_PNG) return BI_PNG;
+
+ /* Check the type of the palette */
+ if (psurf->ppal->flFlags & (PAL_INDEXED|PAL_BGR|PAL_RGB16_555))
+ return BI_RGB;
+
+ /* Everything else must be bitfields */
+ return BI_BITFIELDS;
+}
+
HBITMAP
APIENTRY
EngCreateBitmap(
Modified: branches/dib_rewrite/win32ss/gdi/eng/surface.h
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/eng/sur…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/eng/surface.h [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/eng/surface.h [iso-8859-1] Sat May 12 20:42:22 2012
@@ -123,3 +123,20 @@
_In_ ULONG fjBitmap,
_In_opt_ ULONG cjWidth,
_In_opt_ PVOID pvBits);
+
+ULONG
+NTAPI
+SURFACE_iCompression(
+ _In_ PSURFACE psurf);
+
+VOID
+FORCEINLINE
+SURFACE_vSetPalette(
+ _In_ PSURFACE psurf,
+ _In_ PPALETTE ppal)
+{
+ /* Dereference the old and set the new palette */
+ GDIOBJ_vDereferenceObject((POBJ)psurf->ppal);
+ psurf->ppal = ppal;
+}
+
Modified: branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/ntgdi/d…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/ntgdi/dibitmap.c [iso-8859-1] Sat May 12 20:42:22
2012
@@ -665,24 +665,6 @@
return hbmp;
}
-ULONG
-SURFACE_iCompression(
- _In_ PSURFACE psurf)
-{
- /* Check what compression the surface has */
- if (psurf->SurfObj.iBitmapFormat == BMF_4RLE) return BI_RLE4;
- if (psurf->SurfObj.iBitmapFormat == BMF_8RLE) return BI_RLE8;
- if (psurf->SurfObj.iBitmapFormat == BMF_JPEG) return BI_JPEG;
- if (psurf->SurfObj.iBitmapFormat == BMF_PNG) return BI_PNG;
-
- /* Check the type of the palette */
- if (psurf->ppal->flFlags & (PAL_INDEXED|PAL_BGR|PAL_RGB16_555))
- return BI_RGB;
-
- /* Everything else must be bitfields */
- return BI_BITFIELDS;
-}
-
INT
APIENTRY
GreGetDIBitmapInfo(
@@ -821,7 +803,7 @@
pjSrc = psurf->SurfObj.pvScan0;
pjSrc += iStartScan * psurf->SurfObj.lDelta;
- /* Save number of scan lines being copied */
+ /* Save number of copied scans */
iResult = cScans;
/* Loop all scan lines */