Author: tkreuzer
Date: Mon Feb 28 00:19:32 2011
New Revision: 50931
URL:
http://svn.reactos.org/svn/reactos?rev=50931&view=rev
Log:
[GDI32]
Revert r50519 and r50519
Modified:
trunk/reactos/dll/win32/gdi32/objects/bitmap.c
Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bi…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] Mon Feb 28 00:19:32 2011
@@ -410,35 +410,6 @@
return CreateDIBSection(hDC, (CONST BITMAPINFO *)&dibs.dsBmih, 0, NULL, NULL,
0);
}
-void
-ConvertBackBitmapInfo(PBITMAPINFO pbmi, PBITMAPINFO pbmiConverted)
-{
- INT i;
-
- /* Check if we converted from PBITMAPCOREINFO */
- if (pbmiConverted != pbmi)
- {
- PBITMAPCOREINFO pbci = (PBITMAPCOREINFO)pbmi;
-
- /* Convert back header */
- pbci->bmciHeader.bcSize = sizeof(BITMAPCOREHEADER);
- pbci->bmciHeader.bcWidth = pbmiConverted->bmiHeader.biWidth;
- pbci->bmciHeader.bcHeight = pbmiConverted->bmiHeader.biHeight;
- pbci->bmciHeader.bcPlanes = 1;
- pbci->bmciHeader.bcBitCount = pbmiConverted->bmiHeader.biBitCount;
-
- /* Convert back colors */
- for (i = 0; i < pbmiConverted->bmiHeader.biClrUsed; i++)
- {
- pbci->bmciColors[i].rgbtRed = pbmiConverted->bmiColors[i].rgbRed;
- pbci->bmciColors[i].rgbtGreen = pbmiConverted->bmiColors[i].rgbGreen;
- pbci->bmciColors[i].rgbtBlue = pbmiConverted->bmiColors[i].rgbBlue;
- }
-
- /* Free memory */
- RtlFreeHeap(RtlGetProcessHeap(), 0, pbmiConverted);
- }
-}
INT
WINAPI
@@ -451,9 +422,8 @@
LPBITMAPINFO lpbmi,
UINT uUsage)
{
- PBITMAPINFO pbmiConverted;
- UINT cjBmpScanSize, cjInfoSize;
- INT iResult;
+ UINT cjBmpScanSize;
+ UINT cjInfoSize;
if (!hDC || !GdiIsHandleValid((HGDIOBJ)hDC) || !lpbmi)
{
@@ -461,22 +431,15 @@
return 0;
}
- /* Convert BITMAPINFO to a proper format */
- pbmiConverted = ConvertBitmapInfo(lpbmi, uUsage, &cjInfoSize, FALSE);
- if (!pbmiConverted)
- {
- GdiSetLastError(ERROR_INVALID_PARAMETER);
- return 0;
- }
-
cjBmpScanSize = DIB_BitmapMaxBitsSize(lpbmi, cScanLines);
-
- if (lpvBits)
- {
- if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
- {
- if (lpbmi->bmiHeader.biCompression == BI_JPEG ||
- lpbmi->bmiHeader.biCompression == BI_PNG)
+ cjInfoSize = DIB_BitmapInfoSize(lpbmi, uUsage);
+
+ if ( lpvBits )
+ {
+ if ( lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER) )
+ {
+ if ( lpbmi->bmiHeader.biCompression == BI_JPEG ||
+ lpbmi->bmiHeader.biCompression == BI_PNG )
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
@@ -484,21 +447,16 @@
}
}
- iResult = NtGdiGetDIBitsInternal(hDC,
- hbmp,
- uStartScan,
- cScanLines,
- lpvBits,
- pbmiConverted,
- uUsage,
- cjBmpScanSize,
- cjInfoSize);
-
- ConvertBackBitmapInfo(lpbmi, pbmiConverted);
-
- return iResult;
-}
-
+ return NtGdiGetDIBitsInternal(hDC,
+ hbmp,
+ uStartScan,
+ cScanLines,
+ lpvBits,
+ lpbmi,
+ uUsage,
+ cjBmpScanSize,
+ cjInfoSize);
+}
/*
* @implemented