diff options
author | Erkki Seppälä <erkki.seppala@vincit.fi> | 2010-12-08 17:09:30 +0200 |
---|---|---|
committer | Erkki Seppälä <erkki.seppala@vincit.fi> | 2012-04-18 12:49:11 +0300 |
commit | 233eab4d05cae1fdb4129a2e9905961b78693f74 (patch) | |
tree | 337499ce8916b94049618f0c91d481b03a03a9e1 /render | |
parent | ccb3e78124fb05defd0c9b438746b79d84dfc3ae (diff) |
dix: add reference count of the resource to ResourceSizeRec
The ResourceSizeRec now contains the number of references to the
resource. For example a Pixmap knows this value and it can be useful
for determining the "weight" of the resource. Typically this value
is 1.
Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Diffstat (limited to 'render')
-rw-r--r-- | render/picture.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/render/picture.c b/render/picture.c index 24b6ba0b6..da3e49936 100644 --- a/render/picture.c +++ b/render/picture.c @@ -600,12 +600,14 @@ GetPictureBytes(pointer value, XID id, ResourceSizePtr size) /* Currently only pixmap bytes are reported to clients. */ size->resourceSize = 0; + size->refCnt = picture->refcnt; + /* Calculate pixmap reference sizes. */ size->pixmapRefSize = 0; if (picture->pDrawable && (picture->pDrawable->type == DRAWABLE_PIXMAP)) { SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); - ResourceSizeRec pixmapSize = { 0, 0 }; + ResourceSizeRec pixmapSize = { 0, 0, 0 }; PixmapPtr pixmap = (PixmapPtr)picture->pDrawable; pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); size->pixmapRefSize += pixmapSize.pixmapRefSize; |