summaryrefslogtreecommitdiff
path: root/src/cairo-xml-surface.c
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-02-28 23:31:06 +0200
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-03-01 01:21:31 +0200
commit5b7f4bb241f3191c1589cd714f373719efded56e (patch)
tree6eb5cf59bb1b3ac50304dc1a4465450e83e06517 /src/cairo-xml-surface.c
parent620cd9c2be4a6bef790e6818652470a5c53d578d (diff)
downloadcairo-5b7f4bb241f3191c1589cd714f373719efded56e.tar.gz
api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID through API functions already, so it makes sense to just go ahead and put it in the cairo_format_t enum.
Diffstat (limited to 'src/cairo-xml-surface.c')
-rw-r--r--src/cairo-xml-surface.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c
index 53247a02e..407aa969b 100644
--- a/src/cairo-xml-surface.c
+++ b/src/cairo-xml-surface.c
@@ -72,17 +72,6 @@ slim_hidden_proto (cairo_xml_for_recording_surface);
static const cairo_surface_backend_t _cairo_xml_surface_backend;
static const char *
-_direction_to_string (cairo_bool_t backward)
-{
- static const char *names[] = {
- "FORWARD",
- "BACKWARD"
- };
- assert (backward < ARRAY_LENGTH (names));
- return names[backward];
-}
-
-static const char *
_operator_to_string (cairo_operator_t op)
{
static const char *names[] = {
@@ -214,14 +203,15 @@ _content_to_string (cairo_content_t content)
static const char *
_format_to_string (cairo_format_t format)
{
- static const char *names[] = {
- "ARGB32", /* CAIRO_FORMAT_ARGB32 */
- "RGB24", /* CAIRO_FORMAT_RGB24 */
- "A8", /* CAIRO_FORMAT_A8 */
- "A1" /* CAIRO_FORMAT_A1 */
- };
- assert (format < ARRAY_LENGTH (names));
- return names[format];
+ switch (format) {
+ case CAIRO_FORMAT_ARGB32: return "ARGB32";
+ case CAIRO_FORMAT_RGB24: return "RGB24";
+ case CAIRO_FORMAT_A8: return "A8";
+ case CAIRO_FORMAT_A1: return "A1";
+ case CAIRO_FORMAT_INVALID: return "INVALID";
+ }
+ ASSERT_NOT_REACHED;
+ return "INVALID";
}
static void