I should note that winex11 is slightly outside my area of expertise; Alexandre is the one you'll ultimately have to convince. For what it's worth though:
On Fri, 23 Nov 2018 at 23:25, Axel Davy davyaxel0@gmail.com wrote:
On 23/11/2018 17:36, Henri Verbeet wrote:
What I had in mind would be something similar to the following:
__wine_present_native_drawable(HWND window, ULONG_PTR drawable, unsigned int flags, const RECT *src, const POINT *dst, UINT64 msc, UINT64 divisor, UINT64 remainder);
Do you have a similar platform API (Mac ?) you would like to cover with this interface ?
I think passing the native drawable directly is not a good idea (because it requires to set up a callback system to get the updated status of that drawable).
I don't know, do you need to? I don't think callbacks are bad per se though.
Thus I would suggest an interface in the spirit of:
__wine_present_native_drawable(HWND window, wine_present_drawable *wine_drawable, unsigned int flags, const RECT *src, const POINT *dst, UINT64 msc, UINT64 divisor, UINT64 remainder);
wine_present_drawable * __wine_present_make_wine_drawable(ULONG_PTR drawable)
__wine_present_process_events(bool block_if_no_event); // basically a flush + process events
/* Those wouldn't process events, only check states */ __wine_present_is_drawable_released(wine_present_drawable *wine_drawable); __wine_present_is_drawable_presented(wine_present_drawable *wine_drawable); __wine_present_drawable_get_last_presented_msc(wine_present_drawable *wine_drawable); __wine_present_release_drawable(wine_present_drawable *wine_drawable);
and have then multithread safe ie multiple threads can call the functions without blocking. For example I can have a thread waiting with __wine_present_process_events(true), while another thread does __wine_present_native_drawable.
Would that work out ?
My main question would be "Why do you need that?" For example, event processing should normally already be done by the application. Somewhat similarly, __wine_present_make_wine_drawable() may make sense if Wine would need to store some extra information along with the native pixmap, but I don't think we do.