cogl: Unconditionally depend on cairo

This commit is contained in:
Jonas Ådahl 2018-05-18 16:24:45 +02:00
parent 99fb79f4cb
commit 12171e413b
2 changed files with 5 additions and 27 deletions

View File

@ -48,7 +48,7 @@
http://www.blackpawn.com/texts/lightmaps/default.html
*/
#if defined (COGL_ENABLE_DEBUG) && defined (HAVE_CAIRO)
#ifdef COGL_ENABLE_DEBUG
/* The cairo header is only used for debugging to generate an image of
the atlas */
@ -56,7 +56,7 @@
static void _cogl_rectangle_map_dump_image (CoglRectangleMap *map);
#endif /* COGL_ENABLE_DEBUG && HAVE_CAIRO */
#endif /* COGL_ENABLE_DEBUG */
typedef struct _CoglRectangleMapNode CoglRectangleMapNode;
typedef struct _CoglRectangleMapStackEntry CoglRectangleMapStackEntry;
@ -464,9 +464,7 @@ _cogl_rectangle_map_add (CoglRectangleMap *map,
#ifdef COGL_ENABLE_DEBUG
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DUMP_ATLAS_IMAGE)))
{
#ifdef HAVE_CAIRO
_cogl_rectangle_map_dump_image (map);
#endif
/* Dumping the rectangle map is really slow so we might as well
verify the space remaining here as it is also quite slow */
_cogl_rectangle_map_verify (map);
@ -557,9 +555,7 @@ _cogl_rectangle_map_remove (CoglRectangleMap *map,
#ifdef COGL_ENABLE_DEBUG
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DUMP_ATLAS_IMAGE)))
{
#ifdef HAVE_CAIRO
_cogl_rectangle_map_dump_image (map);
#endif
/* Dumping the rectangle map is really slow so we might as well
verify the space remaining here as it is also quite slow */
_cogl_rectangle_map_verify (map);
@ -706,7 +702,7 @@ _cogl_rectangle_map_free (CoglRectangleMap *map)
g_free (map);
}
#if defined (COGL_ENABLE_DEBUG) && defined (HAVE_CAIRO)
#ifdef COGL_ENABLE_DEBUG
static void
_cogl_rectangle_map_dump_image_cb (CoglRectangleMapNode *node, void *data)
@ -761,4 +757,4 @@ _cogl_rectangle_map_dump_image (CoglRectangleMap *map)
cairo_surface_destroy (surface);
}
#endif /* COGL_ENABLE_DEBUG && HAVE_CAIRO */
#endif /* COGL_ENABLE_DEBUG */

View File

@ -148,25 +148,7 @@ dnl Enable cairo usage for debugging
dnl (debugging code can use cairo to dump the atlas)
dnl ============================================================
PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
AC_ARG_ENABLE(
[cairo],
[AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
[],
[
AS_IF([test "x$enable_debug" = "xyes"],
[enable_cairo=$have_cairo],
[enable_cairo=no])
]
)
AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
[
AS_IF([test "x$have_cairo" != "xyes"],
[AC_MSG_ERROR([Could not find Cairo])])
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
])
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
dnl ============================================================