[boilerplate] Conditionally tweak the xlib surface

Prior to introduction of the buggy members to the surface, we obviously
cannot set them. However, the boilerplate code is meant to compile against
older revisions of the library so we need to check for the existence prior
to use.
This commit is contained in:
Chris Wilson 2009-07-31 14:48:32 +01:00
parent 397538a251
commit 097484da6f
2 changed files with 11 additions and 2 deletions

View file

@ -257,9 +257,15 @@ cairo_boilerplate_xlib_surface_disable_render (cairo_surface_t *abstract_surface
surface->base.content = CAIRO_CONTENT_COLOR;
/* These flags are set based on known bugs and lack of RENDER support */
surface->buggy_repeat = TRUE;
surface->buggy_pad_reflect = TRUE;
#if CAIRO_XLIB_SURFACE_HAS_BUGGY_GRADIENTS
surface->buggy_gradients = TRUE;
#endif
#if CAIRO_XLIB_SURFACE_HAS_BUGGY_PAD_REFLECT
surface->buggy_pad_reflect = TRUE;
#endif
#if CAIRO_XLIB_SURFACE_HAS_BUGGY_REPEAT
surface->buggy_repeat = TRUE;
#endif
return CAIRO_STATUS_SUCCESS;
}

View file

@ -78,6 +78,9 @@ struct _cairo_xlib_surface {
unsigned int buggy_gradients : 1;
unsigned int buggy_pad_reflect : 1;
unsigned int buggy_repeat : 1;
#define CAIRO_XLIB_SURFACE_HAS_BUGGY_GRADIENTS 1
#define CAIRO_XLIB_SURFACE_HAS_BUGGY_PAD_REFLECT 1
#define CAIRO_XLIB_SURFACE_HAS_BUGGY_REPEAT 1
int width;
int height;