From 86158f938d5b33f28864ed82e0a05852fa11a10e Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Wed, 5 May 2021 22:08:09 +0800 Subject: [PATCH] fix bad definition of COLOR_BLEND_FLAGS_MASK --- include/gdi.h | 2 +- src/newgal/blit.c | 2 +- src/newgal/stretch.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index c662583f..98b3ee6c 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -5170,7 +5170,7 @@ MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y, */ typedef enum { COLOR_BLEND_LEGACY = 0, - COLOR_BLEND_FLAGS_MASK = 0xFFFFFF00, + COLOR_BLEND_FLAGS_MASK = 0x00FF, /** Porter Duff rule: clear */ COLOR_BLEND_PD_CLEAR = 0x0100, // PIXMAN_OP_CLEAR = 0x00 diff --git a/src/newgal/blit.c b/src/newgal/blit.c index 579b16e0..2211d87e 100644 --- a/src/newgal/blit.c +++ b/src/newgal/blit.c @@ -348,7 +348,7 @@ int GAL_SetupBlitting (GAL_Surface *src, GAL_Surface *dst, DWORD ops) else ctxt->msk_img = NULL; - ops &= ~COLOR_BLEND_FLAGS_MASK; + ops &= COLOR_BLEND_FLAGS_MASK; if (ops == COLOR_BLEND_LEGACY) { if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) { ctxt->op = PIXMAN_OP_OVER; diff --git a/src/newgal/stretch.c b/src/newgal/stretch.c index c9407af1..f122c460 100644 --- a/src/newgal/stretch.c +++ b/src/newgal/stretch.c @@ -295,7 +295,7 @@ int GAL_SetupStretchBlit (GAL_Surface *src, GAL_Rect *srcrect, ctxt->filter = PIXMAN_FILTER_FAST; } - ops &= ~COLOR_BLEND_FLAGS_MASK; + ops &= COLOR_BLEND_FLAGS_MASK; if (ops == COLOR_BLEND_LEGACY) { if ((src->flags & GAL_SRCPIXELALPHA) && src->format->Amask && src != dst) { ctxt->op = PIXMAN_OP_OVER; @@ -388,7 +388,7 @@ int GAL_StretchBlt (GAL_Surface *src, GAL_Rect *srcrect, if (src_img == NULL || dst_img == NULL || (src->flags & GAL_SRCCOLORKEY)) return GAL_StretchBltLegacy (src, srcrect, dst, dstrect, - ops & ~COLOR_BLEND_FLAGS_MASK); + ops & COLOR_BLEND_FLAGS_MASK); if (src->blit_ctxt) { GAL_BlittingContext* ctxt = src->blit_ctxt;