currently we set mOptimized flag to true only in exlicit :Optimize() call. Actually it must be set in CreateImage(). 1)if void CreateImage fails, flag in Oprimize() would be set anyway, which is wrong. 2)If Optimize() is called after CreateImage(), it may result in overhead of rebuilding native image.
Summary: [BeOS]nsImage IS optimized after CreateImage firstname.lastname@example.org email@example.com → [BeOS]nsImage IS optimized after CreateImage
situation is but more tricky. We rather should care about avoiding extra work in CreateImage than changing place for mOptimized flag.
Interestingly, according to lxr, nsImage*::Optimize() is unused outside. It means for BeOS we always have both mozilla image bits and native BBitmap - almoust doubling memory consumption. It may add speed, though, as no need to convert BBitmap to native bits in LockImagePixels.. But with this our UnlockImageBits() looks bit wrong. Probably it should call ::ImageUpdated(), to inform nsImageBeOS about need to invalidate BBitmap.
Hmm, so decoders really use Optimize() by calling SetMutable() . But then there is still question, why we didn't notice till now any big issue regarding LockImageBits(), because after Optimize() platform-independent bits are gone and set to nsnull. So GetBits() called after LockImageBits() in our case may happen to provide nihil to caller.
I don't think that there are many callers of that...
We don't support BeOS any more.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
In the graveyard, code referred to doesn't exist to be fixed.
You need to log in before you can comment on or make changes to this bug.