[PATCH xserver 1/2] fb: Handle ZPixmap planemask in GetImage the other way around

Keith Packard keithp at keithp.com
Wed Sep 28 17:19:19 UTC 2016


Adam Jackson <ajax at redhat.com> writes:

> diff --git a/fb/fbimage.c b/fb/fbimage.c
> index 59daa21..8f5f3dc 100644
> --- a/fb/fbimage.c
> +++ b/fb/fbimage.c
> @@ -250,13 +250,16 @@ fbGetImage(DrawablePtr pDrawable,
>  
>          pm = fbReplicatePixel(planeMask, srcBpp);
>          dstStride = PixmapBytePad(w, pDrawable->depth);
> -        if (pm != FB_ALLONES)
> -            memset(d, 0, dstStride * h);
>          dstStride /= sizeof(FbStip);
>          fbBltStip((FbStip *) (src + (y + srcYoff) * srcStride),
>                    FbBitsStrideToStipStride(srcStride),
>                    (x + srcXoff) * srcBpp,
> -                  dst, dstStride, 0, w * srcBpp, h, GXcopy, pm, srcBpp);
> +                  dst, dstStride, 0, w * srcBpp, h, GXcopy, FB_ALLONES, srcBpp);
> +
> +        if (pm != FB_ALLONES) {
> +            for (int i = 0; i < dstStride * h; i++)
> +                dst[i] &= pm;
> +        }

You'll need to deal with 24bpp separately...

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160928/79660692/attachment.sig>


More information about the xorg-devel mailing list