Loading graphics/java/android/graphics/BitmapFactory.java +8 −7 Original line number Diff line number Diff line Loading @@ -519,14 +519,15 @@ public class BitmapFactory { final boolean isNinePatch = np != null && NinePatch.isNinePatchChunk(np); if (opts.inScaled || isNinePatch) { float scale = targetDensity / (float) density; // TODO: This is very inefficient and should be done in native by Skia if (scale != 1.0f) { final Bitmap oldBitmap = bm; bm = Bitmap.createScaledBitmap(oldBitmap, (int) (bm.getWidth() * scale + 0.5f), (int) (bm.getHeight() * scale + 0.5f), true); oldBitmap.recycle(); if (bm != oldBitmap) oldBitmap.recycle(); } if (isNinePatch) { np = nativeScaleNinePatch(np, scale, outPadding); if (scale != 1.0f) np = nativeScaleNinePatch(np, scale, outPadding); bm.setNinePatchChunk(np); } bm.setDensity(targetDensity); Loading Loading
graphics/java/android/graphics/BitmapFactory.java +8 −7 Original line number Diff line number Diff line Loading @@ -519,14 +519,15 @@ public class BitmapFactory { final boolean isNinePatch = np != null && NinePatch.isNinePatchChunk(np); if (opts.inScaled || isNinePatch) { float scale = targetDensity / (float) density; // TODO: This is very inefficient and should be done in native by Skia if (scale != 1.0f) { final Bitmap oldBitmap = bm; bm = Bitmap.createScaledBitmap(oldBitmap, (int) (bm.getWidth() * scale + 0.5f), (int) (bm.getHeight() * scale + 0.5f), true); oldBitmap.recycle(); if (bm != oldBitmap) oldBitmap.recycle(); } if (isNinePatch) { np = nativeScaleNinePatch(np, scale, outPadding); if (scale != 1.0f) np = nativeScaleNinePatch(np, scale, outPadding); bm.setNinePatchChunk(np); } bm.setDensity(targetDensity); Loading