From 3f2af30bd94ea3012bc1d1bde82f7c9a1c4dea27 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 26 Jul 2013 18:46:45 -0700 Subject: Add support for the 'Present' extension. [v3] This makes updating the eyes nicely vblank synchronized. v2: Ensure extensions exist before calling query_version These calls add calls to xcb_get_extension_data before calling query_version calls, as those calls will mark the connection with an error if made against an X server without the extension present. Suggested-by: Uli Schlachter v3: check the 'present' field in the return from xcb_get_extension_data; the xcb_get_extension_data call will always succeed (save for out of memory), the only way to tell if the extension is supported in the target X server is to test the 'present' field in the query extension reply value. Signed-off-by: Keith Packard --- EyesP.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'EyesP.h') diff --git a/EyesP.h b/EyesP.h index 159d7f3..29fe8a3 100644 --- a/EyesP.h +++ b/EyesP.h @@ -8,6 +8,13 @@ #include #endif #include "transform.h" +#ifdef PRESENT +#include +#include +#include +#include +#include +#endif #define SEG_BUFF_SIZE 128 @@ -30,10 +37,18 @@ typedef struct { Boolean render; Picture picture; Picture fill[PART_SHAPE]; +#endif +#ifdef PRESENT + Pixmap back_buffer; + xcb_damage_damage_t back_damage; + xcb_xfixes_region_t back_region; + Boolean present; #endif Boolean distance; } EyesPart; +#define xt_xcb(w) (XGetXCBConnection(XtDisplay(w))) + /* Full instance record declaration */ typedef struct _EyesRec { CorePart core; -- cgit v1.2.3