Ken
Ken

Reputation: 13

Honeycomb Hardware Acceleration

I'm a little confused about the Honeycomb hardware acceleration. The documentation says to add a line to your manifest, but then it talks about hardware backing layers for views. If I simply add the manifest line, am I turning it on application-wide everywhere by default, or do I have to also turn it on for all the views in my app?

Thanks!

Upvotes: 1

Views: 913

Answers (1)

Romain Guy
Romain Guy

Reputation: 98511

If you add the attribute in the manifest, you will get hardware acceleration on every view. Each drawing operation (drawText, drawBitmap, etc.) will then be hardware accelerated. However, you can specify a View's layer type to cache that View into a hardware layer (an OpenGL texture.) Even with hardware acceleration on, some complex Views might take a long time to render, which may affect animations. By enabling a View's hardware layer you render the View only once (+ every time it changes of course.) For instance, if you do the following:

view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
ObjectAnimator.ofFloat(view, "alpha", 0.0f);

the view will fade out but its drawing code will be invoked only once.

Upvotes: 4

Related Questions