cp_frame_predict_timing
Computes and returns the predicted timing information for the frame.
Declaration
cp_frame_timing_t cp_frame_predict_timing(cp_frame_t frame);Parameters
- frame:
The frame you’re preparing to draw.
Mentioned in
Return Value
The predicted timing information for the specified frame, or nil if the layer is in the LayerRenderer.State.paused or LayerRenderer.State.invalidated state.
Discussion
The returned type contains the timing information for the specified frame. Use related functions to retrieve specific values. For example, use the cp_frame_timing_get_optimal_input_time function to determine when to start the submission phase of your frame update. This function updates the frame-specific timing information with the latest data from Compositor Services before it returns it.
Don’t call this function after you call cp_frame_query_drawable for the specified frame. After you retrieve the frame’s cp_drawable_t type, get the timing information from the drawable’s frameTiming function instead.