Alexandre Julliard : gdi32: Don' t copy unnecessary rows when shrinking in DELETESCANS mode.
Alexandre Julliard
julliard at winehq.org
Mon Dec 3 13:33:57 CST 2012
Module: wine
Branch: master
Commit: 3a4864714dcf515ce1c3271280d68a93591eb3a1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a4864714dcf515ce1c3271280d68a93591eb3a1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Dec 3 17:48:16 2012 +0100
gdi32: Don't copy unnecessary rows when shrinking in DELETESCANS mode.
---
dlls/gdi32/dibdrv/bitblt.c | 5 ++---
dlls/gdi32/dibdrv/primitives.c | 10 ++++++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c
index e65dcbc..a9c32bf 100644
--- a/dlls/gdi32/dibdrv/bitblt.c
+++ b/dlls/gdi32/dibdrv/bitblt.c
@@ -1230,12 +1230,11 @@ DWORD stretch_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit
else
{
int merged_rows = 0;
- int faster_mode = mode;
while (v_params.length--)
{
- if (hstretch) faster_mode = merged_rows ? mode : STRETCH_DELETESCANS;
- row_fn( &dst_dib, &dst_start, &src_dib, &src_start, &h_params, faster_mode, merged_rows != 0 );
+ if (mode != STRETCH_DELETESCANS || !merged_rows)
+ row_fn( &dst_dib, &dst_start, &src_dib, &src_start, &h_params, mode, merged_rows != 0 );
merged_rows++;
if (err > 0)
diff --git a/dlls/gdi32/dibdrv/primitives.c b/dlls/gdi32/dibdrv/primitives.c
index d4c9fc3..1569bc0 100644
--- a/dlls/gdi32/dibdrv/primitives.c
+++ b/dlls/gdi32/dibdrv/primitives.c
@@ -5698,7 +5698,7 @@ static void stretch_row_32(const dib_info *dst_dib, const POINT *dst_start,
int err = params->err_start;
int width;
- if (mode == STRETCH_DELETESCANS)
+ if (mode == STRETCH_DELETESCANS || !keep_dst)
{
for (width = params->length; width; width--)
{
@@ -5741,7 +5741,7 @@ static void stretch_row_24(const dib_info *dst_dib, const POINT *dst_start,
int err = params->err_start;
int width;
- if (mode == STRETCH_DELETESCANS)
+ if (mode == STRETCH_DELETESCANS || !keep_dst)
{
for (width = params->length; width; width--)
{
@@ -5788,7 +5788,7 @@ static void stretch_row_16(const dib_info *dst_dib, const POINT *dst_start,
int err = params->err_start;
int width;
- if (mode == STRETCH_DELETESCANS)
+ if (mode == STRETCH_DELETESCANS || !keep_dst)
{
for (width = params->length; width; width--)
{
@@ -5831,7 +5831,7 @@ static void stretch_row_8(const dib_info *dst_dib, const POINT *dst_start,
int err = params->err_start;
int width;
- if (mode == STRETCH_DELETESCANS)
+ if (mode == STRETCH_DELETESCANS || !keep_dst)
{
for (width = params->length; width; width--)
{
@@ -5876,6 +5876,7 @@ static void stretch_row_4(const dib_info *dst_dib, const POINT *dst_start,
struct rop_codes codes;
BYTE src_val;
+ if (!keep_dst) mode = STRETCH_DELETESCANS;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
@@ -5911,6 +5912,7 @@ static void stretch_row_1(const dib_info *dst_dib, const POINT *dst_start,
struct rop_codes codes;
BYTE src_val;
+ if (!keep_dst) mode = STRETCH_DELETESCANS;
rop_codes_from_stretch_mode( mode, &codes );
for (width = params->length; width; width--)
{
More information about the wine-cvs
mailing list