From d538fa0fb21171d8256b7d800ae757757f4e3a44 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Sun, 15 Mar 2015 19:03:29 -0700 Subject: [PATCH] Frameworks/base: Don't allocate another identity matrix There is already an identity matrix in Matrix. Don't allocate another one for VectorDrawable. Change-Id: I51735f262d6680e043b0009707ec42acb2d0d1ad --- graphics/java/android/graphics/drawable/VectorDrawable.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index 8b0f635482e07..8b69782c2d831 100644 --- a/graphics/java/android/graphics/drawable/VectorDrawable.java +++ b/graphics/java/android/graphics/drawable/VectorDrawable.java @@ -791,7 +791,6 @@ public class VectorDrawable extends Drawable { // is no need for deep copying. private final Path mPath; private final Path mRenderPath; - private static final Matrix IDENTITY_MATRIX = new Matrix(); private final Matrix mFinalPathMatrix = new Matrix(); private Paint mStrokePaint; @@ -932,7 +931,7 @@ public class VectorDrawable extends Drawable { public void draw(Canvas canvas, int w, int h, ColorFilter filter) { // Travese the tree in pre-order to draw. - drawGroupTree(mRootGroup, IDENTITY_MATRIX, canvas, w, h, filter); + drawGroupTree(mRootGroup, Matrix.IDENTITY_MATRIX, canvas, w, h, filter); } private void drawPath(VGroup vGroup, VPath vPath, Canvas canvas, int w, int h,