Do I need wl_frame_callback at all?

Scott Anderson scott.anderson at collabora.com
Wed Nov 20 11:19:23 UTC 2019


On 21/11/19 12:15 am, Martin Stransky wrote:
> On 11/20/19 12:12 PM, Scott Anderson wrote:
>> On 21/11/19 12:03 am, Martin Stransky wrote:
>>> Hi guys,
>>>
>>> what happens and is it a correct behavior when application does not 
>>> use wl_frame_callback at all and just do the drawing 
>>> (wl_surface_commit) whatever it has a data do draw?
>>>
>>> I know it may be sub-optimal to draw more frequently but I'd need to 
>>> cache the visual data elsewhere otherwise so it easier for me to just 
>>> put it at compositor instead to store it offscreen and then copy it 
>>> to wl_buffer when wl_frame_callback comes.
>>>
>>> Thanks,
>>> ma.
>>
>> Hi
>>
>> It's perfectly legal in the protocol to commit whenever you want to. 
>> The frame event is just a suggestion. Nothing is stopping anyone from 
>> rendering and committing at 1000 frames per second, other than people 
>> asking you to stop being so wasteful.
>>
>> Wayland uses the "mailbox" model (this is Vulkan terminology), so the 
>> compositor will just use whatever the current commit is at the time it 
>> does its composition.
> 
> So do you mean in this scenario:
> 
> -- composition
> ---- commit A
> ---- commit B
> ---- commit C
> -- composition
> 
> only 'commit C' is painted and A/B are lost?
> 
> Martin

Any changes to the surface state are kept, but yes, the buffers you 
attached in commit A or B will never be shown.

Scott.


More information about the wayland-devel mailing list