diff options
author | Rami Ylimäki <rami.ylimaki@vincit.fi> | 2010-10-27 16:59:06 +0300 |
---|---|---|
committer | Erkki Seppälä <erkki.seppala@vincit.fi> | 2012-04-18 12:31:24 +0300 |
commit | e83388cc70e21e7f377ed2e417d04469e23eb706 (patch) | |
tree | dfbd34d2f494110e91ae6700a37417e336691577 /Xext | |
parent | 96864bfa951ea8bf4ab697753fc62c6a97598bc0 (diff) |
render: Report pixmap usage of pictures to resource extension.
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/xres.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Xext/xres.c b/Xext/xres.c index 4989d3e44..a0734098c 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -27,6 +27,7 @@ #include "list.h" #include "misc.h" #include <string.h> +#include "picturestr.h" /** @brief Holds fragments of responses for ConstructClientIds. * @@ -288,6 +289,17 @@ ResGetApproxPixmapBytes(PixmapPtr pix) } static void +ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata) +{ + SizeType sizeFunc = GetResourceTypeSizeFunc(type); + ResourceSizeRec size = { 0, 0 }; + unsigned long *bytes = cdata; + + sizeFunc(value, id, &size); + *bytes += size.pixmapRefSize; +} + +static void ResFindPixmaps(pointer value, XID id, pointer cdata) { unsigned long *bytes = (unsigned long *) cdata; @@ -322,6 +334,14 @@ ResFindGCPixmaps(pointer value, XID id, pointer cdata) *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap); } +static void +ResFindPicturePixmaps(pointer value, XID id, pointer cdata) +{ +#ifdef RENDER + ResFindResourcePixmaps(value, id, PictureType, cdata); +#endif +} + static int ProcXResQueryClientPixmapBytes(ClientPtr client) { @@ -356,6 +376,13 @@ ProcXResQueryClientPixmapBytes(ClientPtr client) FindClientResourcesByType(clients[clientID], RT_GC, ResFindGCPixmaps, (pointer) (&bytes)); +#ifdef RENDER + /* Render extension picture pixmaps. */ + FindClientResourcesByType(clients[clientID], PictureType, + ResFindPicturePixmaps, + (pointer)(&bytes)); +#endif + #ifdef COMPOSITE /* FIXME: include composite pixmaps too */ #endif |