Move color extraction utils to extractor class so each instance can
have its own set of temp variables.
- Pass in float[] param to not create new obj in each frame
for dragging widget case.
Bug: 175329686
Bug: 187019711
Test: manual, verify
Change-Id: I4350fb7e66a80c73def5659fb41abc14d357e667
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index bff3cab..972a6e8 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -242,8 +242,8 @@
* @param outRect The out rect where we return the bounds of {@param view} in drag layer coords.
*/
public static void getBoundsForViewInDragLayer(BaseDragLayer dragLayer, View view,
- Rect viewBounds, boolean ignoreTransform, RectF outRect) {
- float[] points = sTmpFloatArray;
+ Rect viewBounds, boolean ignoreTransform, float[] recycle, RectF outRect) {
+ float[] points = recycle == null ? new float[4] : recycle;
points[0] = viewBounds.left;
points[1] = viewBounds.top;
points[2] = viewBounds.right;