I have a live wallpaper that I originally coded to 开发者_JS百科use canvas rendering for phone-sized screens. But when running it on a Xoom tab the framerate degrades noticeably, presumably due to the increased screen resolution.
I tried adding android:hardwareAccelerated="true" to the application element of my manifest, however the framerate remains degraded. Checking the canvas object Android passes to my WallpaperEngineHelper class' onDraw method shows that the canvas is indeed not accelerated:
@Override
protected void onDrawFrame(Canvas c) {
c.isHardwareAccelerated(); //returns false
...
Am I missing something or should I re-code with a GL surface?
Romain mentions that this is not supported in 3.0 in this group discussion.
Chet Haase recently posted about some hardware acceleration profiling. The sample code may be of use to you.
精彩评论