[cairo] Cairo 1.14.2 problems with Solaris 10, libXrender

Andreas F. Borchert andreas.borchert at uni-ulm.de
Wed Aug 5 13:23:03 PDT 2015

On Wed, Aug 05, 2015 at 12:07:52PM -0700, Bill Spitzak wrote:
> >    #define XRenderCreateSolidFill _int_consume
> >    #endif
> Exactly what purpose does this serve?

It replaces XRenderCreateSolidFill by _int_consume (a no-op function)
to avoid references to a function that is supposedly not defined
in -lXrender.

> In cairo there is only one use of this symbol in cairo-xlib-source.c,
> perhaps the if statement can be put around that instead.

There is a whole bunch of macros of this kind in cairo-xlib-xrender-private.h:

   #define XRenderCreateSolidFill				_int_consume

   #define XRenderCreateLinearGradient			_int_consume

   typedef struct _XLinearGradient {
       XPointFixed p1;
       XPointFixed p2;
   } XLinearGradient;

   #define XRenderCreateRadialGradient			_int_consume

   typedef struct _XCircle {
       XFixed x;
       XFixed y;
       XFixed radius;
   } XCircle;
   typedef struct _XRadialGradient {
       XCircle inner;
       XCircle outer;
   } XRadialGradient;

   #define XRenderCreateConicalGradient			_int_consume

   typedef struct _XConicalGradient {
       XPointFixed center;
       XFixed angle; /* in degrees */
   } XConicalGradient;

The obvious intention was to keep the code in cairo-xlib-source.c
tidy without myriads of #if directives. A better solution could
be the replacement of

   #define CAIRO_RENDER_HAS_GRADIENTS(surface) \
      CAIRO_RENDER_AT_LEAST((surface), 0, 10)


   #define CAIRO_RENDER_HAS_GRADIENTS(surface) \
	 CAIRO_RENDER_AT_LEAST((surface), 0, 10))

and likewise for all the other macros of this kind in cairo-xlib-private.h.

Regards, Andreas.

Dr. Andreas F. Borchert, Institut für Numerische Mathematik,
Universität Ulm, Helmholtzstraße 20, Zimmer 1.22, 89081 Ulm

More information about the cairo mailing list