x11drv: implement X11DRV_AlphaRender for non bitmap sources

Alexandre Julliard julliard at winehq.org
Thu Feb 7 04:36:36 CST 2008


Aric Stewart <aric at codeweavers.com> writes:

> @@ -1569,12 +1570,14 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
>  
>      if (!devSrc->bitmap || GetObjectW( devSrc->bitmap->hbitmap, sizeof(dib), &dib ) != sizeof(dib))
>      {
> -        FIXME("not a dibsection\n");
> -        return FALSE;
> +        TRACE("not a dibsection\n");
> +        bitmap = FALSE;

It can be an invalid handle too, you can't assume that it's a valid
bitmap just because it isn't a DIB. Also naming the boolean 'bitmap' for
the DIB section case is very confusing, both are bitmaps.
>  
> -    if (xSrc < 0 || ySrc < 0 || widthSrc < 0 || heightSrc < 0 || xSrc + widthSrc > dib.dsBmih.biWidth
> -        || ySrc + heightSrc > abs(dib.dsBmih.biHeight))
> +    if (xSrc < 0 || ySrc < 0 || widthSrc < 0 || heightSrc < 0 || (bitmap && xSrc + widthSrc > dib.dsBmih.biWidth)
> +        || (bitmap && ySrc + heightSrc > abs(dib.dsBmih.biHeight)))

Testing the flag all over the place is ugly, you should separate the
code completely, have one block for DIBs and one block for DDBs, with a
single if at the top.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list