Why is transparency so slow?

44 views
Skip to first unread message

Tomei Ningen

unread,
Nov 26, 2008, 3:19:15 AM11/26/08
to android-platform
Maybe I have superhuman eyes, but on the G1 phone, when I scroll up
the list of applications, the animation is quite jerky. It's
definitely less than 30fps, and the frame rate is irregular.

The list of apps is drawn on top of the home screen background using a
semi-transparent effect. Is transparency the cause of jerkiness?

If so, is this going to be improved soon by Google?

I mean, doing 16-bit transparency on an HVGA screen with a 500+mhz
processor isn't exactly a rocket science problem ....

Dianne Hackborn

unread,
Nov 26, 2008, 6:23:24 AM11/26/08
to android-...@googlegroups.com
Uh, there is a lot more going on in that UI than just doing transparent drawing.  Also currently all drawing within a window is not hardware accelerated so must be done in software.  And the G1's processor runs at well below 500MHz, and doesn't have a wonderful memory bus.

Feel free to play around writing apps doing various kinds of drawing to get an idea of the performance of various operations.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support.  All such questions should be posted on public forums, where I and others can see and answer them.

Romain Guy

unread,
Nov 26, 2008, 1:05:37 PM11/26/08
to android-...@googlegroups.com
> The list of apps is drawn on top of the home screen background using a
> semi-transparent effect. Is transparency the cause of jerkiness?

The transparency doesn't help indeed. When you scroll the list, the
toolkit has to redraw the wallpaper, the desktop icons, the drawer's
background and the apps background. That's four layers, almost full
screen, that need to be composited. I have a couple of optimizations
in mind that should help and, if need be, we could move the drawer to
a separate window to get the hw accelerated composition (but that
introduces other problems with drag and drop.)

> If so, is this going to be improved soon by Google?

I don't know about "soon" but this is something we want to improve, yes.

> I mean, doing 16-bit transparency on an HVGA screen with a 500+mhz
> processor isn't exactly a rocket science problem ....

The CPU runs at about 350 Mhz, the memory bus is terribly slow, the 2D
API is in pure software and there's the View hierarchy overhead. You
can't simplify the problem the way you do.

--
Romain Guy
www.curious-creature.org

Reply all
Reply to author
Forward
0 new messages