mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00:00
- Rename bitblt.c to more generic bitmap.c.
- Normalize BITMAPINFO structure in CreateDIBSection before sending it to win32k. svn path=/trunk/; revision=14217
This commit is contained in:
parent
abb9dfec3b
commit
05bc884b35
6 changed files with 66 additions and 49 deletions
|
@ -58,7 +58,7 @@ CreateDCA@16
|
||||||
CreateDCW@16
|
CreateDCW@16
|
||||||
CreateDIBPatternBrush@8
|
CreateDIBPatternBrush@8
|
||||||
CreateDIBPatternBrushPt@8
|
CreateDIBPatternBrushPt@8
|
||||||
CreateDIBSection@24=NtGdiCreateDIBSection@24
|
CreateDIBSection@24
|
||||||
CreateDIBitmap@24=NtGdiCreateDIBitmap@24
|
CreateDIBitmap@24=NtGdiCreateDIBitmap@24
|
||||||
CreateDiscardableBitmap@12=NtGdiCreateDiscardableBitmap@12
|
CreateDiscardableBitmap@12=NtGdiCreateDiscardableBitmap@12
|
||||||
CreateEllipticRgn@16=NtGdiCreateEllipticRgn@16
|
CreateEllipticRgn@16=NtGdiCreateEllipticRgn@16
|
||||||
|
|
|
@ -59,7 +59,7 @@ BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, PVOID *UserData);
|
||||||
|
|
||||||
/* == BITMAP UTILITY FUNCTIONS ============================================== */
|
/* == BITMAP UTILITY FUNCTIONS ============================================== */
|
||||||
|
|
||||||
BOOL STDCALL CalculateColorTableSize(LPBITMAPINFOHEADER BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize);
|
BOOL STDCALL CalculateColorTableSize(CONST BITMAPINFOHEADER *BitmapInfoHeader, UINT *ColorSpec, UINT *ColorTableSize);
|
||||||
LPBITMAPINFO STDCALL ConvertBitmapInfo(LPBITMAPINFO BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData);
|
LPBITMAPINFO STDCALL ConvertBitmapInfo(CONST BITMAPINFO *BitmapInfo, UINT ColorSpec, UINT *BitmapInfoSize, BOOL FollowedByData);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -39,7 +39,7 @@ MISC_OBJECTS = \
|
||||||
misc/win32k.o
|
misc/win32k.o
|
||||||
|
|
||||||
OBJECTS_OBJECTS = \
|
OBJECTS_OBJECTS = \
|
||||||
objects/bitblt.o \
|
objects/bitmap.o \
|
||||||
objects/utils.o \
|
objects/utils.o \
|
||||||
objects/brush.o \
|
objects/brush.o \
|
||||||
objects/dc.o \
|
objects/dc.o \
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS system libraries
|
|
||||||
* FILE: lib/gdi32/object/bitblt.c
|
|
||||||
* PURPOSE:
|
|
||||||
* PROGRAMMER:
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "precomp.h"
|
|
||||||
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
StretchBlt(
|
|
||||||
HDC hdcDest, // handle to destination DC
|
|
||||||
int nXOriginDest, // x-coord of destination upper-left corner
|
|
||||||
int nYOriginDest, // y-coord of destination upper-left corner
|
|
||||||
int nWidthDest, // width of destination rectangle
|
|
||||||
int nHeightDest, // height of destination rectangle
|
|
||||||
HDC hdcSrc, // handle to source DC
|
|
||||||
int nXOriginSrc, // x-coord of source upper-left corner
|
|
||||||
int nYOriginSrc, // y-coord of source upper-left corner
|
|
||||||
int nWidthSrc, // width of source rectangle
|
|
||||||
int nHeightSrc, // height of source rectangle
|
|
||||||
DWORD dwRop // raster operation code
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
|
|
||||||
{
|
|
||||||
return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
|
|
||||||
hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc,
|
|
||||||
nXOriginSrc, nYOriginSrc, dwRop);
|
|
||||||
}
|
|
59
reactos/lib/gdi32/objects/bitmap.c
Normal file
59
reactos/lib/gdi32/objects/bitmap.c
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
HBITMAP STDCALL
|
||||||
|
CreateDIBSection(
|
||||||
|
HDC hDC,
|
||||||
|
CONST BITMAPINFO *BitmapInfo,
|
||||||
|
UINT Usage,
|
||||||
|
VOID **Bits,
|
||||||
|
HANDLE hSection,
|
||||||
|
DWORD dwOffset)
|
||||||
|
{
|
||||||
|
PBITMAPINFO pConvertedInfo;
|
||||||
|
UINT ConvertedInfoSize;
|
||||||
|
HBITMAP hBitmap = NULL;
|
||||||
|
|
||||||
|
pConvertedInfo = ConvertBitmapInfo(BitmapInfo, Usage,
|
||||||
|
&ConvertedInfoSize, FALSE);
|
||||||
|
if (pConvertedInfo)
|
||||||
|
{
|
||||||
|
hBitmap = NtGdiCreateDIBSection(hDC, pConvertedInfo, Usage, Bits,
|
||||||
|
hSection, dwOffset);
|
||||||
|
if (BitmapInfo != pConvertedInfo)
|
||||||
|
RtlFreeHeap(RtlGetProcessHeap(), 0, pConvertedInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hBitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL STDCALL
|
||||||
|
StretchBlt(
|
||||||
|
HDC hdcDest, /* handle to destination DC */
|
||||||
|
int nXOriginDest, /* x-coord of destination upper-left corner */
|
||||||
|
int nYOriginDest, /* y-coord of destination upper-left corner */
|
||||||
|
int nWidthDest, /* width of destination rectangle */
|
||||||
|
int nHeightDest, /* height of destination rectangle */
|
||||||
|
HDC hdcSrc, /* handle to source DC */
|
||||||
|
int nXOriginSrc, /* x-coord of source upper-left corner */
|
||||||
|
int nYOriginSrc, /* y-coord of source upper-left corner */
|
||||||
|
int nWidthSrc, /* width of source rectangle */
|
||||||
|
int nHeightSrc, /* height of source rectangle */
|
||||||
|
DWORD dwRop) /* raster operation code */
|
||||||
|
|
||||||
|
{
|
||||||
|
if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc))
|
||||||
|
{
|
||||||
|
return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
|
||||||
|
nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc,
|
||||||
|
nWidthSrc, nHeightSrc, dwRop);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest,
|
||||||
|
nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, dwRop);
|
||||||
|
}
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
CalculateColorTableSize(
|
CalculateColorTableSize(
|
||||||
LPBITMAPINFOHEADER BitmapInfoHeader,
|
CONST BITMAPINFOHEADER *BitmapInfoHeader,
|
||||||
UINT *ColorSpec,
|
UINT *ColorSpec,
|
||||||
UINT *ColorTableSize)
|
UINT *ColorTableSize)
|
||||||
{
|
{
|
||||||
|
@ -170,12 +170,12 @@ CalculateColorTableSize(
|
||||||
|
|
||||||
LPBITMAPINFO STDCALL
|
LPBITMAPINFO STDCALL
|
||||||
ConvertBitmapInfo(
|
ConvertBitmapInfo(
|
||||||
LPBITMAPINFO BitmapInfo,
|
CONST BITMAPINFO *BitmapInfo,
|
||||||
UINT ColorSpec,
|
UINT ColorSpec,
|
||||||
UINT *BitmapInfoSize,
|
UINT *BitmapInfoSize,
|
||||||
BOOL FollowedByData)
|
BOOL FollowedByData)
|
||||||
{
|
{
|
||||||
LPBITMAPINFO NewBitmapInfo = BitmapInfo;
|
LPBITMAPINFO NewBitmapInfo = (LPBITMAPINFO)BitmapInfo;
|
||||||
LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
|
LPBITMAPCOREINFO CoreBitmapInfo = (LPBITMAPCOREINFO)BitmapInfo;
|
||||||
DWORD Size = 0;
|
DWORD Size = 0;
|
||||||
ULONG DataSize = 0;
|
ULONG DataSize = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue