[winex11.drv] client-side DIB copy

Alexandre Julliard julliard at winehq.org
Mon Oct 16 04:20:26 CDT 2006


"Damjan Jovanovic" <damjan.jov at gmail.com> writes:

> +    switch (dstDib.dsBm.bmBitsPixel)
> +    {
> +      case 1:
> +        widthBytes = (width + 7) / 8;
> +        srcOffsetBytes = (xSrc + 7) / 8;
> +        dstOffsetBytes = (xDst + 7) / 8;
> +        break;
> +      case 4:
> +        widthBytes = (width + 1) / 2;
> +        srcOffsetBytes = (xSrc + 1) / 2;
> +        dstOffsetBytes = (xDst + 1) / 2;
> +        break;

You can't simply round size up, you have to handle partial bytes
properly.

> +      case 24:
> +        widthBytes = width * 2;
> +        srcOffsetBytes = xSrc * 2;
> +        dstOffsetBytes = xDst * 2;
> +        break;

I don't think you can fix 24 bits in two bytes...

A bigger problem is that you also need to handle the clip region of
the destination DC, and only copy the pixels that aren't clipped out.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list