gdi32: Get rid of the return value in DIB conversion functions, they never fail now.

This commit is contained in:
Alexandre Julliard 2011-10-13 00:15:29 +02:00
parent 587f492fdf
commit a413916802
4 changed files with 15 additions and 68 deletions

View File

@ -290,7 +290,8 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
__TRY
{
ret = dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
dst_dib.funcs->convert_to( &dst_dib, &src_dib, &src->visrect );
ret = TRUE;
}
__EXCEPT_PAGE_FAULT
{

View File

@ -141,7 +141,7 @@ typedef struct primitive_funcs
void (* copy_rect)(const dib_info *dst, const RECT *rc, const dib_info *src,
const POINT *origin, int rop2, int overlap);
DWORD (* colorref_to_pixel)(const dib_info *dib, COLORREF color);
BOOL (* convert_to)(dib_info *dst, const dib_info *src, const RECT *src_rect);
void (* convert_to)(dib_info *dst, const dib_info *src, const RECT *src_rect);
BOOL (* create_rop_masks)(const dib_info *dib, const dib_info *hatch,
const rop_mask *fg, const rop_mask *bg, rop_mask_bits *bits);
void (* stretch_row)(const dib_info *dst_dib, const POINT *dst_start,

View File

@ -1349,13 +1349,9 @@ HBRUSH dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
rect.right = orig_dib.width;
rect.bottom = orig_dib.height;
if(pdev->brush_dib.funcs->convert_to(&pdev->brush_dib, &orig_dib, &rect))
{
pdev->brush_rects = pattern_brush;
pdev->defer &= ~DEFER_BRUSH;
}
else
free_dib_info(&pdev->brush_dib);
pdev->brush_dib.funcs->convert_to(&pdev->brush_dib, &orig_dib, &rect);
pdev->brush_rects = pattern_brush;
pdev->defer &= ~DEFER_BRUSH;
free_dib_info(&orig_dib);
}
GlobalUnlock((HGLOBAL)logbrush.lbHatch);

View File

@ -1141,7 +1141,7 @@ static inline BOOL bit_fields_match(const dib_info *d1, const dib_info *d2)
d1->blue_mask == d2->blue_mask;
}
static BOOL convert_to_8888(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_8888(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
DWORD *dst_start = get_pixel_ptr_32(dst, 0, 0), *dst_pixel, src_val;
int x, y, pad_size = (dst->width - (src_rect->right - src_rect->left)) * 4;
@ -1376,16 +1376,10 @@ static BOOL convert_to_8888(dib_info *dst, const dib_info *src, const RECT *src_
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 8888\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_32(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_32(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
DWORD *dst_start = get_pixel_ptr_32(dst, 0, 0), *dst_pixel, src_val;
int x, y, pad_size = (dst->width - (src_rect->right - src_rect->left)) * 4;
@ -1648,16 +1642,10 @@ static BOOL convert_to_32(dib_info *dst, const dib_info *src, const RECT *src_re
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 32\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_24(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_24(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
BYTE *dst_start = get_pixel_ptr_24(dst, 0, 0), *dst_pixel;
DWORD src_val;
@ -1897,16 +1885,10 @@ static BOOL convert_to_24(dib_info *dst, const dib_info *src, const RECT *src_re
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 24\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_555(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_555(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
WORD *dst_start = get_pixel_ptr_16(dst, 0, 0), *dst_pixel;
INT x, y, pad_size = ((dst->width + 1) & ~1) * 2 - (src_rect->right - src_rect->left) * 2;
@ -2145,16 +2127,10 @@ static BOOL convert_to_555(dib_info *dst, const dib_info *src, const RECT *src_r
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 555\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_16(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_16(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
WORD *dst_start = get_pixel_ptr_16(dst, 0, 0), *dst_pixel;
INT x, y, pad_size = ((dst->width + 1) & ~1) * 2 - (src_rect->right - src_rect->left) * 2;
@ -2417,13 +2393,7 @@ static BOOL convert_to_16(dib_info *dst, const dib_info *src, const RECT *src_re
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 16\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static inline BOOL color_tables_match(const dib_info *d1, const dib_info *d2)
@ -2434,7 +2404,7 @@ static inline BOOL color_tables_match(const dib_info *d1, const dib_info *d2)
return !memcmp(d1->color_table, d2->color_table, d1->color_table_size * sizeof(d1->color_table[0]));
}
static BOOL convert_to_8(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_8(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
BYTE *dst_start = get_pixel_ptr_8(dst, 0, 0), *dst_pixel;
INT x, y, pad_size = ((dst->width + 3) & ~3) - (src_rect->right - src_rect->left);
@ -2695,16 +2665,10 @@ static BOOL convert_to_8(dib_info *dst, const dib_info *src, const RECT *src_rec
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 8\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_4(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_4(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
BYTE *dst_start = get_pixel_ptr_4(dst, 0, 0), *dst_pixel, dst_val;
INT x, y, pad_size = ((dst->width + 7) & ~7) / 2 - (src_rect->right - src_rect->left + 1) / 2;
@ -3088,17 +3052,10 @@ static BOOL convert_to_4(dib_info *dst, const dib_info *src, const RECT *src_rec
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 4\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_1(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_1(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
BYTE *dst_start = get_pixel_ptr_1(dst, 0, 0), *dst_pixel, dst_val;
INT x, y, pad_size = ((dst->width + 31) & ~31) / 8 - (src_rect->right - src_rect->left + 7) / 8;
@ -3490,18 +3447,11 @@ static BOOL convert_to_1(dib_info *dst, const dib_info *src, const RECT *src_rec
}
break;
}
default:
FIXME("Unsupported conversion: %d -> 1\n", src->bit_count);
return FALSE;
}
return TRUE;
}
static BOOL convert_to_null(dib_info *dst, const dib_info *src, const RECT *src_rect)
static void convert_to_null(dib_info *dst, const dib_info *src, const RECT *src_rect)
{
return FALSE;
}
static BOOL create_rop_masks_32(const dib_info *dib, const dib_info *hatch, const rop_mask *fg, const rop_mask *bg, rop_mask_bits *bits)