gdi32: Update the coordinates in convert_bitmapinfo to reflect the position in the destination bitmap.

oldstable
Alexandre Julliard 2011-08-03 20:26:44 +02:00
parent 2ba1a43703
commit c309883a70
4 changed files with 11 additions and 7 deletions

View File

@ -212,7 +212,7 @@ BOOL nulldrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
dst_info->bmiHeader.biWidth = src->visrect.right - src->visrect.left;
if ((ptr = HeapAlloc( GetProcessHeap(), 0, get_dib_image_size( dst_info ))))
{
err = convert_bitmapinfo( src_info, bits.ptr, &src->visrect, dst_info, ptr );
err = convert_bitmapinfo( src_info, bits.ptr, src, dst_info, ptr );
if (bits.free) bits.free( &bits );
bits.ptr = ptr;
bits.is_copy = TRUE;

View File

@ -615,7 +615,7 @@ INT WINAPI SetDIBits( HDC hdc, HBITMAP hbitmap, UINT startscan,
ptr = HeapAlloc( GetProcessHeap(), 0, get_dib_image_size( dst_info ));
if (ptr)
{
err = convert_bitmapinfo( src_info, src_bits.ptr, &src.visrect, dst_info, ptr );
err = convert_bitmapinfo( src_info, src_bits.ptr, &src, dst_info, ptr );
{
if (src_bits.free) src_bits.free( &src_bits );
src_bits.ptr = ptr;
@ -1134,7 +1134,7 @@ INT WINAPI GetDIBits(
else
dst_info->bmiHeader.biHeight = -src.height;
convert_bitmapinfo( src_info, src_bits.ptr, &src.visrect, dst_info, bits );
convert_bitmapinfo( src_info, src_bits.ptr, &src, dst_info, bits );
if (src_bits.free) src_bits.free( &src_bits );
}
else lines = abs(height);

View File

@ -260,7 +260,7 @@ void copy_dib_color_info(dib_info *dst, const dib_info *src)
}
}
DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, const RECT *src_rect,
DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
const BITMAPINFO *dst_info, void *dst_bits )
{
dib_info src_dib, dst_dib;
@ -271,11 +271,15 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, const RECT
if ( !init_dib_info_from_bitmapinfo( &dst_dib, dst_info, dst_bits, 0 ) )
return ERROR_BAD_FORMAT;
ret = dst_dib.funcs->convert_to( &dst_dib, &src_dib, src_rect );
ret = dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
/* We shared the color tables, so there's no need to free the dib_infos here */
if(!ret) return ERROR_BAD_FORMAT;
/* update coordinates, the destination rectangle is always stored at 0,0 */
src->x -= src->visrect.left;
src->y -= src->visrect.top;
offset_rect( &src->visrect, -src->visrect.left, -src->visrect.top );
return ERROR_SUCCESS;
}

View File

@ -340,7 +340,7 @@ extern void DC_UpdateXforms( DC * dc ) DECLSPEC_HIDDEN;
extern int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) DECLSPEC_HIDDEN;
extern int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
LONG *height, WORD *planes, WORD *bpp, DWORD *compr, DWORD *size ) DECLSPEC_HIDDEN;
extern DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, const RECT *src_rect,
extern DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bitblt_coords *src,
const BITMAPINFO *dst_info, void *dst_bits ) DECLSPEC_HIDDEN;