Fixing regression in stack task clipping.

- Removing expensive calls to map coordinates of front task to the tasks
  behind it, instead relying on the precalculated task rects that we
  already compute on each stack change update.  To prevent rounding
  issues, the task rects are now float rects.
- Also fixing crash when RecentsActivity starts before the SystemUI
  component (only an issue when pushing SysUI apks)

Change-Id: Ia84e9b9d165c0ce171c7fe3797e561ef24157a0a
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index 03097ea..aaeb10c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -26,10 +26,10 @@
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Rect;
+import android.graphics.RectF;
 import android.os.Handler;
 import android.os.SystemClock;
 import android.os.UserHandle;
-import android.util.Log;
 import android.util.MutableBoolean;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -540,7 +540,7 @@
         Task toTask = new Task();
         TaskViewTransform toTransform = getThumbnailTransitionTransform(stack, stackView,
                 topTask.id, toTask);
-        Rect toTaskRect = toTransform.rect;
+        RectF toTaskRect = toTransform.rect;
         Bitmap thumbnail;
         if (mThumbnailTransitionBitmapCacheKey != null
                 && mThumbnailTransitionBitmapCacheKey.key != null
@@ -554,8 +554,8 @@
         }
         if (thumbnail != null) {
             return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
-                    thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
-                    toTaskRect.height(), mHandler, this);
+                    thumbnail, (int) toTaskRect.left, (int) toTaskRect.top,
+                    (int) toTaskRect.width(), (int) toTaskRect.height(), mHandler, this);
         }
 
         // If both the screenshot and thumbnail fails, then just fall back to the default transition