summaryrefslogtreecommitdiff
path: root/src/cairo-region.c
diff options
context:
space:
mode:
authorhk57.kim <hk57.kim@samsung.com>2016-06-30 15:54:38 +0900
committerjerry kim <hk57.kim@samsung.com>2016-06-29 23:55:35 -0700
commit0943bf528f223f9ccf2fcb15c87053f694052bfc (patch)
treef3dbf4320cacc505c00345d57bb001451dd03e47 /src/cairo-region.c
parentc279cf141e79f15eccd5ff386cf008c8cba8fb64 (diff)
downloadcairo-0943bf528f223f9ccf2fcb15c87053f694052bfc.tar.gz
cairo-0943bf528f223f9ccf2fcb15c87053f694052bfc.tar.bz2
cairo-0943bf528f223f9ccf2fcb15c87053f694052bfc.zip
By default T-trace is disabled in the build. Use --enable-ttrace=yes for enabling the same. Change-Id: I697c0a3f05bc9010620db563a4121c2ed0e46599 Signed-off-by: hk57.kim <hk57.kim@samsung.com>
Diffstat (limited to 'src/cairo-region.c')
-rw-r--r--src/cairo-region.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/cairo-region.c b/src/cairo-region.c
index ccfb2200e..f202c960d 100644
--- a/src/cairo-region.c
+++ b/src/cairo-region.c
@@ -40,6 +40,7 @@
#include "cairo-error-private.h"
#include "cairo-region-private.h"
+#include "cairo-ttrace.h"
/* XXX need to update pixman headers to be const as appropriate */
#define CONST_CAST (pixman_region32_t *)
@@ -194,16 +195,20 @@ _cairo_region_fini (cairo_region_t *region)
cairo_region_t *
cairo_region_create (void)
{
+ CAIRO_TRACE_BEGIN (__func__);
cairo_region_t *region;
region = _cairo_malloc (sizeof (cairo_region_t));
- if (region == NULL)
+ if (region == NULL) {
+ CAIRO_TRACE_END (__func__);
return (cairo_region_t *) &_cairo_region_nil;
+ }
region->status = CAIRO_STATUS_SUCCESS;
CAIRO_REFERENCE_COUNT_INIT (&region->ref_count, 1);
pixman_region32_init (&region->rgn);
+ CAIRO_TRACE_END (__func__);
return region;
}
@@ -418,16 +423,22 @@ slim_hidden_def (cairo_region_reference);
void
cairo_region_destroy (cairo_region_t *region)
{
- if (region == NULL || CAIRO_REFERENCE_COUNT_IS_INVALID (&region->ref_count))
+ CAIRO_TRACE_BEGIN (__func__);
+ if (region == NULL || CAIRO_REFERENCE_COUNT_IS_INVALID (&region->ref_count)) {
+ CAIRO_TRACE_END (__func__);
return;
+ }
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&region->ref_count));
- if (! _cairo_reference_count_dec_and_test (&region->ref_count))
+ if (! _cairo_reference_count_dec_and_test (&region->ref_count)) {
+ CAIRO_TRACE_END (__func__);
return;
+ }
_cairo_region_fini (region);
free (region);
+ CAIRO_TRACE_END (__func__);
}
slim_hidden_def (cairo_region_destroy);
@@ -701,11 +712,14 @@ cairo_status_t
cairo_region_union_rectangle (cairo_region_t *dst,
const cairo_rectangle_int_t *rectangle)
{
+ CAIRO_TRACE_BEGIN (__func__);
cairo_status_t status = CAIRO_STATUS_SUCCESS;
pixman_region32_t region;
- if (dst->status)
+ if (dst->status) {
+ CAIRO_TRACE_END (__func__);
return dst->status;
+ }
pixman_region32_init_rect (&region,
rectangle->x, rectangle->y,
@@ -715,6 +729,7 @@ cairo_region_union_rectangle (cairo_region_t *dst,
status = _cairo_region_set_error (dst, CAIRO_STATUS_NO_MEMORY);
pixman_region32_fini (&region);
+ CAIRO_TRACE_END (__func__);
return status;
}