Android Performance Patterns s01e02-understanding Overdraw

Source: Internet
Author: User

Overdraw: Over-drawing is a term used to describe a component that is drawn more than once on a pixel on the screen.

For example, if we have a stacked UI card, the user-visible top cards cover Most of the underlying cards. This also means that a lot of time is spent drawing invisible lower-level cards. If you spend a lot of time each time to draw an invisible part, it can lead to a serious waste of GPU performance.

The modern layout gives us a beautiful design, but it also brings the problem to the developers.

To maximize app performance, developers need to minimize overdraw.

Fortunately, it's easy to see the impact of app Overdraw on Android devices:

Go to developer mode and open show GPU overdraw.

When turned on, Android will mark the overdraw with different colors on the screen.

Original color: No overdraw

Light blue: 1 times overdraw

Light green: 2 times Overdraw

Light red: 3 times Overdraw

Dark red: 4 times Overdraw

The app should minimize over-drawing so that the app displays more blue blocks than the red color blocks.

In the development process, should be careful to avoid unnecessary overdraw. For example, all activity in a layout has a background color, and all child elements have backgrounds. Also need to pay attention to avoid overdraw have text box, title, background, avatar background and Avatar and so on.

Android Performance Patterns s01e02-understanding Overdraw

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.