From f1ea323e0e11b0f6f56b0c02f51bf403a2a853a1 Mon Sep 17 00:00:00 2001 From: karlhendrikse Date: Tue, 8 Sep 2015 17:51:51 +1000 Subject: [PATCH] Remove an unneccesary bitmap allocation --- src/com/larvalabs/svgandroid/SVG.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/larvalabs/svgandroid/SVG.java b/src/com/larvalabs/svgandroid/SVG.java index 9aa2b89..76ef6fc 100644 --- a/src/com/larvalabs/svgandroid/SVG.java +++ b/src/com/larvalabs/svgandroid/SVG.java @@ -102,10 +102,8 @@ public PictureDrawable createPictureDrawable() { */ public Picture resizePicture(int height, int width){ Picture newPicture = new Picture(); - Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bitmap); - canvas = newPicture.beginRecording(width, height); - canvas.drawPicture(picture, new Rect(0,0,width,height)); + Canvas canvas = newPicture.beginRecording(width, height); + canvas.drawPicture(picture, new Rect(0, 0, width, height)); newPicture.endRecording(); return newPicture; }