[Cogl] [PATCH] Add cogl_onscreen_add_swap_complete_callback() api
Robert Bragg
robert at sixbynine.org
Fri Jan 25 09:07:20 PST 2013
>>
>> In particular your concern about not being able to access the
>> FrameInfo mid-frame was something you raised before and I tried to
>> re-assure you that this approach does not preclude us accessing the
>> FrameInfo mid-frame. It is only a technical detail with the current
>> implementation that means the FrameInfo is only allocated at the point
>> of swap_buffers() and it's done that way because in practice we don't
>> currently need the FrameInfo earlier. Conceptually though the
>> frame-info can be considered to exist for the full duration of the
>> frame while commands are being submitted etc and it should be trivial
>> to change the internals so that this is the case. I don't think any
>> _begin_frame() api is required to address this concern. If it would
>> help I can write a patch to clarify what I mean, but basically I think
>> it just means allocating the first CoglFrameInfo when the framebuffer
>> itself is allocated, and then all subsequent FrameInfos are allocated
>> in the _swap_buffers() but instead of allocating the FrameInfo for the
>> current frame (as is done with my current patch) it would allocate the
>> info for the next frame instead.
>
> I know that begin_frame() isn't necessary, since I had it that way in an
> earlier version of my patch. The main reason I introduced it was that
> I didn't want Cogl and GTK+ to have different semantics for what the
> value of the frame counter was "between frames". I also introduced it
> as a convenient and natural way of handling the frame time (see below).
>
> If you are willing to consider a cogl_onscreen_get_current_frame_info(),
> then that could mostly replace what I have in other aspects and is good
> enough.
Right, I was expecting that we'd add something like
cogl_onscreen_get_frame_info() at some point if it's useful to access
before outside of event delivery. I wasn't sure that we needed to add
this now since I'm not sure what you'd do with it for now but if there
is a use case now then I think this would be fine.
kind regards,
- Robert
More information about the Cogl
mailing list