Merge change 1372 into donut

* changes:
  Fixes #1596240. Optimize invalidate/draw passes by marking opaque views and avoiding drawing them. Whenever a View requests an invalidate its parent check whether the view is opaque or not. When the view is not opaque, the framework behaves as it used to. However, when a view is opaque, the parent marks itself as being dirty because of an opaque view. Its parent then does the same, and so on. When the framework then starts drawing the views, it does not draw views marked as dirty opaque. If a view is dirty opaque and receives an invalidate request from a non-opaque view, it then clears the dirty opaque flag and behaves as before.
diff --git a/src/com/android/launcher/Workspace.java b/src/com/android/launcher/Workspace.java
index f20572e..b246ddb 100644
--- a/src/com/android/launcher/Workspace.java
+++ b/src/com/android/launcher/Workspace.java
@@ -457,6 +457,11 @@
     }
 
     @Override
+    public boolean isOpaque() {
+        return !mWallpaper.hasAlpha();
+    }
+
+    @Override
     protected void dispatchDraw(Canvas canvas) {
         boolean restore = false;
 
@@ -915,7 +920,7 @@
                     originalCellLayout.removeView(cell);
                     cellLayout.addView(cell);
                 }
-                mTargetCell = estimateDropCell(source, x - xOffset, y - yOffset,
+                mTargetCell = estimateDropCell(x - xOffset, y - yOffset,
                         mDragInfo.spanX, mDragInfo.spanY, cell, cellLayout, mTargetCell);
                 cellLayout.onDropChild(cell, mTargetCell);
 
@@ -972,7 +977,7 @@
 
         cellLayout.addView(view, insertAtFirst ? 0 : -1);
         view.setOnLongClickListener(mLongClickListener);
-        mTargetCell = estimateDropCell(null, x, y, 1, 1, view, cellLayout, mTargetCell);
+        mTargetCell = estimateDropCell(x, y, 1, 1, view, cellLayout, mTargetCell);
         cellLayout.onDropChild(view, mTargetCell);
         CellLayout.LayoutParams lp = (CellLayout.LayoutParams) view.getLayoutParams();
 
@@ -1015,7 +1020,7 @@
         final Rect location = recycle != null ? recycle : new Rect();
         
         // Find drop cell and convert into rectangle
-        int[] dropCell = estimateDropCell(source, x - xOffset, y - yOffset,
+        int[] dropCell = estimateDropCell(x - xOffset, y - yOffset,
                 spanX, spanY, ignoreView, layout, mTempCell);
         
         if (dropCell == null) {
@@ -1036,7 +1041,7 @@
     /**
      * Calculate the nearest cell where the given object would be dropped.
      */
-    private int[] estimateDropCell(DragSource source, int pixelX, int pixelY,
+    private int[] estimateDropCell(int pixelX, int pixelY,
             int spanX, int spanY, View ignoreView, CellLayout layout, int[] recycle) {
         // Create vacant cell cache if none exists
         if (mVacantCache == null) {