class FramePredictor
Defined at line 40 of file ../../src/ui/scenic/lib/scheduling/frame_predictor.h
Interface for performing frame predictions. Predicts viable presentation times
and corresponding latch-points for a frame, based on previously reported update
and render durations.
Public Methods
PredictedTimes GetPrediction (PredictionRequest request)
Computes the target presentation time for
|request.requested_presentation_time|, and a latch-point that is early
enough to apply one update and render a frame, in order to hit the
predicted presentation time.
Both |PredictedTimes.latch_point_time| and
|PredictedTimes.presentation_time| are guaranteed to be after
|request.now|. |PredictedTimes.presentation_time| is guaranteed to be later
than or equal to |request.requested_presentation_time|.
void ReportRenderDuration (zx::duration time_to_render)
Used by the client to report a measured render duration. The render
duration is the CPU + GPU time it takes to build and render a frame. This
will be considered in subsequent calls to |GetPrediction|.
void ReportUpdateDuration (zx::duration time_to_update)
Used by the client to report a measured update duration. The update
duration is the time it takes to apply a batch of updates. This will be
considered in subsequent calls to |GetPrediction|.
PredictedTimes ComputePredictionFromDuration (PredictionRequest request, zx::duration frame_preparation_time)
Returns the |PredictionTimes| for a |PredictionRequest|. |frame_preparation_time| is the
a duration long enough to prepare a frame for display (i.e. to update the global scene graph,
optionally do GPU composition, and whatever else is necessary).
Defined at line 34 of file ../../src/ui/scenic/lib/scheduling/frame_predictor.cc
zx::time ComputeNextVsyncTime (zx::time base_vsync_time, zx::duration vsync_interval, zx::time min_vsync_time)
Conceptually, starts at |base_vsync_time| and repeatedly adds |vsync_interval| until arriving
at a time that is >= |min_vsync_time|, which is then returned. The actual implementation is
more efficient.
|base_vsync_time| Assumed to be close to a past or future vsync time.
|vsync_interval| The expected time between vsyncs.
|min_vsync_time| The minimum time allowed to return.
Defined at line 14 of file ../../src/ui/scenic/lib/scheduling/frame_predictor.cc
void ~FramePredictor ()
Defined at line 42 of file ../../src/ui/scenic/lib/scheduling/frame_predictor.h