[PATCH v8 71/71] add cairo_region_get_reference_count()

"Enrico Weigelt, metux IT consult" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
---
 src/cairo-region.c | 20 ++++++++++++++++++++
 src/cairo.h        |  3 +++
 2 files changed, 23 insertions(+)

diff --git a/src/cairo-region.c b/src/cairo-region.c
index b738c44..f5aa2c9 100644
--- a/src/cairo-region.c
+++ b/src/cairo-region.c
@@ -940,3 +940,23 @@ cairo_region_equal (const cairo_region_t *a,
     return pixman_region32_equal (CONST_CAST &a->rgn, CONST_CAST &b->rgn);
 }
 slim_hidden_def (cairo_region_equal);
+
+/**
+ * cairo_region_get_reference_count:
+ * @surface: a #cairo_region_t
+ *
+ * Returns the current reference count of @region.
+ *
+ * Return value: the current reference count of @region.  If the
+ * object is a nil object, 0 will be returned.
+ *
+ **/
+unsigned int
+cairo_region_get_reference_count (cairo_region_t *region)
+{
+    if (region == NULL ||
+            CAIRO_REFERENCE_COUNT_IS_INVALID (&region->ref_count))
+        return 0;
+
+    return CAIRO_REFERENCE_COUNT_GET_VALUE (&region->ref_count);
+}
diff --git a/src/cairo.h b/src/cairo.h
index a09d839..f5e3278 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -3090,6 +3090,9 @@ cairo_region_reference (cairo_region_t *region);
 cairo_public void
 cairo_region_destroy (cairo_region_t *region);
 
+cairo_public unsigned int
+cairo_region_get_reference_count (cairo_region_t *region);
+
 cairo_public cairo_bool_t
 cairo_region_equal (const cairo_region_t *a, const cairo_region_t *b);
 
-- 
2.6.4.442.g545299f

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.