Android Gets the frame data for an app:
Description
(Open the Mobile developer option-GPU Display profile (shown on ADB shell Dumpsys gfxinfo) hook, only more than 4.1 support)
In android4.1, Google provides a tool called "GPU Rendering Mode analysis (profile GPU rendering)",
When this feature is turned on, the system will record the time information that retains the last 128 frames of the image drawn for each interface.
To start the operation:
Command line adb shell Dumpsys gfxinfo Com.taobao.mobile.dipei
Results in the profile data in MS
Analyze the following data
Draw: Represents the time taken by the OnDraw () method in the Create Display list section in Java.
Process: Indicates the time taken by the rendering engine to execute the display list, and the longer the view, the more time
Execute: Represents the amount of time spent in sending a frame of data to a screen layout.
It is actually the time when the background buffers that actually display the frame data are exchanged with the foreground buffer and the contents of the foreground buffer are displayed to the screen. So this time, is generally very short.
The Ps:view class contains surface (variable name msurface), each surface typically corresponds to two buffer, a front buffer, and a back buffer.
(After 4.1 is 3, one before, two after) where back buffer is the corresponding bitmap (research Android_view_surface.cpp::lockcanvas) for canvas drawing.
Therefore, the painting is always on the back buffer and needs to be updated, swap back buffer with front buffer.
Draw + Process + Execute = Full display of one frame,
This time is less than 16ms to save 60 frames per second.
Copy the data into Excel (Win remembers column-by-row replication, the Mac copies the past directly), and then generate "stacked column chart";
Android gets frame data for an app