xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Apr 21 22:01:38 PDT 2014


 Xext/xres.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f466fb2432292d74123d701764c432d3aa75ef1d
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 10 11:45:37 2014 -0400

    xres: Fix size estimation for <8bpp pixmaps (#69057)
    
    Just use floats, it's not like this is a performance path.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xres.c b/Xext/xres.c
index b26cbb5..546b942 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -353,9 +353,9 @@ static unsigned long
 ResGetApproxPixmapBytes(PixmapPtr pix)
 {
     unsigned long nPixels;
-    int bytesPerPixel;
+    float bytesPerPixel;
 
-    bytesPerPixel = pix->drawable.bitsPerPixel >> 3;
+    bytesPerPixel = (float)pix->drawable.bitsPerPixel / 8.0;
     nPixels = pix->drawable.width * pix->drawable.height;
 
     /* Divide by refcnt as pixmap could be shared between clients,  


More information about the xorg-commit mailing list