views:

229

answers:

2

I am trying out the (latest) Android SDK, and noticed some strange behavior.

I've written a skeletal SurfaceView app: Activity, SurfaceView and a rendering thread. It doesn't actually do any painting, and only writes out the framerate to logcat once a second. When it runs in portrait mode, I get around 60 fps. However, when I flip it to landscape the framerate drops to about 30 fps.

I have also tested it on the LunarLender sample, and got similiar results. All of the testing are done on the emulator, since I don't have a physical device.

What's it all about? I can't seem to find any mentioning to this on Google, have anyone else experienced that? Is it just an emulator quirk or does it apply to physical hardware too?

A: 

Guessing here- in landscape mode, is there extra "blank" space on either side of the rendered content? If so there could be an effective increase in the amount of processing just to paint the screen. Don't know if that should account for a 50% decrease in framerate, but it's possible.

Another guess- landscape mode may be deliberately throttled because it's intended primarily for video viewing. No reason to go up to 60fps for 30fps content. Configuration?

Dave Swersky
The SurfaceView covers the entire screen (through Activity.setContentView), and as said, nothing is actually painted to it (though the canvas gets locked/unlocked). Again, same thing happens with the samples from the SDK, so I'd appriciate it if someone could confirm that. Technically speaking, landscape vs. portrait has exactly the same screen real estate (a little less, even). As for deliberatly decreasing the fps: might make sense for video, but how about games, that tend to feel more natural on landscape? The configuration is standard out-of-the-box: HVGA Android 2.1.
uj2
A: 

Same problem here,

Did you solve it?

Radu