How to check the overdraw in the application:
- On your device, go to Settings and tap Developer Options.
- Scroll down to the Hardware accelerated rendering section, and select Debug GPU Overdraw.
- In the Debug GPU overdraw dialog, select Show overdraw areas.
There are four colors for overdraw which tell us how many times the pixel is drawn on the screen, so let’s jump into it.
Let’s Start With The Practical Example:
I made a simple application in which I have two views like below screenshot:
Now let’s open the Debug GPU overdraw and we will see the overdraw.
You can see the highlighted one some red and green one which means red draw 4 times and green draw 2 times.
The solution to reduce the overdraw is first you need to check in your child views that have you defined the background color in the child view if yes then remove it from your child views, like in the above code which I mentioned I defined the background color in my parent layout as well as in the child views, so lets remove them then we will see how much the overdraw reduces.
Now in the above screenshot, you can see some extent I reduce the overdraw. After removing from your XML layout file, then you need to set the background drawable to null in your code to reduce the overdraw more, let’s implement in java code.
So after all this, you can see from the above screenshot, we reduce the overdraw from our sample application.
If you need to know more about it check out the official link below:
Inspect GPU Rendering Speed and Overdraw | Android Developers
On less powerful GPUs, available fill-rate (the speed at which the GPU can fill the frame buffer) can be quite low. As…
Thanks for reading this article. Be sure to clap to recommend this article if you found it helpful. It means a lot to me.