Gecko:Compositor: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 51: Line 51:
=== Scheduling Updates ===
=== Scheduling Updates ===


Let the desired frame rate be H Hz. Let the time required by the last update by D (initially 0). Let the timestamp of the last update be L (initially -Infinity). Let the current timestamp be Now(). There is always at most one pending update. Updates are scheduled as follows:
Let the desired frame rate be H Hz. Let the timestamp of the start of the last update be S (initially 0). Let the current timestamp be Now(). There is always at most one pending update. Updates are scheduled as follows:
* RequestImmediateUpdate() sets a flag mImmediateUpdate to true. It schedules an update for Now() (cancelling any later scheduled update).
* RequestImmediateUpdate() sets a flag mImmediateUpdate to true. It schedules an update for Now() (cancelling any later scheduled update).
* On an RequestUpdate(), Invalidate() or Scroll() call, if there is currently no update scheduled, schedule one for max(Now(), L + 1/H - D). (I.e., make the update happen as soon as possible, except that we want it to render no earlier than 1/H seconds since the last update) --- except that if mImmediateUpdate is true, then always schedule an update for Now().
* On an RequestUpdate(), Invalidate() or Scroll() call, if there is currently no update scheduled, schedule one for max(Now(), S + 1/H). (I.e., make the update happen as soon as possible, except that we want it to render no earlier than 1/H seconds since the last update) --- except that if mImmediateUpdate is true, then always schedule an update for Now().
* After a window update, set mImmediateUpdate to false. If there are still active animations, schedule another update for L + 1/H - D.
* After a window update, set mImmediateUpdate to false. If there are still active animations, schedule another update for max(Now(), S + 1/H).


For hidden windows, we should never perform updates at all. Showing a window forces an immediate update.
For hidden windows, we should never perform updates at all. Showing a window forces an immediate update.
1,295

edits

Navigation menu