diff options
author | marha <marha@users.sourceforge.net> | 2012-04-20 17:07:15 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-04-20 17:07:15 +0200 |
commit | 0e3699334faf92f508b6c187a261548b656b0dd3 (patch) | |
tree | 28d7e84df7b54a3e6f85bf83e38efba937288fd3 /xorg-server/include/resource.h | |
parent | c1194ccd395fdbb23c9ab56bc340ee20a5feeb82 (diff) | |
download | vcxsrv-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/include/resource.h')
-rw-r--r-- | xorg-server/include/resource.h | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/xorg-server/include/resource.h b/xorg-server/include/resource.h index 068057013..19f46d108 100644 --- a/xorg-server/include/resource.h +++ b/xorg-server/include/resource.h @@ -152,12 +152,46 @@ typedef Bool (*FindComplexResType) (pointer /*value */ , XID /*id */ , pointer /*cdata */ ); +/* Structure for estimating resource memory usage. Memory usage + * consists of space allocated for the resource itself and of + * references to other resources. Currently the most important use for + * this structure is to estimate pixmap usage of different resources + * more accurately. */ +typedef struct { + /* Size of resource itself. Zero if not implemented. */ + unsigned long resourceSize; + /* Size attributed to pixmap references from the resource. */ + unsigned long pixmapRefSize; + /* Number of references to this resource; typically 1 */ + unsigned long refCnt; +} ResourceSizeRec, *ResourceSizePtr; + +typedef void (*SizeType)(pointer /*value*/, + XID /*id*/, + ResourceSizePtr /*size*/); + extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ , const char * /*name */ ); +typedef void (*FindTypeSubResources)(pointer /* value */, + FindAllRes /* func */, + pointer /* cdata */); + extern _X_EXPORT void SetResourceTypeErrorValue(RESTYPE /*type */ , int /*errorValue */ ); +extern _X_EXPORT SizeType GetResourceTypeSizeFunc( + RESTYPE /*type*/); + +extern _X_EXPORT void SetResourceTypeFindSubResFunc( + RESTYPE /*type*/, FindTypeSubResources /*findFunc*/); + +extern _X_EXPORT void SetResourceTypeSizeFunc( + RESTYPE /*type*/, SizeType /*sizeFunc*/); + +extern _X_EXPORT void SetResourceTypeErrorValue( + RESTYPE /*type*/, int /*errorValue*/); + extern _X_EXPORT RESTYPE CreateNewResourceClass(void); extern _X_EXPORT Bool InitClientResources(ClientPtr /*client */ ); @@ -193,6 +227,15 @@ extern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ , FindAllRes /*func */ , pointer /*cdata */ ); +/** @brief Iterate through all subresources of a resource. + + @note The XID argument provided to the FindAllRes function + may be 0 for subresources that don't have an XID */ +extern _X_EXPORT void FindSubResources(pointer /*resource*/, + RESTYPE /*type*/, + FindAllRes /*func*/, + pointer /*cdata*/); + extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ ); extern _X_EXPORT void FreeClientResources(ClientPtr /*client */ ); @@ -231,4 +274,17 @@ extern _X_EXPORT unsigned int GetXIDList(ClientPtr /*client */ , extern _X_EXPORT RESTYPE lastResourceType; extern _X_EXPORT RESTYPE TypeMask; -#endif /* RESOURCE_H */ +/** @brief A hashing function to be used for hashing resource IDs + + @param id The resource ID to hash + @param numBits The number of bits in the resulting hash. Must be >=0. + + @note This function is really only for handling + INITHASHSIZE..MAXHASHSIZE bit hashes, but will handle any number + of bits by either masking numBits lower bits of the ID or by + providing at most MAXHASHSIZE hashes. +*/ +extern _X_EXPORT int HashResourceID(XID id, + int numBits); + +#endif /* RESOURCE_H */ |