Stay organized with collections Save and categorize content based on your preferences.
WindowContentFrameStats
class WindowContentFrameStats : FrameStats, Parcelable
This class contains window content frame statistics. For example, a window content is rendred in frames when a view is scrolled. The frame statistics are a snapshot for the time interval from getStartTimeNano()
to getEndTimeNano()
.
The key idea is that in order to provide a smooth user experience an application has to draw a frame at a specific time interval obtained by calling getRefreshPeriodNano()
. If the application does not render a frame every refresh period the user will see irregular UI transitions.
An application posts a frame for presentation by synchronously rendering its contents in a buffer which is then posted or posting a buffer to which the application is asychronously rendering the content via GL. After the frame is posted and rendered (potentially asynchronosly) it is presented to the user. The time a frame was posted can be obtained via getFramePostedTimeNano(int)
, the time a frame content was rendered and ready for dsiplay (GL case) via getFrameReadyTimeNano(int)
, and the time a frame was presented on the screen via getFramePresentedTimeNano(int)
.
Summary
Inherited constants |
From class Parcelable Int | CONTENTS_FILE_DESCRIPTOR Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor. | Int | PARCELABLE_WRITE_RETURN_VALUE Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point. | |
|
Public methods |
Int | |
Long | Get the time a frame at a given index was posted by the producer (e.g. the application). |
Long | Get the time a frame at a given index was ready for presentation. |
String | |
Unit | |
Inherited functions |
From class FrameStats Long | getEndTimeNano() Gets the end time of the interval for which these statistics apply. The end interval is the time when the last frame was presented. | Int | getFrameCount() Gets the number of frames for which there is data. | Long | getFramePresentedTimeNano(index: Int) Get the time a frame at a given index was presented. | Long | getRefreshPeriodNano() Gets the refresh period of the display hosting the window(s) for which these statistics apply. | Long | getStartTimeNano() Gets the start time of the interval for which these statistics apply. The start interval is the time when the first frame was presented. | |
Public methods
describeContents
fun describeContents(): Int
getFramePostedTimeNano
fun getFramePostedTimeNano(index: Int): Long
Get the time a frame at a given index was posted by the producer (e.g. the application). It is either explicitly set or defaulted to the time when the render buffer was posted.
Note: A frame can be posted and still it contents being rendered asynchronously in GL. To get the time the frame content was completely rendered and ready to display call getFrameReadyTimeNano(int)
.
Parameters |
index | Int: The frame index. |
Return |
Long | The posted time in nanoseconds. |
getFrameReadyTimeNano
fun getFrameReadyTimeNano(index: Int): Long
Get the time a frame at a given index was ready for presentation.
Note: A frame can be posted and still it contents being rendered asynchronously in GL. In such a case this is the time when the frame contents were completely rendered.
Parameters |
index | Int: The frame index. |
toString
fun toString(): String
Return |
String | a string representation of the object. |
writeToParcel
fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]