summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-12-19 20:46:36 -0500
committerBehdad Esfahbod <behdad@behdad.org>2008-12-20 01:06:30 -0500
commit8bf49b27aeea8179b5862a424fb3ef1934be6e0e (patch)
tree3b0029c25d8633c6bff4a2397ac1c8297dda975b
parente3675f8ac0acb285b2d669c0a44322623dac5fe9 (diff)
[font-face] Use cairo_font_face_t instead of toy, for nil objects
And with a NULL backend. We are not supposed to read the nil objects afterall. If this causes crashes, the crash site should be fixed.
-rw-r--r--src/cairo-font-face.c55
-rw-r--r--src/cairoint.h2
2 files changed, 11 insertions, 46 deletions
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index 88e782b9..6161c0ce 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -45,79 +45,44 @@ static const cairo_font_face_backend_t _cairo_toy_font_face_backend;
/* #cairo_font_face_t */
-const cairo_toy_font_face_t _cairo_font_face_nil = {
- {
+const cairo_font_face_t _cairo_font_face_nil = {
{ 0 }, /* hash_entry */
CAIRO_STATUS_NO_MEMORY, /* status */
CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
{ 0, 0, 0, NULL }, /* user_data */
- &_cairo_toy_font_face_backend
- },
- CAIRO_FONT_FAMILY_DEFAULT, /* family */
- TRUE, /* owns_family */
- CAIRO_FONT_SLANT_DEFAULT, /* slant */
- CAIRO_FONT_WEIGHT_DEFAULT, /* weight */
- NULL /* impl_face */
+ NULL
};
-static const cairo_toy_font_face_t _cairo_font_face_null_pointer = {
- {
+static const cairo_font_face_t _cairo_font_face_null_pointer = {
{ 0 }, /* hash_entry */
CAIRO_STATUS_NULL_POINTER, /* status */
CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
{ 0, 0, 0, NULL }, /* user_data */
- &_cairo_toy_font_face_backend
- },
- CAIRO_FONT_FAMILY_DEFAULT, /* family */
- TRUE, /* owns_family */
- CAIRO_FONT_SLANT_DEFAULT, /* slant */
- CAIRO_FONT_WEIGHT_DEFAULT, /* weight */
- NULL /* impl_face */
+ NULL
};
-static const cairo_toy_font_face_t _cairo_font_face_invalid_string = {
- {
+static const cairo_font_face_t _cairo_font_face_invalid_string = {
{ 0 }, /* hash_entry */
CAIRO_STATUS_INVALID_STRING, /* status */
CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
{ 0, 0, 0, NULL }, /* user_data */
- &_cairo_toy_font_face_backend
- },
- CAIRO_FONT_FAMILY_DEFAULT, /* family */
- TRUE, /* owns_family */
- CAIRO_FONT_SLANT_DEFAULT, /* slant */
- CAIRO_FONT_WEIGHT_DEFAULT, /* weight */
- NULL /* impl_face */
+ NULL
};
-static const cairo_toy_font_face_t _cairo_font_face_invalid_slant = {
- {
+static const cairo_font_face_t _cairo_font_face_invalid_slant = {
{ 0 }, /* hash_entry */
CAIRO_STATUS_INVALID_SLANT, /* status */
CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
{ 0, 0, 0, NULL }, /* user_data */
- &_cairo_toy_font_face_backend
- },
- CAIRO_FONT_FAMILY_DEFAULT, /* family */
- TRUE, /* owns_family */
- CAIRO_FONT_SLANT_DEFAULT, /* slant */
- CAIRO_FONT_WEIGHT_DEFAULT, /* weight */
- NULL /* impl_face */
+ NULL
};
-static const cairo_toy_font_face_t _cairo_font_face_invalid_weight = {
- {
+static const cairo_font_face_t _cairo_font_face_invalid_weight = {
{ 0 }, /* hash_entry */
CAIRO_STATUS_INVALID_WEIGHT, /* status */
CAIRO_REFERENCE_COUNT_INVALID, /* ref_count */
{ 0, 0, 0, NULL }, /* user_data */
- &_cairo_toy_font_face_backend
- },
- CAIRO_FONT_FAMILY_DEFAULT, /* family */
- TRUE, /* owns_family */
- CAIRO_FONT_SLANT_DEFAULT, /* slant */
- CAIRO_FONT_WEIGHT_DEFAULT, /* weight */
- NULL /* impl_face */
+ NULL
};
cairo_status_t
diff --git a/src/cairoint.h b/src/cairoint.h
index e98bac09..f0ce77f9 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1368,7 +1368,7 @@ _cairo_color_equal (const cairo_color_t *color_a,
/* cairo-font-face.c */
-extern const cairo_private cairo_toy_font_face_t _cairo_font_face_nil;
+extern const cairo_private cairo_font_face_t _cairo_font_face_nil;
cairo_private void
_cairo_font_face_init (cairo_font_face_t *font_face,