On 10/28/2010 04:48 PM, Alan Coopersmith wrote:
+/**
+ * Get the function used to calculate resource size. Extensions and
+ * drivers need to be able to determine the current size calculation
+ * function if they want to wrap or override it.
+ *
+ * @param[in] type     Resource type used in size calculations.
+ *
+ * @return Function to calculate the size of a single
+ *                     resource.
+ */
+SizeType
+GetResourceTypeSizeFunc(RESTYPE type)
+{
+    return resourceTypes[type&  TypeMask].sizeFunc;
+}
Should this add dixPrivatesSize(type) to the result or should the callers
like Xresource be doing that?


The original intention was that Xresource wouldn't do that automatically and the functions returned by that getter would calculate the size as well as they can. The resourceSize field of ResourceSizeRec should be filled with the amount of memory that is freed when the resource doesn't exist anymore.

It's probably best to add sizeof(PixmapRec) and dixPrivatesSize(PIXMAP_PRIVATE) to the result in GetPixmapBytes to get better estimate for the size and also to make GetPixmapBytes an example for other size calculation functions. I can do that in v2 of the patch if this change seems sensible to you.

-- Rami

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to