Commit db3a8d6c authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Avoid binary ROPs when shrinking in DELETESCANS mode.

parent 6f6e919e
......@@ -5950,24 +5950,42 @@ static void shrink_row_32(const dib_info *dst_dib, const POINT *dst_start,
DWORD *src_ptr = get_pixel_ptr_32( src_dib, src_start->x, src_start->y );
int err = params->err_start;
int width;
struct rop_codes codes;
DWORD init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
if (mode == STRETCH_DELETESCANS)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_32( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
for (width = params->length; width; width--)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
*dst_ptr = *src_ptr;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes;
DWORD init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_32( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
}
else err += params->err_add_2;
}
else err += params->err_add_2;
}
}
......@@ -5980,26 +5998,46 @@ static void shrink_row_24(const dib_info *dst_dib, const POINT *dst_start,
BYTE *src_ptr = get_pixel_ptr_24( src_dib, src_start->x, src_start->y );
int err = params->err_start;
int width;
struct rop_codes codes;
BYTE init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
if (mode == STRETCH_DELETESCANS)
{
if (new_pix && !keep_dst) memset( dst_ptr, init_val, 3 );
do_rop_codes_8( dst_ptr, *src_ptr, &codes );
do_rop_codes_8( dst_ptr + 1, *(src_ptr + 1), &codes );
do_rop_codes_8( dst_ptr + 2, *(src_ptr + 2), &codes );
new_pix = FALSE;
src_ptr += 3 * params->src_inc;
if (err > 0)
for (width = params->length; width; width--)
{
dst_ptr += 3 * params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
dst_ptr[0] = src_ptr[0];
dst_ptr[1] = src_ptr[1];
dst_ptr[2] = src_ptr[2];
src_ptr += 3 * params->src_inc;
if (err > 0)
{
dst_ptr += 3 * params->dst_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes;
BYTE init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
if (new_pix && !keep_dst) memset( dst_ptr, init_val, 3 );
do_rop_codes_8( dst_ptr, *src_ptr, &codes );
do_rop_codes_8( dst_ptr + 1, *(src_ptr + 1), &codes );
do_rop_codes_8( dst_ptr + 2, *(src_ptr + 2), &codes );
new_pix = FALSE;
src_ptr += 3 * params->src_inc;
if (err > 0)
{
dst_ptr += 3 * params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
}
else err += params->err_add_2;
}
else err += params->err_add_2;
}
}
......@@ -6012,24 +6050,42 @@ static void shrink_row_16(const dib_info *dst_dib, const POINT *dst_start,
WORD *src_ptr = get_pixel_ptr_16( src_dib, src_start->x, src_start->y );
int err = params->err_start;
int width;
struct rop_codes codes;
WORD init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
if (mode == STRETCH_DELETESCANS)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_16( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
for (width = params->length; width; width--)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
*dst_ptr = *src_ptr;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes;
WORD init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_16( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
}
else err += params->err_add_2;
}
else err += params->err_add_2;
}
}
......@@ -6042,24 +6098,42 @@ static void shrink_row_8(const dib_info *dst_dib, const POINT *dst_start,
BYTE *src_ptr = get_pixel_ptr_8( src_dib, src_start->x, src_start->y );
int err = params->err_start;
int width;
struct rop_codes codes;
BYTE init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
if (mode == STRETCH_DELETESCANS)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_8( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
for (width = params->length; width; width--)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
*dst_ptr = *src_ptr;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes;
BYTE init_val = (mode == STRETCH_ANDSCANS) ? ~0u : 0u;
BOOL new_pix = TRUE;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
if (new_pix && !keep_dst) *dst_ptr = init_val;
do_rop_codes_8( dst_ptr, *src_ptr, &codes );
new_pix = FALSE;
src_ptr += params->src_inc;
if (err > 0)
{
dst_ptr += params->dst_inc;
new_pix = TRUE;
err += params->err_add_1;
}
else err += params->err_add_2;
}
else err += params->err_add_2;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment