gdi32: Remove the bitmap parameter from the Get/PutImage entry points.
This commit is contained in:
parent
6fe6a43a6c
commit
1416d0e6f1
@ -256,13 +256,13 @@ BOOL nulldrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
|
|||||||
|
|
||||||
if (!(dc_src = get_dc_ptr( src_dev->hdc ))) return FALSE;
|
if (!(dc_src = get_dc_ptr( src_dev->hdc ))) return FALSE;
|
||||||
src_dev = GET_DC_PHYSDEV( dc_src, pGetImage );
|
src_dev = GET_DC_PHYSDEV( dc_src, pGetImage );
|
||||||
err = src_dev->funcs->pGetImage( src_dev, 0, src_info, &bits, src );
|
err = src_dev->funcs->pGetImage( src_dev, src_info, &bits, src );
|
||||||
release_dc_ptr( dc_src );
|
release_dc_ptr( dc_src );
|
||||||
if (err) return FALSE;
|
if (err) return FALSE;
|
||||||
|
|
||||||
dst_dev = GET_DC_PHYSDEV( dc_dst, pPutImage );
|
dst_dev = GET_DC_PHYSDEV( dc_dst, pPutImage );
|
||||||
copy_bitmapinfo( dst_info, src_info );
|
copy_bitmapinfo( dst_info, src_info );
|
||||||
err = dst_dev->funcs->pPutImage( dst_dev, 0, 0, dst_info, &bits, src, dst, rop );
|
err = dst_dev->funcs->pPutImage( dst_dev, 0, dst_info, &bits, src, dst, rop );
|
||||||
if (err == ERROR_BAD_FORMAT)
|
if (err == ERROR_BAD_FORMAT)
|
||||||
{
|
{
|
||||||
DWORD dst_colors = dst_info->bmiHeader.biClrUsed;
|
DWORD dst_colors = dst_info->bmiHeader.biClrUsed;
|
||||||
@ -286,7 +286,7 @@ BOOL nulldrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
|
|||||||
{
|
{
|
||||||
/* get rid of the fake destination table */
|
/* get rid of the fake destination table */
|
||||||
dst_info->bmiHeader.biClrUsed = dst_colors;
|
dst_info->bmiHeader.biClrUsed = dst_colors;
|
||||||
err = dst_dev->funcs->pPutImage( dst_dev, 0, 0, dst_info, &bits, src, dst, rop );
|
err = dst_dev->funcs->pPutImage( dst_dev, 0, dst_info, &bits, src, dst, rop );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ BOOL nulldrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
|
|||||||
{
|
{
|
||||||
copy_bitmapinfo( src_info, dst_info );
|
copy_bitmapinfo( src_info, dst_info );
|
||||||
err = stretch_bits( src_info, src, dst_info, dst, &bits, GetStretchBltMode( dst_dev->hdc ));
|
err = stretch_bits( src_info, src, dst_info, dst, &bits, GetStretchBltMode( dst_dev->hdc ));
|
||||||
if (!err) err = dst_dev->funcs->pPutImage( dst_dev, 0, 0, dst_info, &bits, src, dst, rop );
|
if (!err) err = dst_dev->funcs->pPutImage( dst_dev, 0, dst_info, &bits, src, dst, rop );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bits.free) bits.free( &bits );
|
if (bits.free) bits.free( &bits );
|
||||||
@ -316,7 +316,7 @@ BOOL nulldrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
|
|||||||
|
|
||||||
if (!(dc_src = get_dc_ptr( src_dev->hdc ))) return FALSE;
|
if (!(dc_src = get_dc_ptr( src_dev->hdc ))) return FALSE;
|
||||||
src_dev = GET_DC_PHYSDEV( dc_src, pGetImage );
|
src_dev = GET_DC_PHYSDEV( dc_src, pGetImage );
|
||||||
err = src_dev->funcs->pGetImage( src_dev, 0, src_info, &bits, src );
|
err = src_dev->funcs->pGetImage( src_dev, src_info, &bits, src );
|
||||||
release_dc_ptr( dc_src );
|
release_dc_ptr( dc_src );
|
||||||
if (err) goto done;
|
if (err) goto done;
|
||||||
|
|
||||||
@ -368,12 +368,12 @@ DWORD nulldrv_BlendImage( PHYSDEV dev, BITMAPINFO *info, const struct gdi_image_
|
|||||||
|
|
||||||
dev = GET_DC_PHYSDEV( dc, pGetImage );
|
dev = GET_DC_PHYSDEV( dc, pGetImage );
|
||||||
orig_dst = *dst;
|
orig_dst = *dst;
|
||||||
err = dev->funcs->pGetImage( dev, 0, dst_info, &dst_bits, dst );
|
err = dev->funcs->pGetImage( dev, dst_info, &dst_bits, dst );
|
||||||
if (err) return err;
|
if (err) return err;
|
||||||
|
|
||||||
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
||||||
err = blend_bits( info, bits, src, dst_info, &dst_bits, dst, blend );
|
err = blend_bits( info, bits, src, dst_info, &dst_bits, dst, blend );
|
||||||
if (!err) err = dev->funcs->pPutImage( dev, 0, 0, dst_info, &dst_bits, dst, &orig_dst, SRCCOPY );
|
if (!err) err = dev->funcs->pPutImage( dev, 0, dst_info, &dst_bits, dst, &orig_dst, SRCCOPY );
|
||||||
|
|
||||||
if (dst_bits.free) dst_bits.free( &dst_bits );
|
if (dst_bits.free) dst_bits.free( &dst_bits );
|
||||||
return err;
|
return err;
|
||||||
@ -441,7 +441,7 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
|||||||
info->bmiHeader.biHeight = dst.visrect.bottom - dst.visrect.top;
|
info->bmiHeader.biHeight = dst.visrect.bottom - dst.visrect.top;
|
||||||
info->bmiHeader.biSizeImage = 0;
|
info->bmiHeader.biSizeImage = 0;
|
||||||
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
||||||
err = dev->funcs->pPutImage( dev, 0, 0, info, NULL, NULL, NULL, 0 );
|
err = dev->funcs->pPutImage( dev, 0, info, NULL, NULL, NULL, 0 );
|
||||||
if (err && err != ERROR_BAD_FORMAT) goto done;
|
if (err && err != ERROR_BAD_FORMAT) goto done;
|
||||||
|
|
||||||
info->bmiHeader.biSizeImage = get_dib_image_size( info );
|
info->bmiHeader.biSizeImage = get_dib_image_size( info );
|
||||||
@ -464,7 +464,7 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
|||||||
rgn = CreateRectRgn( 0, 0, 0, 0 );
|
rgn = CreateRectRgn( 0, 0, 0, 0 );
|
||||||
gradient_bitmapinfo( info, bits.ptr, vert_array, nvert, grad_array, ngrad, mode, pts, rgn );
|
gradient_bitmapinfo( info, bits.ptr, vert_array, nvert, grad_array, ngrad, mode, pts, rgn );
|
||||||
OffsetRgn( rgn, dst.visrect.left, dst.visrect.top );
|
OffsetRgn( rgn, dst.visrect.left, dst.visrect.top );
|
||||||
ret = !dev->funcs->pPutImage( dev, 0, rgn, info, &bits, &src, &dst, SRCCOPY );
|
ret = !dev->funcs->pPutImage( dev, rgn, info, &bits, &src, &dst, SRCCOPY );
|
||||||
|
|
||||||
if (bits.free) bits.free( &bits );
|
if (bits.free) bits.free( &bits );
|
||||||
DeleteObject( rgn );
|
DeleteObject( rgn );
|
||||||
@ -495,7 +495,7 @@ COLORREF nulldrv_GetPixel( PHYSDEV dev, INT x, INT y )
|
|||||||
if (!clip_visrect( dc, &src.visrect, &src.visrect )) return CLR_INVALID;
|
if (!clip_visrect( dc, &src.visrect, &src.visrect )) return CLR_INVALID;
|
||||||
|
|
||||||
dev = GET_DC_PHYSDEV( dc, pGetImage );
|
dev = GET_DC_PHYSDEV( dc, pGetImage );
|
||||||
if (dev->funcs->pGetImage( dev, 0, info, &bits, &src )) return CLR_INVALID;
|
if (dev->funcs->pGetImage( dev, info, &bits, &src )) return CLR_INVALID;
|
||||||
|
|
||||||
ret = get_pixel_bitmapinfo( info, bits.ptr, &src );
|
ret = get_pixel_bitmapinfo( info, bits.ptr, &src );
|
||||||
if (bits.free) bits.free( &bits );
|
if (bits.free) bits.free( &bits );
|
||||||
|
@ -554,7 +554,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he
|
|||||||
|
|
||||||
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
||||||
copy_bitmapinfo( dst_info, src_info );
|
copy_bitmapinfo( dst_info, src_info );
|
||||||
err = dev->funcs->pPutImage( dev, 0, clip, dst_info, &src_bits, &src, &dst, rop );
|
err = dev->funcs->pPutImage( dev, clip, dst_info, &src_bits, &src, &dst, rop );
|
||||||
if (err == ERROR_BAD_FORMAT)
|
if (err == ERROR_BAD_FORMAT)
|
||||||
{
|
{
|
||||||
/* 1-bpp destination without a color table requires a fake 1-entry table
|
/* 1-bpp destination without a color table requires a fake 1-entry table
|
||||||
@ -573,7 +573,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he
|
|||||||
{
|
{
|
||||||
/* get rid of the fake 1-bpp table */
|
/* get rid of the fake 1-bpp table */
|
||||||
if (dst_info->bmiHeader.biClrUsed == 1) dst_info->bmiHeader.biClrUsed = 0;
|
if (dst_info->bmiHeader.biClrUsed == 1) dst_info->bmiHeader.biClrUsed = 0;
|
||||||
err = dev->funcs->pPutImage( dev, 0, clip, dst_info, &src_bits, &src, &dst, rop );
|
err = dev->funcs->pPutImage( dev, clip, dst_info, &src_bits, &src, &dst, rop );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he
|
|||||||
{
|
{
|
||||||
copy_bitmapinfo( src_info, dst_info );
|
copy_bitmapinfo( src_info, dst_info );
|
||||||
err = stretch_bits( src_info, &src, dst_info, &dst, &src_bits, GetStretchBltMode( dev->hdc ) );
|
err = stretch_bits( src_info, &src, dst_info, &dst, &src_bits, GetStretchBltMode( dev->hdc ) );
|
||||||
if (!err) err = dev->funcs->pPutImage( dev, 0, NULL, dst_info, &src_bits, &src, &dst, rop );
|
if (!err) err = dev->funcs->pPutImage( dev, NULL, dst_info, &src_bits, &src, &dst, rop );
|
||||||
}
|
}
|
||||||
if (err) ret = 0;
|
if (err) ret = 0;
|
||||||
else if (rop == SRCCOPY) ret = height;
|
else if (rop == SRCCOPY) ret = height;
|
||||||
@ -850,11 +850,11 @@ INT nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx, DWOR
|
|||||||
|
|
||||||
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
dev = GET_DC_PHYSDEV( dc, pPutImage );
|
||||||
copy_bitmapinfo( dst_info, src_info );
|
copy_bitmapinfo( dst_info, src_info );
|
||||||
err = dev->funcs->pPutImage( dev, 0, clip, dst_info, &src_bits, &src, &dst, SRCCOPY );
|
err = dev->funcs->pPutImage( dev, clip, dst_info, &src_bits, &src, &dst, SRCCOPY );
|
||||||
if (err == ERROR_BAD_FORMAT)
|
if (err == ERROR_BAD_FORMAT)
|
||||||
{
|
{
|
||||||
err = convert_bits( src_info, &src, dst_info, &src_bits, FALSE );
|
err = convert_bits( src_info, &src, dst_info, &src_bits, FALSE );
|
||||||
if (!err) err = dev->funcs->pPutImage( dev, 0, clip, dst_info, &src_bits, &src, &dst, SRCCOPY );
|
if (!err) err = dev->funcs->pPutImage( dev, clip, dst_info, &src_bits, &src, &dst, SRCCOPY );
|
||||||
}
|
}
|
||||||
if (err) lines = 0;
|
if (err) lines = 0;
|
||||||
|
|
||||||
|
@ -850,22 +850,12 @@ DWORD get_image_from_bitmap( BITMAPOBJ *bmp, BITMAPINFO *info,
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* dibdrv_GetImage
|
* dibdrv_GetImage
|
||||||
*/
|
*/
|
||||||
DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
DWORD dibdrv_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
struct bitblt_coords *src )
|
||||||
{
|
{
|
||||||
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
|
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
|
||||||
|
|
||||||
TRACE( "%p %p %p\n", dev, hbitmap, info );
|
TRACE( "%p %p\n", dev, info );
|
||||||
|
|
||||||
if (hbitmap)
|
|
||||||
{
|
|
||||||
DWORD ret;
|
|
||||||
BITMAPOBJ *bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP );
|
|
||||||
if (!bmp) return ERROR_INVALID_HANDLE;
|
|
||||||
ret = get_image_from_bitmap( bmp, info, bits, src );
|
|
||||||
GDI_ReleaseObj( hbitmap );
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return get_image_dib_info( &pdev->dib, info, bits, src );
|
return get_image_dib_info( &pdev->dib, info, bits, src );
|
||||||
}
|
}
|
||||||
@ -956,7 +946,7 @@ static inline BOOL rop_uses_pat(DWORD rop)
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* dibdrv_PutImage
|
* dibdrv_PutImage
|
||||||
*/
|
*/
|
||||||
DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
DWORD dibdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
@ -966,17 +956,7 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
|
|||||||
HRGN tmp_rgn = 0;
|
HRGN tmp_rgn = 0;
|
||||||
dibdrv_physdev *pdev = get_dibdrv_pdev( dev );
|
dibdrv_physdev *pdev = get_dibdrv_pdev( dev );
|
||||||
|
|
||||||
TRACE( "%p %p %p\n", dev, hbitmap, info );
|
TRACE( "%p %p\n", dev, info );
|
||||||
|
|
||||||
if (hbitmap)
|
|
||||||
{
|
|
||||||
DWORD ret;
|
|
||||||
BITMAPOBJ *bmp = GDI_GetObjPtr( hbitmap, OBJ_BITMAP );
|
|
||||||
if (!bmp) return ERROR_INVALID_HANDLE;
|
|
||||||
ret = put_image_into_bitmap( bmp, clip, info, bits, src, dst );
|
|
||||||
GDI_ReleaseObj( hbitmap );
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!matching_color_info( &pdev->dib, info )) goto update_format;
|
if (!matching_color_info( &pdev->dib, info )) goto update_format;
|
||||||
if (!bits) return ERROR_SUCCESS;
|
if (!bits) return ERROR_SUCCESS;
|
||||||
|
@ -118,8 +118,8 @@ extern BOOL dibdrv_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT b
|
|||||||
extern BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type ) DECLSPEC_HIDDEN;
|
extern BOOL dibdrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
extern BOOL dibdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
|
||||||
const RECT *rect, LPCWSTR str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
|
const RECT *rect, LPCWSTR str, UINT count, const INT *dx ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
extern DWORD dibdrv_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src ) DECLSPEC_HIDDEN;
|
struct bitblt_coords *src ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
extern COLORREF dibdrv_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
|
extern COLORREF dibdrv_GetPixel( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
extern BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
|
||||||
@ -134,7 +134,7 @@ extern BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD*
|
|||||||
DWORD polylines ) DECLSPEC_HIDDEN;
|
DWORD polylines ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL dibdrv_Polygon( PHYSDEV dev, const POINT *pt, INT count ) DECLSPEC_HIDDEN;
|
extern BOOL dibdrv_Polygon( PHYSDEV dev, const POINT *pt, INT count ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
|
extern BOOL dibdrv_Polyline( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
extern DWORD dibdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
|
extern BOOL dibdrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
|
||||||
|
@ -385,8 +385,8 @@ static BOOL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
static DWORD nulldrv_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
struct bitblt_coords *src )
|
||||||
{
|
{
|
||||||
return ERROR_NOT_SUPPORTED;
|
return ERROR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
@ -502,7 +502,7 @@ static BOOL nulldrv_Polyline( PHYSDEV dev, const POINT *points, INT count )
|
|||||||
return PolyPolyline( dev->hdc, points, counts, 1 );
|
return PolyPolyline( dev->hdc, points, counts, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static DWORD nulldrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
static DWORD nulldrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
|
@ -1896,7 +1896,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
|
|||||||
info->bmiHeader.biSize = sizeof(info->bmiHeader);
|
info->bmiHeader.biSize = sizeof(info->bmiHeader);
|
||||||
info->bmiHeader.biWidth = src.width;
|
info->bmiHeader.biWidth = src.width;
|
||||||
info->bmiHeader.biHeight = -src.height;
|
info->bmiHeader.biHeight = -src.height;
|
||||||
err = dst_dev->funcs->pPutImage( dst_dev, 0, 0, info, NULL, NULL, NULL, 0 );
|
err = dst_dev->funcs->pPutImage( dst_dev, 0, info, NULL, NULL, NULL, 0 );
|
||||||
if (!err || err == ERROR_BAD_FORMAT)
|
if (!err || err == ERROR_BAD_FORMAT)
|
||||||
{
|
{
|
||||||
/* make the source rectangle relative to the source bits */
|
/* make the source rectangle relative to the source bits */
|
||||||
@ -1915,7 +1915,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
PHYSDEV src_dev = GET_DC_PHYSDEV( dc, pGetImage );
|
PHYSDEV src_dev = GET_DC_PHYSDEV( dc, pGetImage );
|
||||||
err = src_dev->funcs->pGetImage( src_dev, 0, info, &bits, &src );
|
err = src_dev->funcs->pGetImage( src_dev, info, &bits, &src );
|
||||||
if (!err && !bits.is_copy)
|
if (!err && !bits.is_copy)
|
||||||
{
|
{
|
||||||
void *ptr = HeapAlloc( GetProcessHeap(), 0, get_dib_image_size( info ));
|
void *ptr = HeapAlloc( GetProcessHeap(), 0, get_dib_image_size( info ));
|
||||||
@ -1938,7 +1938,7 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
|
|||||||
y += src.visrect.top - dst.visrect.top;
|
y += src.visrect.top - dst.visrect.top;
|
||||||
render_aa_text_bitmapinfo( dev->hdc, info, &bits, &src, x, y, flags,
|
render_aa_text_bitmapinfo( dev->hdc, info, &bits, &src, x, y, flags,
|
||||||
aa_flags, str, count, dx );
|
aa_flags, str, count, dx );
|
||||||
err = dst_dev->funcs->pPutImage( dst_dev, 0, 0, info, &bits, &src, &dst, SRCCOPY );
|
err = dst_dev->funcs->pPutImage( dst_dev, 0, info, &bits, &src, &dst, SRCCOPY );
|
||||||
if (bits.free) bits.free( &bits );
|
if (bits.free) bits.free( &bits );
|
||||||
return !err;
|
return !err;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ static void PSDRV_WriteImageBits( PHYSDEV dev, const BITMAPINFO *info, INT xDst,
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* PSDRV_PutImage
|
* PSDRV_PutImage
|
||||||
*/
|
*/
|
||||||
DWORD PSDRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
DWORD PSDRV_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
@ -176,8 +176,6 @@ DWORD PSDRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
|||||||
unsigned char *src_ptr, *dst_ptr;
|
unsigned char *src_ptr, *dst_ptr;
|
||||||
struct gdi_image_bits dst_bits;
|
struct gdi_image_bits dst_bits;
|
||||||
|
|
||||||
if (hbitmap) return ERROR_NOT_SUPPORTED;
|
|
||||||
|
|
||||||
if (info->bmiHeader.biPlanes != 1) goto update_format;
|
if (info->bmiHeader.biPlanes != 1) goto update_format;
|
||||||
if (info->bmiHeader.biCompression != BI_RGB) goto update_format;
|
if (info->bmiHeader.biCompression != BI_RGB) goto update_format;
|
||||||
if (info->bmiHeader.biBitCount == 16 || info->bmiHeader.biBitCount == 32) goto update_format;
|
if (info->bmiHeader.biBitCount == 16 || info->bmiHeader.biBitCount == 32) goto update_format;
|
||||||
|
@ -437,7 +437,7 @@ extern BOOL PSDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) DECLS
|
|||||||
extern BOOL PSDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
|
extern BOOL PSDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons ) DECLSPEC_HIDDEN;
|
extern BOOL PSDRV_PolyPolygon( PHYSDEV dev, const POINT* pts, const INT* counts, UINT polygons ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PSDRV_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines ) DECLSPEC_HIDDEN;
|
extern BOOL PSDRV_PolyPolyline( PHYSDEV dev, const POINT* pts, const DWORD* counts, DWORD polylines ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD PSDRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
extern DWORD PSDRV_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
|
extern BOOL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN;
|
||||||
|
@ -1199,12 +1199,11 @@ DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_PutImage
|
* X11DRV_PutImage
|
||||||
*/
|
*/
|
||||||
DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
DWORD X11DRV_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
X11DRV_PDEVICE *physdev;
|
X11DRV_PDEVICE *physdev = get_x11drv_dev( dev );
|
||||||
X_PHYSBITMAP *bitmap;
|
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
XImage *image;
|
XImage *image;
|
||||||
XVisualInfo vis;
|
XVisualInfo vis;
|
||||||
@ -1213,26 +1212,12 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
|
|||||||
const BYTE *opcode = BITBLT_Opcodes[(rop >> 16) & 0xff];
|
const BYTE *opcode = BITBLT_Opcodes[(rop >> 16) & 0xff];
|
||||||
const int *mapping = NULL;
|
const int *mapping = NULL;
|
||||||
|
|
||||||
if (hbitmap)
|
vis.depth = physdev->depth;
|
||||||
|
if (physdev->color_shifts)
|
||||||
{
|
{
|
||||||
if (!(bitmap = X11DRV_get_phys_bitmap( hbitmap ))) return ERROR_INVALID_HANDLE;
|
vis.red_mask = physdev->color_shifts->logicalRed.max << physdev->color_shifts->logicalRed.shift;
|
||||||
physdev = NULL;
|
vis.green_mask = physdev->color_shifts->logicalGreen.max << physdev->color_shifts->logicalGreen.shift;
|
||||||
vis.depth = bitmap->depth;
|
vis.blue_mask = physdev->color_shifts->logicalBlue.max << physdev->color_shifts->logicalBlue.shift;
|
||||||
vis.red_mask = bitmap->color_shifts.logicalRed.max << bitmap->color_shifts.logicalRed.shift;
|
|
||||||
vis.green_mask = bitmap->color_shifts.logicalGreen.max << bitmap->color_shifts.logicalGreen.shift;
|
|
||||||
vis.blue_mask = bitmap->color_shifts.logicalBlue.max << bitmap->color_shifts.logicalBlue.shift;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
physdev = get_x11drv_dev( dev );
|
|
||||||
bitmap = NULL;
|
|
||||||
vis.depth = physdev->depth;
|
|
||||||
if (physdev->color_shifts)
|
|
||||||
{
|
|
||||||
vis.red_mask = physdev->color_shifts->logicalRed.max << physdev->color_shifts->logicalRed.shift;
|
|
||||||
vis.green_mask = physdev->color_shifts->logicalGreen.max << physdev->color_shifts->logicalGreen.shift;
|
|
||||||
vis.blue_mask = physdev->color_shifts->logicalBlue.max << physdev->color_shifts->logicalBlue.shift;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
format = pixmap_formats[vis.depth];
|
format = pixmap_formats[vis.depth];
|
||||||
|
|
||||||
@ -1251,7 +1236,7 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
|
|||||||
|
|
||||||
if (image->bits_per_pixel == 4 || image->bits_per_pixel == 8)
|
if (image->bits_per_pixel == 4 || image->bits_per_pixel == 8)
|
||||||
{
|
{
|
||||||
if (bitmap || (!opcode[1] && OP_SRCDST(opcode[0]) == OP_ARGS(SRC,DST)))
|
if (!opcode[1] && OP_SRCDST(opcode[0]) == OP_ARGS(SRC,DST))
|
||||||
mapping = X11DRV_PALETTE_PaletteToXPixel;
|
mapping = X11DRV_PALETTE_PaletteToXPixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1259,67 +1244,45 @@ DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info
|
|||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
BOOL restore_region = add_extra_clipping_region( physdev, clip );
|
||||||
int width = dst->visrect.right - dst->visrect.left;
|
int width = dst->visrect.right - dst->visrect.left;
|
||||||
int height = dst->visrect.bottom - dst->visrect.top;
|
int height = dst->visrect.bottom - dst->visrect.top;
|
||||||
|
|
||||||
image->data = dst_bits.ptr;
|
image->data = dst_bits.ptr;
|
||||||
|
|
||||||
if (bitmap)
|
/* optimization for single-op ROPs */
|
||||||
|
if (!opcode[1] && OP_SRCDST(opcode[0]) == OP_ARGS(SRC,DST))
|
||||||
{
|
{
|
||||||
RGNDATA *clip_data = NULL;
|
|
||||||
GC gc;
|
|
||||||
|
|
||||||
if (clip) clip_data = X11DRV_GetRegionData( clip, 0 );
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
gc = XCreateGC( gdi_display, bitmap->pixmap, 0, NULL );
|
XSetFunction( gdi_display, physdev->gc, OP_ROP(*opcode) );
|
||||||
XSetGraphicsExposures( gdi_display, gc, False );
|
XPutImage( gdi_display, physdev->drawable, physdev->gc, image, src->visrect.left, 0,
|
||||||
if (clip_data) XSetClipRectangles( gdi_display, gc, 0, 0, (XRectangle *)clip_data->Buffer,
|
physdev->dc_rect.left + dst->visrect.left,
|
||||||
clip_data->rdh.nCount, YXBanded );
|
physdev->dc_rect.top + dst->visrect.top, width, height );
|
||||||
XPutImage( gdi_display, bitmap->pixmap, gc, image, src->visrect.left, 0,
|
|
||||||
dst->visrect.left, dst->visrect.top, width, height );
|
|
||||||
XFreeGC( gdi_display, gc );
|
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
HeapFree( GetProcessHeap(), 0, clip_data );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOL restore_region = add_extra_clipping_region( physdev, clip );
|
Pixmap src_pixmap;
|
||||||
|
GC gc;
|
||||||
|
|
||||||
/* optimization for single-op ROPs */
|
wine_tsx11_lock();
|
||||||
if (!opcode[1] && OP_SRCDST(opcode[0]) == OP_ARGS(SRC,DST))
|
gc = XCreateGC( gdi_display, physdev->drawable, 0, NULL );
|
||||||
{
|
XSetSubwindowMode( gdi_display, gc, IncludeInferiors );
|
||||||
wine_tsx11_lock();
|
XSetGraphicsExposures( gdi_display, gc, False );
|
||||||
XSetFunction( gdi_display, physdev->gc, OP_ROP(*opcode) );
|
src_pixmap = XCreatePixmap( gdi_display, root_window, width, height, vis.depth );
|
||||||
XPutImage( gdi_display, physdev->drawable, physdev->gc, image, src->visrect.left, 0,
|
XPutImage( gdi_display, src_pixmap, gc, image, src->visrect.left, 0, 0, 0, width, height );
|
||||||
physdev->dc_rect.left + dst->visrect.left,
|
wine_tsx11_unlock();
|
||||||
physdev->dc_rect.top + dst->visrect.top, width, height );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Pixmap src_pixmap;
|
|
||||||
GC gc;
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
execute_rop( physdev, src_pixmap, gc, &dst->visrect, rop );
|
||||||
gc = XCreateGC( gdi_display, physdev->drawable, 0, NULL );
|
|
||||||
XSetSubwindowMode( gdi_display, gc, IncludeInferiors );
|
|
||||||
XSetGraphicsExposures( gdi_display, gc, False );
|
|
||||||
src_pixmap = XCreatePixmap( gdi_display, root_window, width, height, vis.depth );
|
|
||||||
XPutImage( gdi_display, src_pixmap, gc, image, src->visrect.left, 0, 0, 0, width, height );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
|
|
||||||
execute_rop( physdev, src_pixmap, gc, &dst->visrect, rop );
|
wine_tsx11_lock();
|
||||||
|
XFreePixmap( gdi_display, src_pixmap );
|
||||||
wine_tsx11_lock();
|
XFreeGC( gdi_display, gc );
|
||||||
XFreePixmap( gdi_display, src_pixmap );
|
wine_tsx11_unlock();
|
||||||
XFreeGC( gdi_display, gc );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (restore_region) restore_clipping_region( physdev );
|
|
||||||
add_device_bounds( physdev, &dst->visrect );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (restore_region) restore_clipping_region( physdev );
|
||||||
|
add_device_bounds( physdev, &dst->visrect );
|
||||||
image->data = NULL;
|
image->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1340,11 +1303,10 @@ update_format:
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* X11DRV_GetImage
|
* X11DRV_GetImage
|
||||||
*/
|
*/
|
||||||
DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
DWORD X11DRV_GetImage( PHYSDEV dev, BITMAPINFO *info,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
||||||
{
|
{
|
||||||
X11DRV_PDEVICE *physdev;
|
X11DRV_PDEVICE *physdev = get_x11drv_dev( dev );
|
||||||
X_PHYSBITMAP *bitmap;
|
|
||||||
DWORD ret = ERROR_SUCCESS;
|
DWORD ret = ERROR_SUCCESS;
|
||||||
XImage *image;
|
XImage *image;
|
||||||
XVisualInfo vis;
|
XVisualInfo vis;
|
||||||
@ -1353,26 +1315,12 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
|||||||
const XPixmapFormatValues *format;
|
const XPixmapFormatValues *format;
|
||||||
const int *mapping = NULL;
|
const int *mapping = NULL;
|
||||||
|
|
||||||
if (hbitmap)
|
vis.depth = physdev->depth;
|
||||||
|
if (physdev->color_shifts)
|
||||||
{
|
{
|
||||||
if (!(bitmap = X11DRV_get_phys_bitmap( hbitmap ))) return ERROR_INVALID_HANDLE;
|
vis.red_mask = physdev->color_shifts->logicalRed.max << physdev->color_shifts->logicalRed.shift;
|
||||||
physdev = NULL;
|
vis.green_mask = physdev->color_shifts->logicalGreen.max << physdev->color_shifts->logicalGreen.shift;
|
||||||
vis.depth = bitmap->depth;
|
vis.blue_mask = physdev->color_shifts->logicalBlue.max << physdev->color_shifts->logicalBlue.shift;
|
||||||
vis.red_mask = bitmap->color_shifts.logicalRed.max << bitmap->color_shifts.logicalRed.shift;
|
|
||||||
vis.green_mask = bitmap->color_shifts.logicalGreen.max << bitmap->color_shifts.logicalGreen.shift;
|
|
||||||
vis.blue_mask = bitmap->color_shifts.logicalBlue.max << bitmap->color_shifts.logicalBlue.shift;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
physdev = get_x11drv_dev( dev );
|
|
||||||
bitmap = NULL;
|
|
||||||
vis.depth = physdev->depth;
|
|
||||||
if (physdev->color_shifts)
|
|
||||||
{
|
|
||||||
vis.red_mask = physdev->color_shifts->logicalRed.max << physdev->color_shifts->logicalRed.shift;
|
|
||||||
vis.green_mask = physdev->color_shifts->logicalGreen.max << physdev->color_shifts->logicalGreen.shift;
|
|
||||||
vis.blue_mask = physdev->color_shifts->logicalBlue.max << physdev->color_shifts->logicalBlue.shift;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
format = pixmap_formats[vis.depth];
|
format = pixmap_formats[vis.depth];
|
||||||
|
|
||||||
@ -1410,45 +1358,22 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
|||||||
src->y -= y;
|
src->y -= y;
|
||||||
OffsetRect( &src->visrect, -x, -y );
|
OffsetRect( &src->visrect, -x, -y );
|
||||||
|
|
||||||
if (bitmap)
|
X11DRV_expect_error( gdi_display, XGetImage_handler, NULL );
|
||||||
|
image = XGetImage( gdi_display, physdev->drawable,
|
||||||
|
physdev->dc_rect.left + x, physdev->dc_rect.top + y,
|
||||||
|
width, height, AllPlanes, ZPixmap );
|
||||||
|
if (X11DRV_check_error())
|
||||||
{
|
{
|
||||||
BITMAP bm;
|
/* use a temporary pixmap to avoid the BadMatch error */
|
||||||
GetObjectW( hbitmap, sizeof(bm), &bm );
|
Pixmap pixmap;
|
||||||
width = min( width, bm.bmWidth - x );
|
|
||||||
height = min( height, bm.bmHeight - y );
|
|
||||||
wine_tsx11_lock();
|
|
||||||
image = XGetImage( gdi_display, bitmap->pixmap, x, y, width, height, AllPlanes, ZPixmap );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
}
|
|
||||||
else if (GetObjectType( dev->hdc ) == OBJ_MEMDC)
|
|
||||||
{
|
|
||||||
width = min( width, physdev->dc_rect.right - physdev->dc_rect.left - x );
|
|
||||||
height = min( height, physdev->dc_rect.bottom - physdev->dc_rect.top - y );
|
|
||||||
wine_tsx11_lock();
|
|
||||||
image = XGetImage( gdi_display, physdev->drawable,
|
|
||||||
physdev->dc_rect.left + x, physdev->dc_rect.top + y,
|
|
||||||
width, height, AllPlanes, ZPixmap );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
X11DRV_expect_error( gdi_display, XGetImage_handler, NULL );
|
|
||||||
image = XGetImage( gdi_display, physdev->drawable,
|
|
||||||
physdev->dc_rect.left + x, physdev->dc_rect.top + y,
|
|
||||||
width, height, AllPlanes, ZPixmap );
|
|
||||||
if (X11DRV_check_error())
|
|
||||||
{
|
|
||||||
/* use a temporary pixmap to avoid the BadMatch error */
|
|
||||||
Pixmap pixmap;
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
pixmap = XCreatePixmap( gdi_display, root_window, width, height, vis.depth );
|
pixmap = XCreatePixmap( gdi_display, root_window, width, height, vis.depth );
|
||||||
XCopyArea( gdi_display, physdev->drawable, pixmap, get_bitmap_gc(vis.depth),
|
XCopyArea( gdi_display, physdev->drawable, pixmap, get_bitmap_gc(vis.depth),
|
||||||
physdev->dc_rect.left + x, physdev->dc_rect.top + y, width, height, 0, 0 );
|
physdev->dc_rect.left + x, physdev->dc_rect.top + y, width, height, 0, 0 );
|
||||||
image = XGetImage( gdi_display, pixmap, 0, 0, width, height, AllPlanes, ZPixmap );
|
image = XGetImage( gdi_display, pixmap, 0, 0, width, height, AllPlanes, ZPixmap );
|
||||||
XFreePixmap( gdi_display, pixmap );
|
XFreePixmap( gdi_display, pixmap );
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!image) return ERROR_OUTOFMEMORY;
|
if (!image) return ERROR_OUTOFMEMORY;
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ extern INT X11DRV_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW proc, LPARAM lparam
|
|||||||
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL X11DRV_GetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_GetDeviceGammaRamp( PHYSDEV dev, LPVOID ramp ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename ) DECLSPEC_HIDDEN;
|
||||||
extern DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
extern DWORD X11DRV_GetImage( PHYSDEV dev, BITMAPINFO *info,
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src ) DECLSPEC_HIDDEN;
|
struct gdi_image_bits *bits, struct bitblt_coords *src ) DECLSPEC_HIDDEN;
|
||||||
extern COLORREF X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
extern COLORREF X11DRV_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
|
||||||
extern UINT X11DRV_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, LPPALETTEENTRY entries ) DECLSPEC_HIDDEN;
|
extern UINT X11DRV_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, LPPALETTEENTRY entries ) DECLSPEC_HIDDEN;
|
||||||
@ -194,7 +194,7 @@ extern BOOL X11DRV_Pie( PHYSDEV dev, INT left, INT top, INT right,
|
|||||||
extern BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN;
|
||||||
extern BOOL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) DECLSPEC_HIDDEN;
|
||||||
extern BOOL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines) DECLSPEC_HIDDEN;
|
extern BOOL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polylines) DECLSPEC_HIDDEN;
|
||||||
extern DWORD X11DRV_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
extern DWORD X11DRV_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN;
|
||||||
extern UINT X11DRV_RealizeDefaultPalette( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
extern UINT X11DRV_RealizeDefaultPalette( PHYSDEV dev ) DECLSPEC_HIDDEN;
|
||||||
|
@ -1316,17 +1316,6 @@ static HBITMAP xrenderdrv_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap )
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* xrenderdrv_GetImage
|
|
||||||
*/
|
|
||||||
static DWORD xrenderdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
|
|
||||||
struct gdi_image_bits *bits, struct bitblt_coords *src )
|
|
||||||
{
|
|
||||||
if (hbitmap) return X11DRV_GetImage( dev, hbitmap, info, bits, src );
|
|
||||||
dev = GET_NEXT_PHYSDEV( dev, pGetImage );
|
|
||||||
return dev->funcs->pGetImage( dev, hbitmap, info, bits, src );
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* xrenderdrv_SetDeviceClipping
|
* xrenderdrv_SetDeviceClipping
|
||||||
*/
|
*/
|
||||||
@ -2183,12 +2172,11 @@ x11drv_fallback:
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* xrenderdrv_PutImage
|
* xrenderdrv_PutImage
|
||||||
*/
|
*/
|
||||||
static DWORD xrenderdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINFO *info,
|
static DWORD xrenderdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
||||||
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
||||||
struct bitblt_coords *dst, DWORD rop )
|
struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
struct xrender_physdev *physdev;
|
struct xrender_physdev *physdev = get_xrender_dev( dev );
|
||||||
X_PHYSBITMAP *bitmap;
|
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
Pixmap tmp_pixmap;
|
Pixmap tmp_pixmap;
|
||||||
GC gc;
|
GC gc;
|
||||||
@ -2198,19 +2186,7 @@ static DWORD xrenderdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMA
|
|||||||
Picture src_pict, mask_pict = 0;
|
Picture src_pict, mask_pict = 0;
|
||||||
BOOL use_repeat;
|
BOOL use_repeat;
|
||||||
|
|
||||||
if (hbitmap)
|
dst_format = physdev->format;
|
||||||
{
|
|
||||||
if (!(bitmap = X11DRV_get_phys_bitmap( hbitmap ))) return ERROR_INVALID_HANDLE;
|
|
||||||
physdev = NULL;
|
|
||||||
dst_format = bitmap->format;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
physdev = get_xrender_dev( dev );
|
|
||||||
bitmap = NULL;
|
|
||||||
dst_format = physdev->format;
|
|
||||||
}
|
|
||||||
|
|
||||||
src_format = get_xrender_format_from_bitmapinfo( info );
|
src_format = get_xrender_format_from_bitmapinfo( info );
|
||||||
if (!(pict_format = pict_formats[src_format])) goto update_format;
|
if (!(pict_format = pict_formats[src_format])) goto update_format;
|
||||||
|
|
||||||
@ -2231,53 +2207,41 @@ static DWORD xrenderdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMA
|
|||||||
{
|
{
|
||||||
struct bitblt_coords tmp;
|
struct bitblt_coords tmp;
|
||||||
|
|
||||||
if (bitmap)
|
if (rop != SRCCOPY)
|
||||||
{
|
{
|
||||||
HRGN rgn = CreateRectRgnIndirect( &dst->visrect );
|
BOOL restore_region = add_extra_clipping_region( physdev->x11dev, clip );
|
||||||
if (clip) CombineRgn( rgn, rgn, clip, RGN_AND );
|
|
||||||
|
|
||||||
xrender_put_image( src_pixmap, src_pict, mask_pict, rgn,
|
/* make coordinates relative to tmp pixmap */
|
||||||
pict_formats[dst_format], NULL, bitmap->pixmap, src, dst, use_repeat );
|
tmp = *dst;
|
||||||
DeleteObject( rgn );
|
tmp.x -= tmp.visrect.left;
|
||||||
|
tmp.y -= tmp.visrect.top;
|
||||||
|
OffsetRect( &tmp.visrect, -tmp.visrect.left, -tmp.visrect.top );
|
||||||
|
|
||||||
|
wine_tsx11_lock();
|
||||||
|
gc = XCreateGC( gdi_display, physdev->x11dev->drawable, 0, NULL );
|
||||||
|
XSetSubwindowMode( gdi_display, gc, IncludeInferiors );
|
||||||
|
XSetGraphicsExposures( gdi_display, gc, False );
|
||||||
|
tmp_pixmap = XCreatePixmap( gdi_display, root_window,
|
||||||
|
tmp.visrect.right - tmp.visrect.left,
|
||||||
|
tmp.visrect.bottom - tmp.visrect.top,
|
||||||
|
physdev->pict_format->depth );
|
||||||
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
|
xrender_put_image( src_pixmap, src_pict, mask_pict, NULL, physdev->pict_format,
|
||||||
|
NULL, tmp_pixmap, src, &tmp, use_repeat );
|
||||||
|
execute_rop( physdev->x11dev, tmp_pixmap, gc, &dst->visrect, rop );
|
||||||
|
|
||||||
|
wine_tsx11_lock();
|
||||||
|
XFreePixmap( gdi_display, tmp_pixmap );
|
||||||
|
XFreeGC( gdi_display, gc );
|
||||||
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
|
if (restore_region) restore_clipping_region( physdev->x11dev );
|
||||||
}
|
}
|
||||||
else
|
else xrender_put_image( src_pixmap, src_pict, mask_pict, clip,
|
||||||
{
|
physdev->pict_format, physdev, 0, src, dst, use_repeat );
|
||||||
if (rop != SRCCOPY)
|
|
||||||
{
|
|
||||||
BOOL restore_region = add_extra_clipping_region( physdev->x11dev, clip );
|
|
||||||
|
|
||||||
/* make coordinates relative to tmp pixmap */
|
add_device_bounds( physdev->x11dev, &dst->visrect );
|
||||||
tmp = *dst;
|
|
||||||
tmp.x -= tmp.visrect.left;
|
|
||||||
tmp.y -= tmp.visrect.top;
|
|
||||||
OffsetRect( &tmp.visrect, -tmp.visrect.left, -tmp.visrect.top );
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
|
||||||
gc = XCreateGC( gdi_display, physdev->x11dev->drawable, 0, NULL );
|
|
||||||
XSetSubwindowMode( gdi_display, gc, IncludeInferiors );
|
|
||||||
XSetGraphicsExposures( gdi_display, gc, False );
|
|
||||||
tmp_pixmap = XCreatePixmap( gdi_display, root_window,
|
|
||||||
tmp.visrect.right - tmp.visrect.left,
|
|
||||||
tmp.visrect.bottom - tmp.visrect.top,
|
|
||||||
physdev->pict_format->depth );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
|
|
||||||
xrender_put_image( src_pixmap, src_pict, mask_pict, NULL, physdev->pict_format,
|
|
||||||
NULL, tmp_pixmap, src, &tmp, use_repeat );
|
|
||||||
execute_rop( physdev->x11dev, tmp_pixmap, gc, &dst->visrect, rop );
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
|
||||||
XFreePixmap( gdi_display, tmp_pixmap );
|
|
||||||
XFreeGC( gdi_display, gc );
|
|
||||||
wine_tsx11_unlock();
|
|
||||||
|
|
||||||
if (restore_region) restore_clipping_region( physdev->x11dev );
|
|
||||||
}
|
|
||||||
else xrender_put_image( src_pixmap, src_pict, mask_pict, clip,
|
|
||||||
physdev->pict_format, physdev, 0, src, dst, use_repeat );
|
|
||||||
|
|
||||||
add_device_bounds( physdev->x11dev, &dst->visrect );
|
|
||||||
}
|
|
||||||
|
|
||||||
wine_tsx11_lock();
|
wine_tsx11_lock();
|
||||||
pXRenderFreePicture( gdi_display, src_pict );
|
pXRenderFreePicture( gdi_display, src_pict );
|
||||||
@ -2292,9 +2256,8 @@ update_format:
|
|||||||
return ERROR_BAD_FORMAT;
|
return ERROR_BAD_FORMAT;
|
||||||
|
|
||||||
x11drv_fallback:
|
x11drv_fallback:
|
||||||
if (hbitmap) return X11DRV_PutImage( dev, hbitmap, clip, info, bits, src, dst, rop );
|
|
||||||
dev = GET_NEXT_PHYSDEV( dev, pPutImage );
|
dev = GET_NEXT_PHYSDEV( dev, pPutImage );
|
||||||
return dev->funcs->pPutImage( dev, hbitmap, clip, info, bits, src, dst, rop );
|
return dev->funcs->pPutImage( dev, clip, info, bits, src, dst, rop );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2665,7 +2628,7 @@ static const struct gdi_dc_funcs xrender_funcs =
|
|||||||
NULL, /* pGetGlyphIndices */
|
NULL, /* pGetGlyphIndices */
|
||||||
NULL, /* pGetGlyphOutline */
|
NULL, /* pGetGlyphOutline */
|
||||||
NULL, /* pGetICMProfile */
|
NULL, /* pGetICMProfile */
|
||||||
xrenderdrv_GetImage, /* pGetImage */
|
NULL, /* pGetImage */
|
||||||
NULL, /* pGetKerningPairs */
|
NULL, /* pGetKerningPairs */
|
||||||
NULL, /* pGetNearestColor */
|
NULL, /* pGetNearestColor */
|
||||||
NULL, /* pGetOutlineTextMetrics */
|
NULL, /* pGetOutlineTextMetrics */
|
||||||
|
@ -110,7 +110,7 @@ struct gdi_dc_funcs
|
|||||||
DWORD (*pGetGlyphIndices)(PHYSDEV,LPCWSTR,INT,LPWORD,DWORD);
|
DWORD (*pGetGlyphIndices)(PHYSDEV,LPCWSTR,INT,LPWORD,DWORD);
|
||||||
DWORD (*pGetGlyphOutline)(PHYSDEV,UINT,UINT,LPGLYPHMETRICS,DWORD,LPVOID,const MAT2*);
|
DWORD (*pGetGlyphOutline)(PHYSDEV,UINT,UINT,LPGLYPHMETRICS,DWORD,LPVOID,const MAT2*);
|
||||||
BOOL (*pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR);
|
BOOL (*pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR);
|
||||||
DWORD (*pGetImage)(PHYSDEV,HBITMAP,BITMAPINFO*,struct gdi_image_bits*,struct bitblt_coords*);
|
DWORD (*pGetImage)(PHYSDEV,BITMAPINFO*,struct gdi_image_bits*,struct bitblt_coords*);
|
||||||
DWORD (*pGetKerningPairs)(PHYSDEV,DWORD,LPKERNINGPAIR);
|
DWORD (*pGetKerningPairs)(PHYSDEV,DWORD,LPKERNINGPAIR);
|
||||||
COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
|
COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF);
|
||||||
UINT (*pGetOutlineTextMetrics)(PHYSDEV,UINT,LPOUTLINETEXTMETRICW);
|
UINT (*pGetOutlineTextMetrics)(PHYSDEV,UINT,LPOUTLINETEXTMETRICW);
|
||||||
@ -142,7 +142,7 @@ struct gdi_dc_funcs
|
|||||||
BOOL (*pPolygon)(PHYSDEV,const POINT*,INT);
|
BOOL (*pPolygon)(PHYSDEV,const POINT*,INT);
|
||||||
BOOL (*pPolyline)(PHYSDEV,const POINT*,INT);
|
BOOL (*pPolyline)(PHYSDEV,const POINT*,INT);
|
||||||
BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT);
|
BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT);
|
||||||
DWORD (*pPutImage)(PHYSDEV,HBITMAP,HRGN,BITMAPINFO*,const struct gdi_image_bits*,struct bitblt_coords*,struct bitblt_coords*,DWORD);
|
DWORD (*pPutImage)(PHYSDEV,HRGN,BITMAPINFO*,const struct gdi_image_bits*,struct bitblt_coords*,struct bitblt_coords*,DWORD);
|
||||||
UINT (*pRealizeDefaultPalette)(PHYSDEV);
|
UINT (*pRealizeDefaultPalette)(PHYSDEV);
|
||||||
UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
|
UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL);
|
||||||
BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
|
BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT);
|
||||||
@ -211,7 +211,7 @@ struct gdi_dc_funcs
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* increment this when you change the DC function table */
|
/* increment this when you change the DC function table */
|
||||||
#define WINE_GDI_DRIVER_VERSION 29
|
#define WINE_GDI_DRIVER_VERSION 30
|
||||||
|
|
||||||
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
|
#define GDI_PRIORITY_NULL_DRV 0 /* null driver */
|
||||||
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
#define GDI_PRIORITY_FONT_DRV 100 /* any font driver */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user