diff options
Diffstat (limited to 'xorg-server/composite')
-rw-r--r-- | xorg-server/composite/compext.c | 25 | ||||
-rw-r--r-- | xorg-server/composite/compint.h | 2 | ||||
-rw-r--r-- | xorg-server/composite/compositeext.h | 2 |
3 files changed, 28 insertions, 1 deletions
diff --git a/xorg-server/composite/compext.c b/xorg-server/composite/compext.c index 940eed1fc..1d4d8bf97 100644 --- a/xorg-server/composite/compext.c +++ b/xorg-server/composite/compext.c @@ -497,6 +497,28 @@ SProcCompositeDispatch(ClientPtr client) return BadRequest; } +/** @see GetDefaultBytes */ +static void +GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size) +{ + WindowPtr window = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + if (window->redirectDraw != RedirectDrawNone) + { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0 }; + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr pixmap = screen->GetWindowPixmap(window); + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + void CompositeExtensionInit(void) { @@ -529,6 +551,9 @@ CompositeExtensionInit(void) if (!CompositeClientWindowType) return; + SetResourceTypeSizeFunc(CompositeClientWindowType, + GetCompositeClientWindowBytes); + CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows, "CompositeClientSubwindows"); if (!CompositeClientSubwindowsType) diff --git a/xorg-server/composite/compint.h b/xorg-server/composite/compint.h index 6c4272e5b..9e2713e93 100644 --- a/xorg-server/composite/compint.h +++ b/xorg-server/composite/compint.h @@ -71,6 +71,7 @@ #include "damageextint.h" #include "xfixes.h" #include <X11/extensions/compositeproto.h> +#include "compositeext.h" #include <assert.h> /* @@ -182,7 +183,6 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec; #define GetCompSubwindows(w) ((CompSubwindowsPtr) \ dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey)) -extern RESTYPE CompositeClientWindowType; extern RESTYPE CompositeClientSubwindowsType; extern RESTYPE CompositeClientOverlayType; diff --git a/xorg-server/composite/compositeext.h b/xorg-server/composite/compositeext.h index 600604d8d..0b148f029 100644 --- a/xorg-server/composite/compositeext.h +++ b/xorg-server/composite/compositeext.h @@ -35,4 +35,6 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen, VisualID * vids, int nVisuals); +extern _X_EXPORT RESTYPE CompositeClientWindowType; + #endif /* _COMPOSITEEXT_H_ */ |