On 13/01/14 15:20, Mike Blumenkrantz wrote:
> discomfitor pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=131e0e19837b56ef7887ef3c447e64789b480afb
>
> commit 131e0e19837b56ef7887ef3c447e64789b480afb
> Author: Mike Blumenkrantz <[email protected]>
> Date:   Fri Jan 10 02:26:06 2014 -0500
>
>      ecore-x now supports XPRESENT
>
>      see 
> http://cgit.freedesktop.org/xorg/proto/presentproto/plain/presentproto.txt
> ---
>

<snip>

Looks good ... One thing that you Should do tho (on the xcb side) is for 
API functions where you are using the connetion (_ecore_xcb_conn), you 
should use CHECK_XCB_CONN before calling those xcb functions.

IE:

#ifdef ECORE_XCB_XPRESENT
CHECK_XCB_CONN;
xcb_present_select_input(....);
#endif

#ifdef ECORE_XCB_XPRESENT
CHECK_XCB_CONN;
xcb_present_notify_msc(....);
#endif

#ifdef ECORE_XCB_XPRESENT
CHECK_XCB_CONN;
xcb_present_pixmap(....);
#endif

Reasoning: If the xcb connection has a problem (existing error 
condition, connection has died, etc, etc), then this macro will call the 
xcb_io_error_handler (think X io error handler) and attempt to exist 
gracefully (letting the user know of the error).

As this code is right now, if attempt to call these functions on a 
connection that has an issue/error, then you are basically going to 
"seg" really hard :/

Using CHECK_XCB_CONN allows for (at least) Some sort of graceful exit as 
it will call any Ecore X Io Error Handler function that the user has setup:

 From Enlightenment:
(ex: ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL))

Aside from that, Nice Work ! :)

Cheers,
dh


> +EAPI void
> +ecore_x_present_select_events(Ecore_X_Window win, unsigned int events)
> +{
> +#ifdef ECORE_XCB_XPRESENT
> +   xcb_present_select_input(_ecore_xcb_conn, _ecore_xcb_event_xpresent, win, 
> events);
> +#else
> +   (void)win;
> +   (void)events;
> +#endif
> +}
> +
> +EAPI void
> +ecore_x_present_notify_msc(Ecore_X_Window win, unsigned int serial, unsigned 
> long long target_msc, unsigned long long divisor, unsigned long long 
> remainder)
> +{
> +#ifdef ECORE_XCB_XPRESENT
> +   xcb_present_notify_msc(_ecore_xcb_conn, win, serial, target_msc, divisor, 
> remainder);
> +#else
> +   (void)win;
> +   (void)serial;
> +   (void)target_msc;
> +   (void)divisor;
> +   (void)remainder;
> +#endif
> +}
> +
> +EAPI void
> +ecore_x_present_pixmap(Ecore_X_Window win, Ecore_X_Pixmap pixmap, unsigned 
> int serial, Ecore_X_Region valid,
> +                       Ecore_X_Region update, int x_off, int y_off, 
> Ecore_X_Randr_Crtc target_crtc,
> +                       Ecore_X_Sync_Fence wait_fence, Ecore_X_Sync_Fence 
> idle_fence, unsigned int options,
> +                       unsigned long long target_msc, unsigned long long 
> divisor, unsigned long long remainder,
> +                       Ecore_X_Present *notifies, int num_notifies)
> +{
> +#ifdef ECORE_XCB_XPRESENT
> +   xcb_present_pixmap(_ecore_xcb_conn, win, pixmap, serial, valid, update,
> +                  x_off, y_off, target_crtc, wait_fence, idle_fence, 
> options, target_msc,
> +                  divisor, remainder, num_notifies, 
> (xcb_present_notify_t*)notifies);
> +#else
> +   (void)win;
> +   (void)pixmap;
> +   (void)serial;
> +   (void)valid;
> +   (void)update;
> +   (void)x_off;
> +   (void)y_off;
> +   (void)target_crtc;
> +   (void)wait_fence;
> +   (void)idle_fence;
> +   (void)options;
> +   (void)target_msc;
> +   (void)divisor;
> +   (void)remainder;
> +   (void)notifies;
> +   (void)num_notifies;
> +#endif
> +}
> +


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to