2

Background

On Android, there is a way to find the GPU overdraw in order to measure how well your app performs with the GPU.

Starting with Kitkat, there are new ways to do it:

enter image description here

The "show overdraw areas" shows the how bad each drawing is (from nothing, to blue, to green, to yellow, and to red).

The second one ("Show areas for Deutoranomaly") is the same, but for people with color blindness.

The problem

I can't find any documentation about the last one "show overdraw counter".

I've tried enabling it, and for some places on the screen I saw a counter that changes its number on some cases. It also slows down the device much more than that other choices.

In addition, I've ran it on my own app, and even though the listView performs very well, because of Admob it shows a very high, colored red, value (around 5-6). I don't know why it happens, since it's just a listView and an adView inside a linearLayout...

The question

What does this counter mean?

Why does Admob increase it so much? Is it a bad thing? What should I do with it?

Removing Admob decreases the value to a decent one (around 1-2, depending on the theme being used) , or at least that's what I assume.


EDIT: I've found a nice explanation about it on this video. They say there something like that :

for every window there is a counter that tells you how many times you've drawn the screen and the color that tells you if you've done it well (green=good, red=bad). The number has a "." because it's the average number.

but I still don't understand why Admob Adview makes it so bad


EDIT: I got an answer on Admob Google Groups (here), saying I should disable the GPU on Adview in order to avoid the extra overdraw:

I see. So the issue seems related to hardware acceleration - if you turn off hardware acceleration on the AdView this doesn't happen:

adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

It worked, but I don't get how could this be a good thing. I mean, now the CPU is responsible of the view, right?

android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • Could be that Admob is not very efficient in its drawing. Combined with multiple nested layouts of a ListView row, the overdraw becomes bad (red). – telkins Apr 30 '14 at 18:54
  • But the listView is above it, as a child of a linearLayout, and without it (even if I put a button instead of the adView), it seems to performs ok... You can try it yourself. install the app, enable the new feature, disable internet connection, and see that it's fine when there is a button instead of the adView... – android developer Apr 30 '14 at 19:09
  • This is a really good article which should answer your question in regards to overdraw and any others you might have in regards to graphical performance - http://www.curious-creature.org/docs/android-performance-case-study-1.html – Karl May 02 '14 at 01:27
  • The thing with the AdView is that I didn't put any layer on top or behind it. I've updated my question with the answer I got from Google Group, but I still don't understand the whole thing. Do you refer to the part on this link of "Overdraw and the GPU" ? So you think it's just a GPU issue? – android developer May 16 '14 at 06:30

0 Answers0