Commit d4dc8fd2 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

gdi32: Move the loop through each clipped rectangle to the primitive blend funcs.

This is to prepare so we don't recalculate the lookup cache map for color tables on every clipped rect (which is expensive). Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e9412a8a
......@@ -584,17 +584,15 @@ static void mask_rect( dib_info *dst, const RECT *dst_rect, const dib_info *src,
static DWORD blend_rect( dib_info *dst, const RECT *dst_rect, const dib_info *src, const RECT *src_rect,
HRGN clip, BLENDFUNCTION blend )
{
POINT origin;
POINT offset;
struct clipped_rects clipped_rects;
int i;
if (!get_clipped_rects( dst, dst_rect, clip, &clipped_rects )) return ERROR_SUCCESS;
for (i = 0; i < clipped_rects.count; i++)
{
origin.x = src_rect->left + clipped_rects.rects[i].left - dst_rect->left;
origin.y = src_rect->top + clipped_rects.rects[i].top - dst_rect->top;
dst->funcs->blend_rect( dst, &clipped_rects.rects[i], src, &origin, blend );
}
offset.x = src_rect->left - dst_rect->left;
offset.y = src_rect->top - dst_rect->top;
dst->funcs->blend_rects( dst, clipped_rects.count, clipped_rects.rects, src, &offset, blend );
free_clipped_rects( &clipped_rects );
return ERROR_SUCCESS;
}
......
......@@ -189,8 +189,8 @@ typedef struct primitive_funcs
const dib_info *brush, const rop_mask_bits *bits);
void (* copy_rect)(const dib_info *dst, const RECT *rc, const dib_info *src,
const POINT *origin, int rop2, int overlap);
void (* blend_rect)(const dib_info *dst, const RECT *rc, const dib_info *src,
const POINT *origin, BLENDFUNCTION blend);
void (* blend_rects)(const dib_info *dst, int num, const RECT *rc, const dib_info *src,
const POINT *offset, BLENDFUNCTION blend);
BOOL (* gradient_rect)(const dib_info *dib, const RECT *rc, const TRIVERTEX *v, int mode);
void (* mask_rect)(const dib_info *dst, const RECT *rc, const dib_info *src,
const POINT *origin, int rop2);
......
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