Confirmed users
346
edits
No edit summary |
|||
| Line 72: | Line 72: | ||
=== VsyncObserver === | === VsyncObserver === | ||
VsyncObserver is the base class for all vsync event observer. It will be | VsyncObserver is the base class for all vsync event observer. It will be ticked when vsync event comes. | ||
Here is the tick function prototype: | Here is the tick function prototype: | ||
virtual void TickTask(int64_t timestamp, uint64_t frameNumber); | virtual void TickTask(int64_t timestamp, uint64_t frameNumber); | ||
=== VsyncEventRegistry === | |||
This class provide the registering interface for VsyncObserver. After registering, VsyncDispatcher will call the observer's TickTask() for vsync event. The Register() call is one-shot registry. If observer need another tick, it should register again. The Unregister() has a sync flag. All observer should call the sync unregister before they call destructor. Thus, VsyncDispatcher will not tick the observer while destroying. | |||
The VsyncEventRegistry interface: | |||
virtual uint32_t GetObserverNum(); | |||
virtual void Register(VsyncObserver *observer); | |||
virtual void Unregister(VsyncObserver *observer, bool sync); | |||
=== VsyncTimerObserver === | === VsyncTimerObserver === | ||