[cairo-commit] boilerplate/cairo-boilerplate.c boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/Makefile.am src/cairo-types-private.h util/cairo-script
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jul 24 02:59:42 PDT 2009
boilerplate/Makefile.am | 7 +++++
boilerplate/cairo-boilerplate-pdf.c | 4 +++
boilerplate/cairo-boilerplate-ps.c | 4 +++
boilerplate/cairo-boilerplate-svg.c | 4 +++
boilerplate/cairo-boilerplate-test-surfaces.c | 31 +++++++++++++++-----------
boilerplate/cairo-boilerplate.c | 10 +++++---
src/cairo-types-private.h | 5 +++-
util/cairo-script/cairo-script-operators.c | 2 +
8 files changed, 50 insertions(+), 17 deletions(-)
New commits:
commit e577096dff714266101ba86ac275864b854096a4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Jul 20 23:17:07 2009 +0100
[boilerplate] Fix compilation against old revisions (as old as 1.9.2!)
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 3d8339f..c8b5d41 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -48,8 +48,13 @@ endif
libcairoboilerplate_la_LIBADD += $(CAIROBOILERPLATE_LIBS)
+# we need to workaround the introduction of CC_FOR_BUILD with older builds
make-cairo-boilerplate-constructors$(EXEEXT): make-cairo-boilerplate-constructors.c
- $(CC_FOR_BUILD) $^ -o $@
+ if test -n "$(CC_FOR_BUILD)"; then \
+ $(CC_FOR_BUILD) $^ -o $@; \
+ else \
+ $(CC) $^ -o $@; \
+ fi
cairo-boilerplate-constructors.c: Makefile $(enabled_cairo_boilerplate_sources) make-cairo-boilerplate-constructors$(EXEEXT)
echo '(cd $(srcdir) && $(top_builddir)/boilerplate/make-cairo-boilerplate-constructors$(EXEEXT) $(enabled_cairo_boilerplate_sources)) > $@'
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index e941d46..838038a 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -30,6 +30,10 @@
#include <cairo-pdf-surface-private.h>
#include <cairo-paginated-surface-private.h>
+#if ! CAIRO_HAS_META_SURFACE
+#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
+#endif
+
static const cairo_user_data_key_t pdf_closure_key;
typedef struct _pdf_target_closure
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 40148dd..8619e47 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -31,6 +31,10 @@
#include <cairo-ps-surface-private.h>
#include <cairo-paginated-surface-private.h>
+#if ! CAIRO_HAS_META_SURFACE
+#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
+#endif
+
static const cairo_user_data_key_t ps_closure_key;
typedef struct _ps_target_closure {
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index 45e085c..56296f4 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -35,6 +35,10 @@
#include <signal.h>
#endif
+#if ! CAIRO_HAS_META_SURFACE
+#define CAIRO_SURFACE_TYPE_META CAIRO_INTERNAL_SURFACE_TYPE_META
+#endif
+
static const cairo_user_data_key_t svg_closure_key;
typedef struct _svg_target_closure {
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index 501866b..3e7490e 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -28,16 +28,20 @@
#include "cairo-boilerplate-private.h"
+#include <cairo-types-private.h>
+
#include <test-fallback-surface.h>
#include <test-fallback16-surface.h>
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
#include <test-paginated-surface.h>
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,3)
+#endif
+#if CAIRO_HAS_TEST_NULL_SURFACE
#include <test-null-surface.h>
+#endif
+#if CAIRO_HAS_TEST_WRAPPING_SURFACE
#include <test-wrapping-surface.h>
#endif
-#include <cairo-types-private.h>
-
static cairo_surface_t *
_cairo_boilerplate_test_fallback_create_surface (const char *name,
cairo_content_t content,
@@ -70,6 +74,7 @@ _cairo_boilerplate_test_fallback16_create_surface (const char *name,
ceil (width), ceil (height));
}
+#if CAIRO_HAS_TEST_NULL_SURFACE
static cairo_surface_t *
_cairo_boilerplate_test_null_create_surface (const char *name,
cairo_content_t content,
@@ -82,13 +87,11 @@ _cairo_boilerplate_test_null_create_surface (const char *name,
void **closure)
{
*closure = NULL;
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,3)
return _cairo_test_null_surface_create (content);
-#else
- return NULL;
-#endif
}
+#endif
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
static const cairo_user_data_key_t test_paginated_closure_key;
typedef struct {
@@ -196,7 +199,9 @@ _cairo_boilerplate_test_paginated_cleanup (void *closure)
cairo_surface_destroy (tpc->target);
free (tpc);
}
+#endif
+#if CAIRO_HAS_TEST_WRAPPING_SURFACE
static cairo_surface_t *
_cairo_boilerplate_test_wrapping_create_surface (const char *name,
cairo_content_t content,
@@ -208,7 +213,6 @@ _cairo_boilerplate_test_wrapping_create_surface (const char *name,
int id,
void **closure)
{
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,3)
cairo_surface_t *target;
cairo_surface_t *surface;
cairo_format_t format;
@@ -221,11 +225,8 @@ _cairo_boilerplate_test_wrapping_create_surface (const char *name,
cairo_surface_destroy (target);
return surface;
-#else
- *closure = NULL;
- return NULL;
-#endif
}
+#endif
static const cairo_boilerplate_target_t targets[] = {
{
@@ -264,6 +265,7 @@ static const cairo_boilerplate_target_t targets[] = {
NULL, /* _cairo_boilerplate_get_image_surface, */
cairo_surface_write_to_png
},
+#if CAIRO_HAS_TEST_PAGINATED_SURFACE
{
"test-paginated", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
@@ -288,6 +290,8 @@ static const cairo_boilerplate_target_t targets[] = {
NULL,
FALSE, TRUE
},
+#endif
+#if CAIRO_HAS_TEST_WRAPPING_SURFACE
{
"test-wrapping", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
@@ -297,6 +301,8 @@ static const cairo_boilerplate_target_t targets[] = {
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
},
+#endif
+#if CAIRO_HAS_TEST_NULL_SURFACE
{
"null", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_NULL,
@@ -307,5 +313,6 @@ static const cairo_boilerplate_target_t targets[] = {
NULL,
TRUE, FALSE
},
+#endif
};
CAIRO_BOILERPLATE (test, targets)
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index a081045..f15f739 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -129,6 +129,7 @@ _cairo_boilerplate_image_create_surface (const char *name,
return cairo_image_surface_create (format, ceil (width), ceil (height));
}
+#if CAIRO_HAS_META_SURFACE
static cairo_surface_t *
_cairo_boilerplate_meta_create_surface (const char *name,
cairo_content_t content,
@@ -151,8 +152,6 @@ _cairo_boilerplate_meta_create_surface (const char *name,
return cairo_meta_surface_create (content, &extents);
}
-const cairo_user_data_key_t cairo_boilerplate_output_basename_key;
-
#if CAIRO_HAS_SCRIPT_SURFACE
static cairo_status_t
stdio_write (void *closure, const unsigned char *data, unsigned int len)
@@ -163,6 +162,9 @@ stdio_write (void *closure, const unsigned char *data, unsigned int len)
return CAIRO_STATUS_SUCCESS;
}
#endif
+#endif
+
+const cairo_user_data_key_t cairo_boilerplate_output_basename_key;
cairo_surface_t *
_cairo_boilerplate_get_image_surface (cairo_surface_t *src,
@@ -186,7 +188,7 @@ _cairo_boilerplate_get_image_surface (cairo_surface_t *src,
image = cairo_surface_reference (surface);
/* open a logging channel (only interesting for meta surfaces) */
-#if CAIRO_HAS_SCRIPT_SURFACE
+#if CAIRO_HAS_SCRIPT_SURFACE && CAIRO_HAS_META_SURFACE
if (cairo_surface_get_type (src) == CAIRO_SURFACE_TYPE_META) {
const char *test_name;
@@ -307,6 +309,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png
},
+#if CAIRO_HAS_META_SURFACE
{
"meta", "image", NULL, NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR_ALPHA, 0,
@@ -327,6 +330,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
NULL, NULL,
FALSE, TRUE
},
+#endif
};
CAIRO_BOILERPLATE (builtin, builtin_targets)
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h
index a68fe50..b553620 100644
--- a/src/cairo-types-private.h
+++ b/src/cairo-types-private.h
@@ -166,7 +166,6 @@ typedef enum _cairo_int_status {
typedef enum _cairo_internal_surface_type {
CAIRO_INTERNAL_SURFACE_TYPE_PAGINATED = 0x1000,
CAIRO_INTERNAL_SURFACE_TYPE_ANALYSIS,
- CAIRO_INTERNAL_SURFACE_TYPE_TEST_META,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
@@ -174,6 +173,10 @@ typedef enum _cairo_internal_surface_type {
CAIRO_INTERNAL_SURFACE_TYPE_TYPE3_GLYPH
} cairo_internal_surface_type_t;
+#define CAIRO_HAS_TEST_PAGINATED_SURFACE 1
+#define CAIRO_HAS_TEST_NULL_SURFACE 1
+#define CAIRO_HAS_TEST_WRAPPING_SURFACE 1
+
typedef struct _cairo_point {
cairo_fixed_t x;
cairo_fixed_t y;
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index 0402837..b769994 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -5714,6 +5714,7 @@ _integer_constants[] = {
{ "XOR", CAIRO_OPERATOR_XOR },
{ "ADD", CAIRO_OPERATOR_ADD },
{ "SATURATE", CAIRO_OPERATOR_SATURATE },
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 4)
{ "MULTIPLY", CAIRO_OPERATOR_MULTIPLY },
{ "SCREEN", CAIRO_OPERATOR_SCREEN },
{ "OVERLAY", CAIRO_OPERATOR_OVERLAY },
@@ -5729,6 +5730,7 @@ _integer_constants[] = {
{ "HSL_SATURATION", CAIRO_OPERATOR_HSL_SATURATION },
{ "HSL_COLOR", CAIRO_OPERATOR_HSL_COLOR },
{ "HSL_LUMINOSITY", CAIRO_OPERATOR_HSL_LUMINOSITY },
+#endif
{ "WINDING", CAIRO_FILL_RULE_WINDING },
{ "EVEN_ODD", CAIRO_FILL_RULE_EVEN_ODD },
More information about the cairo-commit
mailing list