Workaorund a strange proguard and VM issue before Lollipop.

It seems like there is some proguard and VM issue before lollipop, that we
need to convert the input parameter into float first.
Or adding log to all the parameters before cubicTo also works. :-/

b/28691851

Change-Id: I871ac11e3a1c7fd6718a3a8ec51ff1a4cd436d3b
diff --git a/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java b/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java
index b68d2cb..a9b1d1d 100644
--- a/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java
+++ b/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java
@@ -721,12 +721,17 @@
                 double q2x = e2x - alpha * ep2x;
                 double q2y = e2y - alpha * ep2y;
 
-                p.cubicTo((float) q1x,
-                        (float) q1y,
-                        (float) q2x,
-                        (float) q2y,
-                        (float) e2x,
-                        (float) e2y);
+                // Use the extra math below and relative cubicTo function, just to work around
+                // one issue with VM and proguard.
+                final float delta_q1x = (float) q1x - (float) e1x;
+                final float delta_q1y = (float) q1y - (float) e1y;
+                final float delta_q2x = (float) q2x - (float) e1x;
+                final float delta_q2y = (float) q2y - (float) e1y;
+                final float delta_e2x = (float) e2x - (float) e1x;
+                final float delta_e2y = (float) e2y - (float) e1y;
+
+                p.rCubicTo(delta_q1x, delta_q1y, delta_q2x, delta_q2y, delta_e2x, delta_e2y);
+
                 eta1 = eta2;
                 e1x = e2x;
                 e1y = e2y;
diff --git a/graphics/drawable/static/tests/res/drawable-nodpi/vector_icon_five_bars_golden.png b/graphics/drawable/static/tests/res/drawable-nodpi/vector_icon_five_bars_golden.png
new file mode 100644
index 0000000..54fde97
--- /dev/null
+++ b/graphics/drawable/static/tests/res/drawable-nodpi/vector_icon_five_bars_golden.png
Binary files differ
diff --git a/graphics/drawable/static/tests/res/drawable/vector_icon_five_bars.xml b/graphics/drawable/static/tests/res/drawable/vector_icon_five_bars.xml
new file mode 100644
index 0000000..ae1827a
--- /dev/null
+++ b/graphics/drawable/static/tests/res/drawable/vector_icon_five_bars.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:viewportWidth="48"
+        android:viewportHeight="48"
+        android:width="48dp"
+        android:height="48dp">
+    <group
+            android:translateY="-1004.4">
+        <path
+                android:pathData="M43.925 1017.6a0.77327 0.46949 89.874 0 0 -0.47235 -0.7723l-3.2846 0.01a0.77327 0.46949 89.874 0 0 -0.46729 0.7745l0.04706 21.387a0.77327 0.46949 89.874 0 0 0.47069 0.7723l3.2846 -0.01a0.77327 0.46949 89.874 0 0 0.46895 -0.7744l-0.04706 -21.387z"
+                android:fillColor="#686461" />
+        <path
+                android:name="class1"
+                android:pathData="M37.283 1013.3a1.0856 0.74326 89.874 0 0 -0.74579 -1.0845l-5.2005 0.012a1.0856 0.74326 89.874 0 0 -0.74101 1.0876l0.06607 30.027a1.0856 0.74326 89.874 0 0 0.74578 1.0827l5.2005 -0.012a1.0856 0.74326 89.874 0 0 0.74101 -1.0859l-0.06607 -30.027z"
+                android:fillColor="#686461" />
+        <path
+                android:name="class2"
+                android:pathData="M27.863 1009.4a1.3733 0.89108 89.874 0 0 -0.89277 -1.3718l-6.2366 0.014a1.3733 0.89108 89.874 0 0 -0.88839 1.3756l0.08361 37.983a1.3733 0.89108 89.874 0 0 0.89443 1.37l6.2366 -0.014a1.3733 0.89108 89.874 0 0 0.88673 -1.3741l-0.08361 -37.983z"
+                android:fillColor="#686461" />
+        <path
+                android:name="class3"
+                android:pathData="M17.456 1013.4a1.0856 0.74326 89.874 0 0 -0.74412 -1.0844l-5.2021 0.012a1.0856 0.74326 89.874 0 0 -0.74101 1.0876l0.06607 30.027a1.0856 0.74326 89.874 0 0 0.74578 1.0828l5.2021 -0.012a1.0856 0.74326 89.874 0 0 0.73935 -1.086L17.456 1013.4Z"
+                android:fillColor="#686461" />
+        <path
+                android:name="class4"
+                android:pathData="M8.2537 1017.7a0.77327 0.46949 89.874 0 0 -0.47235 -0.7724l-3.2846 0.01a0.77327 0.46949 89.874 0 0 -0.46895 0.7745l0.047055 21.387a0.77327 0.46949 89.874 0 0 0.47235 0.7722l3.2846 -0.01a0.77327 0.46949 89.874 0 0 0.46895 -0.7743L8.253702 1017.7Z"
+                android:fillColor="#686461" />
+    </group>
+</vector>
\ No newline at end of file
diff --git a/graphics/drawable/static/tests/src/android/support/graphics/drawable/tests/VectorDrawableTest.java b/graphics/drawable/static/tests/src/android/support/graphics/drawable/tests/VectorDrawableTest.java
index 8fb9c2d..c941bbd 100644
--- a/graphics/drawable/static/tests/src/android/support/graphics/drawable/tests/VectorDrawableTest.java
+++ b/graphics/drawable/static/tests/src/android/support/graphics/drawable/tests/VectorDrawableTest.java
@@ -73,6 +73,7 @@
             R.drawable.vector_icon_group_clip,
             R.drawable.vector_icon_share,
             R.drawable.vector_icon_wishlist,
+            R.drawable.vector_icon_five_bars,
     };
 
     private static final int[] GOLDEN_IMAGES = new int[]{
@@ -101,6 +102,7 @@
             R.drawable.vector_icon_group_clip_golden,
             R.drawable.vector_icon_share_golden,
             R.drawable.vector_icon_wishlist_golden,
+            R.drawable.vector_icon_five_bars_golden,
     };
 
     private static final int TEST_ICON = R.drawable.vector_icon_create;