[PATCH v2 2/2] gdi32: Remove the branch and unnecessary operation in the loop.

Huw Davies huw at codeweavers.com
Tue Oct 9 05:36:38 CDT 2018


On Tue, Oct 09, 2018 at 02:11:08PM +0900, Byeongsik Jeon wrote:
> * 'if' branch removed in the loop.
> * glyph bitmap data is alpha value. Shift 24 part is unnecessary.

Please put the '24' part in a separate patch.

> 
> Signed-off-by: Byeongsik Jeon <bsjeon at hanmail.net>
> ---
>  dlls/gdi32/freetype.c | 27 +++++++++++----------------
>  1 file changed, 11 insertions(+), 16 deletions(-)
> 
> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
> index b95d223138..0d34da216b 100644
> --- a/dlls/gdi32/freetype.c
> +++ b/dlls/gdi32/freetype.c
> @@ -7323,7 +7323,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
>              BYTE *src;
>              INT x, src_pitch, src_width, src_height, rgb_interval, hmul, vmul;
>              INT x_shift, y_shift;
> -            BOOL rgb;
> +            INT rgb[3] = { 0, 1, 2 }; /* WINE_GGO_{H,V}RGB_BITMAP */

Perhaps something like this is cleaner:

const INT *sub_order
const INT rgb_order[3] = { 0, 1, 2 };
const INT bgr_order[3] = { 2, 1, 0 };

sub_order = (format == WINE_GGO_HBRG_BITMAP || format == WINE_GGO_VGR_BITAMP) ?
      bgr_order : rgb_order;

Huw.



More information about the wine-devel mailing list