gdi32: Take into account the DIB rectangles when determining overlap for blits.

This commit is contained in:
Alexandre Julliard 2012-06-04 20:44:24 +02:00
parent 90f93e3819
commit 319a87c86e
1 changed files with 6 additions and 6 deletions

View File

@ -438,11 +438,11 @@ static int get_overlap( const dib_info *dst, const RECT *dst_rect,
int height, ret = 0; int height, ret = 0;
if (dst->stride != src->stride) return 0; /* can't be the same dib */ if (dst->stride != src->stride) return 0; /* can't be the same dib */
if (dst_rect->right <= src_rect->left) return 0; if (dst->rect.left + dst_rect->right <= src->rect.left + src_rect->left) return 0;
if (dst_rect->left >= src_rect->right) return 0; if (dst->rect.left + dst_rect->left >= src->rect.left + src_rect->right) return 0;
src_top = (const char *)src->bits.ptr + src_rect->top * src->stride; src_top = (const char *)src->bits.ptr + (src->rect.top + src_rect->top) * src->stride;
dst_top = (const char *)dst->bits.ptr + dst_rect->top * dst->stride; dst_top = (const char *)dst->bits.ptr + (dst->rect.top + dst_rect->top) * dst->stride;
height = (dst_rect->bottom - dst_rect->top) * dst->stride; height = (dst_rect->bottom - dst_rect->top) * dst->stride;
if (dst->stride > 0) if (dst->stride > 0)
@ -460,8 +460,8 @@ static int get_overlap( const dib_info *dst, const RECT *dst_rect,
else if (dst_top < src_top) ret |= OVERLAP_BELOW; else if (dst_top < src_top) ret |= OVERLAP_BELOW;
} }
if (dst_rect->left < src_rect->left) ret |= OVERLAP_LEFT; if (dst->rect.left + dst_rect->left < src->rect.left + src_rect->left) ret |= OVERLAP_LEFT;
else if (dst_rect->left > src_rect->left) ret |= OVERLAP_RIGHT; else if (dst->rect.left + dst_rect->left > src->rect.left + src_rect->left) ret |= OVERLAP_RIGHT;
return ret; return ret;
} }