[Xcb] Missing macros like Xlib DoubleToFixed and FixedToDouble in xrenderutil

Michele Comignano comick at autistici.org
Mon Mar 23 12:45:55 PDT 2009


#define xcb_render_util_d2f(f) ((xcb_render_fixed_t) ((f) * 65536))
#define xcb_render_util_f2d(f) (((double)(f)) / 65536)

I think they could be added in 
http://cgit.freedesktop.org/xcb/util/tree/renderutil/xcb_renderutil.h

I used d2f and f2d because the macros risk to be too long to write..
Those can be used as helper declaring a transformation matrix like:

xcb_render_transform_t transform = {
        xcb_render_util_d2f(1.0f), 0, 0,
        0, xcb_render_util_d2f(1.0f), 0,
        0, 0, xcb_render_util_d2f(zoom)
};


More information about the Xcb mailing list