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@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
		
							parent
							
								
									5df66822c9
								
							
						
					
					
						commit
						f466fb2432
					
				|  | @ -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,  
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue