aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-20 17:07:15 +0200
committermarha <marha@users.sourceforge.net>2012-04-20 17:07:15 +0200
commit0e3699334faf92f508b6c187a261548b656b0dd3 (patch)
tree28d7e84df7b54a3e6f85bf83e38efba937288fd3 /xorg-server/render
parentc1194ccd395fdbb23c9ab56bc340ee20a5feeb82 (diff)
downloadvcxsrv-0e3699334faf92f508b6c187a261548b656b0dd3.tar.gz
vcxsrv-0e3699334faf92f508b6c187a261548b656b0dd3.tar.bz2
vcxsrv-0e3699334faf92f508b6c187a261548b656b0dd3.zip
fontconfig libX11 mesa pixman xserver git update 20 april 2012
Diffstat (limited to 'xorg-server/render')
-rw-r--r--xorg-server/render/picture.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c
index 2fd13fc37..da3e49936 100644
--- a/xorg-server/render/picture.c
+++ b/xorg-server/render/picture.c
@@ -591,6 +591,29 @@ PictureParseCmapPolicy(const char *name)
return PictureCmapPolicyInvalid;
}
+/** @see GetDefaultBytes */
+static void
+GetPictureBytes(pointer value, XID id, ResourceSizePtr size)
+{
+ PicturePtr picture = value;
+
+ /* 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, 0 };
+ PixmapPtr pixmap = (PixmapPtr)picture->pDrawable;
+ pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+ size->pixmapRefSize += pixmapSize.pixmapRefSize;
+ }
+}
+
Bool
PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
@@ -602,6 +625,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
PictureType = CreateNewResourceType(FreePicture, "PICTURE");
if (!PictureType)
return FALSE;
+ SetResourceTypeSizeFunc(PictureType, GetPictureBytes);
PictFormatType = CreateNewResourceType(FreePictFormat, "PICTFORMAT");
if (!PictFormatType)
return FALSE;