qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs x11.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs x11.c
Date: Fri, 5 May 2017 16:05:35 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        17/05/05 16:05:35

Modified files:
        .              : x11.c 

Log message:
        x11: fix QEPicture format for 24 bit depth with 32 bits per pixel

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/x11.c?cvsroot=qemacs&r1=1.53&r2=1.54

Patches:
Index: x11.c
===================================================================
RCS file: /sources/qemacs/qemacs/x11.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- x11.c       3 May 2017 10:08:16 -0000       1.53
+++ x11.c       5 May 2017 20:05:35 -0000       1.54
@@ -1808,7 +1808,6 @@
 {
     X11State *xs = s->priv_data;
     X11Bitmap *xb = b->priv_data;
-    int bpp;
 
     pict->width = w1;
     pict->height = h1;
@@ -1825,16 +1824,28 @@
             xb->ximage_lock = ximage;
             xb->x_lock = x1;
             xb->y_lock = y1;
+            if (ximage->bits_per_pixel == 32) {
+                /* adjust format from QEBITMAP_FORMAT_RGB24 to PIX_FMT_BGR0
+                   on little endian architectures */
+                pict->format = QEBITMAP_FORMAT_RGBA32;
+            }
         }
         break;
     case BMP_XIMAGE:
 #ifdef CONFIG_XSHM
     case BMP_XSHMIMAGE:
 #endif
-        bpp = (xb->u.ximage->bits_per_pixel + 7) >> 3;
+        {
+            int bpp = (xb->u.ximage->bits_per_pixel + 7) >> 3;
         pict->data[0] = (unsigned char *)xb->u.ximage->data +
                         y1 * xb->u.ximage->bytes_per_line + x1 * bpp;
         pict->linesize[0] = xb->u.ximage->bytes_per_line;
+            if (bpp == 4) {
+                /* adjust format from QEBITMAP_FORMAT_RGB24 to PIX_FMT_BGR0
+                   on little endian architectures */
+                pict->format = QEBITMAP_FORMAT_RGBA32;
+            }
+        }
         break;
 #ifdef CONFIG_XV
     case BMP_XVIMAGE:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]