Android performance optimization series-VSYNC and androidvsync

Source: Internet
Author: User

Android performance optimization series-VSYNC and androidvsync
Concepts

The GPU obtains graphical data for rendering. The hardware displays the drawn data on the screen. To make the screen smoothly displayed, the Frame Rate must be above 60, that is to say, a draw operation can take up to 16.7 ms.
Frame Rate and Refrash Rate are not always the same. If the GPU is drawn at a speed greater than the screen refresh speed, truncation occurs because the GPU uses a piece of memory to draw Frame data, the new image frame will overwrite the old image frame from top to bottom. When the screen is refreshed, the current data status of the buffer zone is unknown, this captures a frame of data that has not been drawn in the GPU.

The solution is double buffering. The GPU first writes the frame data to the back buffer, and then copies it to the frame buffer in another region. When the next frame is drawn, the data is first written to the back buffer. When the screen is refreshed, it is only obtained from the frame buffer. If the GPU is writing back buffer, refresh the screen and VSYNC will stop the copy process.

VSYNC or vertical synchronization, will basically keep this copy operation from back buffer to frame buffer from happening if the screen is in the middle of refreshing from it.

When the GPU is drawn at a speed lower than the screen refresh speed, that is, FrameRate <RefreshRate, a choppy phenomenon is displayed on the screen. Therefore, make sure that the frame is drawn for less than 16 ms.

Reference

Android Performance Patterns: Understanding VSYNC

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.