From: Byeongsik Jeon Subject: [PATCH 3/3] dibdrv: Small simplication using blend_color(). Message-Id: <20181011131214.11771-3-bsjeon@hanmail.net> Date: Thu, 11 Oct 2018 22:12:14 +0900 In-Reply-To: <20181011131214.11771-1-bsjeon@hanmail.net> References: <20181011131214.11771-1-bsjeon@hanmail.net> Signed-off-by: Byeongsik Jeon --- dlls/gdi32/dibdrv/primitives.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/dibdrv/primitives.c b/dlls/gdi32/dibdrv/primitives.c index ecdf52c7cc..c300051c38 100644 --- a/dlls/gdi32/dibdrv/primitives.c +++ b/dlls/gdi32/dibdrv/primitives.c @@ -6052,12 +6052,12 @@ static const BYTE ramp[17] = static inline BYTE aa_color( BYTE dst, BYTE text, BYTE alpha ) { + BYTE intensity; + if (dst == text) return dst; - if (dst > text) - return ( text * ( 0xff - ramp[16 - alpha] ) + dst * ramp[16 - alpha] ) / 0xff; - else - return ( text * ramp[alpha] + dst * ( 0xff - ramp[alpha] ) ) / 0xff; + intensity = ( dst > text )? 0xff - ramp[16 - alpha] : ramp[alpha]; + return blend_color( dst, text, intensity ); } static inline DWORD aa_rgb( BYTE r_dst, BYTE g_dst, BYTE b_dst, DWORD text, BYTE alpha ) -- 2.19.1