Why imageView.setLayerType (View.LAYER_TYPE_SOFTWARE, null); and <application android: hardwareAccelerated = "false" have a different effect?

I wonder why if I installed

<application android:hardwareAccelerated="false" 

using svg-android i cannot see the image (due to hw acceleration problem?), but if i installed

 imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); 

I can make it work.

Does View.LAYER_TYPE_SOFTWARE hw acceleration or not?

+6
source share
1 answer

The direct answer to your question (does View.LAYER_TYPE_SOFTWARE disable hw acceleration or not?) - YES. This actually disables hw acceleration, but only at the presentation level, that is, hw accl is disabled in imageView in your case, and setting android:hardwareAccelerated="false" will disable hw accl for your entire application.

See the link for more details.

+5
source

Source: https://habr.com/ru/post/950098/


All Articles