Android gets frame data for an app

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.