[waffle] [RFC] waffle: support for swap completion callback

Chad Versace chad.versace at intel.com
Fri Feb 6 12:26:23 PST 2015


On 02/04/2015 05:13 AM, Emil Velikov wrote:
> On 4 February 2015 at 06:20, Tapani Pälli <tapani.palli at intel.com> wrote:
>>
>>
>> On 02/03/2015 07:32 PM, Emil Velikov wrote:
>>>
>>> On 2 February 2015 at 13:08, Tapani Pälli <tapani.palli at intel.com> wrote:
>>>>
>>>> Patch introduces a new API that enables application to register
>>>> a callback to be called when swapbuffers has finished. This can be
>>>> used to throttle rendering loop.
>>>>
>>> [...]
>>>>
>>>> @@ -173,6 +174,9 @@ bool
>>>>   waffle_is_extension_in_string(const char *extension_string,
>>>>                                 const char *extension_name);
>>>>
>>>> +bool
>>>> +waffle_register_swap_callback(waffle_swapbuffers_cb func);
>>>> +
>>>
>>> Perhaps inlining the typedef in there, and wrapping it in
>>> WAFFLE_API_VERSION (alongside the function prototype) ?
>>
>>
>> I put it in separate header so that wcore_platform.h would not need to
>> include whole "waffle.h" but if that feels ok then typedef can be moved
>> here.
>>
> Hmm good point. I would leave the final decision to Chad, but imho
> things will be better if we're compacted.

If we do add this function to the public API, let's put into the main
waffle.h. Like Emil said, let's keep the public headers "compacted".

>>> Fwiw changing the func prototype to something like the following will
>>> be more consistent, and less likely to abuse.
>>>
>>> bool
>>> waffle_window_register_swap_callback(struct waffle_window *window,
>>> waffle_swapbuffers_cb func);
>>
>>
>> This means that callback would be window specific. I think this is ok,
>> although then user needs to register callback for each window separately and
>> window argument could be removed from the actual callback.
>>
> True, and I don't think it can be seen as a problem.

I like the idea of a per-window callback too. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20150206/b22171f0/attachment.sig>


More information about the waffle mailing list