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 /include/resource.h | |
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 'include/resource.h')
-rw-r--r-- | include/resource.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/resource.h b/include/resource.h index 068057013..8e58952aa 100644 --- a/include/resource.h +++ b/include/resource.h @@ -152,12 +152,37 @@ 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; +} ResourceSizeRec, *ResourceSizePtr; + +typedef void (*SizeType)(pointer /*value*/, + XID /*id*/, + ResourceSizePtr /*size*/); + extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ , const char * /*name */ ); extern _X_EXPORT void SetResourceTypeErrorValue(RESTYPE /*type */ , int /*errorValue */ ); +extern _X_EXPORT SizeType GetResourceTypeSizeFunc( + RESTYPE /*type*/); + +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 */ ); |