SkImage_Raster(const SkBitmap& bm, bool bitmapMayBeMutable = false) : INHERITED(bm.width(), bm.height(), is_not_subset(bm) ? bm.getGenerationID() : (uint32_t)kNeedNewImageUniqueID) , fBitmap(bm) { SkASSERT(bitmapMayBeMutable || fBitmap.isImmutable()); }
SkImage_Raster(const SkBitmap& bm) : INHERITED(bm.width(), bm.height(), is_not_subset(bm) ? bm.getGenerationID() : (uint32_t)kNeedNewImageUniqueID) , fBitmap(bm) { if (bm.pixelRef()->isPreLocked()) { // we only preemptively lock if there is no chance of triggering something expensive // like a lazy decode or imagegenerator. PreLocked means it is flat pixels already. fBitmap.lockPixels(); } SkASSERT(fBitmap.isImmutable()); }