[cairo] [PATCH v8 71/71] add cairo_region_get_reference_count()

Enrico Weigelt, metux IT consult enrico.weigelt at gr13.net
Thu Jun 30 15:46:49 UTC 2016


---
 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



More information about the cairo mailing list