Author: gschneider
Date: Fri Dec 25 18:54:41 2009
New Revision: 44761
URL:
http://svn.reactos.org/svn/reactos?rev=44761&view=rev
Log:
[win32k]
- IntGetDIBColorTable: return the number of actually copied color table entries
- DIB_CreateDIBSection: simplify calculation of palette entry count
- IntHandleSpecialColorType: remove leftover debug print
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Fri Dec 25
18:54:41 2009
@@ -681,10 +681,6 @@
if (IntGetPaletteEntries(pdc->dclevel.hpal, index, 1, &palEntry) ==
1)
{
*Color = RGB(palEntry.peRed, palEntry.peGreen, palEntry.peBlue);
- }
- else
- {
- DPRINT1("no wai!\n");
}
DC_UnlockDc(pdc);
break;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Fri Dec 25
18:54:41 2009
@@ -149,7 +149,7 @@
PDC dc;
PSURFACE psurf;
PPALETTE PalGDI;
- UINT Index;
+ UINT Index, Count = 0;
ULONG biBitCount;
if (!(dc = DC_LockDc(hDC))) return 0;
@@ -197,15 +197,14 @@
Colors[Index - StartIndex].rgbGreen =
PalGDI->IndexedColors[Index].peGreen;
Colors[Index - StartIndex].rgbBlue = PalGDI->IndexedColors[Index].peBlue;
Colors[Index - StartIndex].rgbReserved = 0;
+ Count++;
}
PALETTE_UnlockPalette(PalGDI);
}
- else
- Entries = 0;
DC_UnlockDc(dc);
- return Entries;
+ return Count;
}
// Converts a DIB to a device-dependent bitmap
@@ -1509,17 +1508,14 @@
table between the DIB and the X physical device. Obviously,
this is left out of the ReactOS implementation. Instead,
we call NtGdiSetDIBColorTable. */
- bi->biClrUsed = 0;
- /* set number of entries in bmi.bmiColors table */
- if (bi->biBitCount == 1) {
- bi->biClrUsed = 2;
- } else
- if (bi->biBitCount == 4) {
- bi->biClrUsed = 16;
- } else
- if (bi->biBitCount == 8) {
- bi->biClrUsed = 256;
- }
+ if (bi->biBitCount <= 8)
+ {
+ bi->biClrUsed = 1 << bi->biBitCount;
+ }
+ else
+ {
+ bi->biClrUsed = 0;
+ }
bmp->hDIBSection = section;
bmp->hSecure = hSecure;