Commit 6f6e919e authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Avoid binary ROPs when stretching in DELETESCANS mode.

parent 8e654857
...@@ -5697,6 +5697,23 @@ static void stretch_row_32(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5697,6 +5697,23 @@ static void stretch_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 ); DWORD *src_ptr = get_pixel_ptr_32( src_dib, src_start->x, src_start->y );
int err = params->err_start; int err = params->err_start;
int width; int width;
if (mode == STRETCH_DELETESCANS)
{
for (width = params->length; width; width--)
{
*dst_ptr = *src_ptr;
dst_ptr += params->dst_inc;
if (err > 0)
{
src_ptr += params->src_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes; struct rop_codes codes;
rop_codes_from_stretch_mode( mode, &codes ); rop_codes_from_stretch_mode( mode, &codes );
...@@ -5711,6 +5728,7 @@ static void stretch_row_32(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5711,6 +5728,7 @@ static void stretch_row_32(const dib_info *dst_dib, const POINT *dst_start,
} }
else err += params->err_add_2; else err += params->err_add_2;
} }
}
} }
static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start, static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start,
...@@ -5722,6 +5740,25 @@ static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5722,6 +5740,25 @@ static void stretch_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 ); BYTE *src_ptr = get_pixel_ptr_24( src_dib, src_start->x, src_start->y );
int err = params->err_start; int err = params->err_start;
int width; int width;
if (mode == STRETCH_DELETESCANS)
{
for (width = params->length; width; width--)
{
dst_ptr[0] = src_ptr[0];
dst_ptr[1] = src_ptr[1];
dst_ptr[2] = src_ptr[2];
dst_ptr += 3 * params->dst_inc;
if (err > 0)
{
src_ptr += 3 * params->src_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes; struct rop_codes codes;
rop_codes_from_stretch_mode( mode, &codes ); rop_codes_from_stretch_mode( mode, &codes );
...@@ -5738,6 +5775,7 @@ static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5738,6 +5775,7 @@ static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start,
} }
else err += params->err_add_2; else err += params->err_add_2;
} }
}
} }
static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start, static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start,
...@@ -5749,6 +5787,23 @@ static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5749,6 +5787,23 @@ static void stretch_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 ); WORD *src_ptr = get_pixel_ptr_16( src_dib, src_start->x, src_start->y );
int err = params->err_start; int err = params->err_start;
int width; int width;
if (mode == STRETCH_DELETESCANS)
{
for (width = params->length; width; width--)
{
*dst_ptr = *src_ptr;
dst_ptr += params->dst_inc;
if (err > 0)
{
src_ptr += params->src_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes; struct rop_codes codes;
rop_codes_from_stretch_mode( mode, &codes ); rop_codes_from_stretch_mode( mode, &codes );
...@@ -5763,6 +5818,7 @@ static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5763,6 +5818,7 @@ static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start,
} }
else err += params->err_add_2; else err += params->err_add_2;
} }
}
} }
static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start, static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start,
...@@ -5774,6 +5830,23 @@ static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5774,6 +5830,23 @@ static void stretch_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 ); BYTE *src_ptr = get_pixel_ptr_8( src_dib, src_start->x, src_start->y );
int err = params->err_start; int err = params->err_start;
int width; int width;
if (mode == STRETCH_DELETESCANS)
{
for (width = params->length; width; width--)
{
*dst_ptr = *src_ptr;
dst_ptr += params->dst_inc;
if (err > 0)
{
src_ptr += params->src_inc;
err += params->err_add_1;
}
else err += params->err_add_2;
}
}
else
{
struct rop_codes codes; struct rop_codes codes;
rop_codes_from_stretch_mode( mode, &codes ); rop_codes_from_stretch_mode( mode, &codes );
...@@ -5788,6 +5861,7 @@ static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start, ...@@ -5788,6 +5861,7 @@ static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start,
} }
else err += params->err_add_2; else err += params->err_add_2;
} }
}
} }
static void stretch_row_4(const dib_info *dst_dib, const POINT *dst_start, static void stretch_row_4(const dib_info *dst_dib, const POINT *dst_start,
......
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