Add drag and drop from AllAppsView (to the workspace).

Also had to fix AppInfoCache to load the icon as a drawable, which I had broken
when I made AllAppsView use the icons as power of two textures.
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 38bc468..fe79c56 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -80,9 +80,6 @@
     /** Original view that is being dragged.  */
     private View mOriginator;
 
-    /** The contents of mOriginator with no scaling.  */
-    private Bitmap mDragBitmap;
-
     /** X offset from the upper-left corner of the cell to where we touched.  */
     private float mTouchOffsetX;
 
@@ -126,13 +123,12 @@
         /**
          * A drag has begun
          * 
-         * @param v The view that is being dragged
          * @param source An object representing where the drag originated
          * @param info The data associated with the object that is being dragged
          * @param dragAction The drag action: either {@link DragController#DRAG_ACTION_MOVE}
          *        or {@link DragController#DRAG_ACTION_COPY}
          */
-        void onDragStart(View v, DragSource source, Object info, int dragAction);
+        void onDragStart(DragSource source, Object info, int dragAction);
         
         /**
          * The drag has eneded
@@ -152,7 +148,7 @@
     }
 
     /**
-     * Starts a drag
+     * Starts a drag.
      * 
      * @param v The view that is being dragged
      * @param source An object representing where the drag originated
@@ -161,6 +157,44 @@
      *        {@link #DRAG_ACTION_COPY}
      */
     public void startDrag(View v, DragSource source, Object dragInfo, int dragAction) {
+        mOriginator = v;
+
+        Bitmap b = getViewBitmap(v);
+
+        int[] loc = mCoordinatesTemp;
+        v.getLocationOnScreen(loc);
+        int screenX = loc[0];
+        int screenY = loc[1];
+
+        startDrag(b, screenX, screenY, 0, 0, b.getWidth(), b.getHeight(),
+                source, dragInfo, dragAction);
+
+        b.recycle();
+
+        if (dragAction == DRAG_ACTION_MOVE) {
+            v.setVisibility(View.GONE);
+        }
+    }
+
+    /**
+     * Starts a drag.
+     * 
+     * @param b The bitmap to display as the drag image.  It will be re-scaled to the
+     *          enlarged size.
+     * @param screenX The x position on screen of the left-top of the bitmap.
+     * @param screenY The y position on screen of the left-top of the bitmap.
+     * @param textureLeft The left edge of the region inside b to use.
+     * @param textureTop The top edge of the region inside b to use.
+     * @param textureWidth The width of the region inside b to use.
+     * @param textureHeight The height of the region inside b to use.
+     * @param source An object representing where the drag originated
+     * @param info The data associated with the object that is being dragged
+     * @param dragAction The drag action: either {@link #DRAG_ACTION_MOVE} or
+     *        {@link #DRAG_ACTION_COPY}
+     */
+    public void startDrag(Bitmap b, int screenX, int screenY,
+            int textureLeft, int textureTop, int textureWidth, int textureHeight,
+            DragSource source, Object dragInfo, int dragAction) {
         if (PROFILE_DRAWING_DURING_DRAG) {
             android.os.Debug.startMethodTracing("Launcher");
         }
@@ -173,14 +207,9 @@
         mInputMethodManager.hideSoftInputFromWindow(mWindowToken, 0);
 
         if (mListener != null) {
-            mListener.onDragStart(v, source, dragInfo, dragAction);
+            mListener.onDragStart(source, dragInfo, dragAction);
         }
 
-        int[] loc = mCoordinatesTemp;
-        v.getLocationOnScreen(loc);
-        int screenX = loc[0];
-        int screenY = loc[1];
-
         int registrationX = ((int)mMotionDownX) - screenX;
         int registrationY = ((int)mMotionDownY) - screenY;
 
@@ -188,20 +217,14 @@
         mTouchOffsetY = mMotionDownY - screenY;
 
         mDragging = true;
-        mOriginator = v;
         mDragSource = source;
         mDragInfo = dragInfo;
 
         mVibrator.vibrate(VIBRATE_DURATION);
 
-        mDragBitmap = getViewBitmap(v);
-        DragView dragView = mDragView = new DragView(mContext, mDragBitmap,
-                registrationX, registrationY);
+        DragView dragView = mDragView = new DragView(mContext, b, registrationX, registrationY,
+                textureLeft, textureTop, textureWidth, textureHeight);
         dragView.show(mWindowToken, (int)mMotionDownX, (int)mMotionDownY);
-
-        if (dragAction == DRAG_ACTION_MOVE) {
-            v.setVisibility(View.GONE);
-        }
     }
 
     /**
@@ -262,10 +285,6 @@
                 mDragView.remove();
                 mDragView = null;
             }
-            if (mDragBitmap != null) {
-                mDragBitmap.recycle();
-                mDragBitmap = null;
-            }
         }
     }