Created attachment 85383 [details] failing program If a pixmap has depth=1, ie. is a bitmap, then it doesn't count towards QueryResourceBytes in the X_Resource extension, whereas I thought that it would. The attached program foo.c when run under recent debian i386 xvfb test server 1.12.4 prints xvfb-run ./foo => pixmap 200001 bytes 0 where I hoped it would print "bytes 8192" or thereabouts. If you change the program to depth=8 in the XCreatePixmap() then it prints "bytes 65536" as expected. In Xext/xres.c ResGetApproxPixmapBytes() I suspect that the line bytesPerPixel = pix->drawable.bitsPerPixel >> 3; causes any bits-per-pixel less than 8 to be treated as 0, and thus not counted towards the client's pixmap bytes in use, no matter how big the width*height might be. I suppose calculating the size in bits and then dividing would be easy, but maybe care has to be taken against overflowing 32-bits in such a size. Perhaps if bitsPerPixel < 8 then divide nPixels/pixelsPerByte instead of the multiply nPixels*bytesPerPixel. Are rows always padded to a byte boundary? If so then a widthInBytes*height could be more accurate.
commit f466fb2432292d74123d701764c432d3aa75ef1d Author: Adam Jackson <ajax@redhat.com> Date: Thu Apr 10 11:45:37 2014 -0400 xres: Fix size estimation for <8bpp pixmaps (#69057)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.