[cairo-commit] src/cairo.c src/cairo-font.c src/cairoint.h
src/cairo-pattern.c src/cairo-scaled-font.c src/cairo-surface.c
Vladimir Vukicevic
vladimir at kemper.freedesktop.org
Fri Feb 23 14:25:22 PST 2007
src/cairo-font.c | 3 +++
src/cairo-pattern.c | 3 +++
src/cairo-scaled-font.c | 3 +++
src/cairo-surface.c | 3 +++
src/cairo.c | 3 +++
src/cairoint.h | 2 +-
6 files changed, 16 insertions(+), 1 deletion(-)
New commits:
diff-tree 5a72aac5982015a2b237afeb13164e0c5f5185ed (from cf7311852298e7d86d065a12fa962ba10fe60dcc)
Author: Vladimir Vukicevic <vladimir at pobox.com>
Date: Fri Feb 23 14:24:04 2007 -0800
[core] put back REF_COUNT_INVALID to be -1, fix finish
Previous commit broke cairo_surface_finish, since it was checking for
ref_count == CAIRO_REF_COUNT_INVALID and bailing. But, that condition
was reached from destroy, so finish was bailing out early.
diff --git a/src/cairo-font.c b/src/cairo-font.c
index 1b62aed..7fefea7 100644
--- a/src/cairo-font.c
+++ b/src/cairo-font.c
@@ -178,6 +178,9 @@ cairo_font_face_get_type (cairo_font_fac
unsigned int
cairo_font_face_get_reference_count (cairo_font_face_t *font_face)
{
+ if (font_face->ref_count == CAIRO_REF_COUNT_INVALID)
+ return 0;
+
return font_face->ref_count;
}
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 5060eff..0c428ba 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -592,6 +592,9 @@ slim_hidden_def (cairo_pattern_destroy);
unsigned int
cairo_pattern_get_reference_count (cairo_pattern_t *pattern)
{
+ if (pattern->ref_count == CAIRO_REF_COUNT_INVALID)
+ return 0;
+
return pattern->ref_count;
}
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 46ba571..4020acf 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -638,6 +638,9 @@ slim_hidden_def (cairo_scaled_font_destr
unsigned int
cairo_scaled_font_get_reference_count (cairo_scaled_font_t *scaled_font)
{
+ if (scaled_font->ref_count == CAIRO_REF_COUNT_INVALID)
+ return 0;
+
return scaled_font->ref_count;
}
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index e640fac..1224081 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -405,6 +405,9 @@ slim_hidden_def(cairo_surface_destroy);
unsigned int
cairo_surface_get_reference_count (cairo_surface_t *surface)
{
+ if (surface->ref_count == CAIRO_REF_COUNT_INVALID)
+ return 0;
+
return surface->ref_count;
}
diff --git a/src/cairo.c b/src/cairo.c
index 5eda36e..36fd07b 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -345,6 +345,9 @@ cairo_set_user_data (cairo_t *cr,
unsigned int
cairo_get_reference_count (cairo_t *cr)
{
+ if (cr->ref_count == CAIRO_REF_COUNT_INVALID)
+ return 0;
+
return cr->ref_count;
}
diff --git a/src/cairoint.h b/src/cairoint.h
index 65b0123..eff8344 100755
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -241,7 +241,7 @@ do { \
assert (NOT_REACHED); \
} while (0)
-#define CAIRO_REF_COUNT_INVALID (0)
+#define CAIRO_REF_COUNT_INVALID ((unsigned int) -1)
#include "cairo-wideint-private.h"
More information about the cairo-commit
mailing list