After reading on http://developer.android.com/guide/topics/graphics/hardware-accel.html , my understanding on 3 different type of layering techniques are (Assume the device has GPU)
My understanding certain draw operation isn't supported by GPU like setShadowLayer
. Hence, we need to switch to LAYER_TYPE_SOFTWARE
, so that draw will be performed by software.
However, since there's software's off-screen bitmap memory transferred to GPU operation, things may appear slower.
I think this is the default settings in most of the devices. So, I assume we should use this technique most of the time.
I have no idea when to use this technique. Any example will be very much appreciated, on when we should apply LAYER_TYPE_HARDWARE
technique.
p/s Also, my understanding on LAYER_TYPE_... may appear wrong. Kindly correct me, if you find any mistake. Thank you.
Basically its like a drawing cache. if your custom view is expensive to render/draw but the content doesn't change too much often then i'd use the flag. otherwise your just stressing out the device to cache for no reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With