该类有一个带有以下签名Bitmap
的方法:copy()
public Bitmap copy(Bitmap.Config config, boolean isMutable)
mutable 和 immutable 之间是否存在性能差异Bitmap
?
Romain Guy在评论中回答:
回答最初的问题:不,没有性能差异。不过,我们可以为可变位图实现一些优化。希望在未来的版本中:)
没有性能差异。这不会影响您的应用程序的性能。如果您想执行任何操作,例如旋转等,那么我认为位图应该是可变的...
On Application level, there is always a difference between immutable & mutable Bitmap resources.
You always get an immutable Bitmap from the resources. you need to convert them into mutable bitmap as per necessiti.
Bitmap Bitmap = BitmapFactory.decodeResource(....); Bitmap mutableBitmap = immutableBitmap.copy(Bitmap.Config.ARGB_8888, true);
So probably there must be a performance issue in this reference.