It seems the current design rule is: 1.Always mark as immutable for the source bitmap raw data,like in BitmapFactory::decode 2.User can decide to set as mutable/immutable when create copy from the source bitmap,like in Bitmap:copy().
webmonkey wrote: > Is the reason that the loading funtions in BitmapFactory always return > immutable bitmaps by design? > > I tracked the actual setting to Immutable down to the following code > in the last part of the doDecode function in the BitmapFactory.cpp > file: > > > // promise we will never change our pixels (great for sharing and > pictures) > SkPixelRef* ref = bitmap->pixelRef(); > SkASSERT(ref); > ref->setImmutable(); > > > It would be great to have an option in BitmapFactory.Options where you > can set that you want a mutable bitmap. This way when you want to edit > the bitmap that you open you don't have to copy it, saving a lot of > memory, especially for large bitmaps. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---
