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