[PATCH xserver 1/3] res: Simplify QueryClientPixmapBytes

Adam Jackson ajax at redhat.com
Wed Feb 3 15:18:51 CET 2016


On Wed, 2016-02-03 at 21:34 +1100, Keith Packard wrote:
> Adam Jackson <ajax at redhat.com> writes:
> 
> > I suspect this code predates the common resource hooks for computing
> > sizes.  It's ugly in any case since the Resource extension shouldn't
> > need to know which extensions can take a reference on pixmaps.  Instead,
> > let's just walk every resource for the client and sum up all the pixmap
> > bytes that way.
> 
> This will miss pixmaps which are not referenced by the resource db,
> including all redirect pixmaps.

ResFindResourcePixmaps will call the size function for every type; for
windows that's GetWindowBytes, which does account for background and
border pixmaps, likewise the GC size func accounts for tiles and
stipples.

This code does remove the accounting for redirect pixmaps, which is
intentional, because that code is wrong. The commit message for 2/3
covers this, and introduces correct accounting by wrapping
GetWindowBytes. And 3/3 cleans up the case of a GLXPixmap holding the
only reference to a pixmap.

I don't really understand your objection about pixmaps not in the
resdb, because ResQueryClientPixmapBytes is _already_ not accounting
for those, and it's not clear to me how it even could.

- ajax


More information about the xorg-devel mailing list