Adds pseudo AA to thumbnails

 Bug: 3321583
 This changes the thumbnail rendering to draw to a bitmap 2x as large
 and then down-scale with filtering to try and reduce aliasing on the
 thumbnails.

Change-Id: Ifdc5254d6c49afbbd0b50d57a90f08faf25789e2
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 6541ec0..6a01136 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1848,10 +1848,16 @@
     }
 
     private static Bitmap createScreenshot(WebView view, int width, int height) {
+        // We render to a bitmap 2x the desired size so that we can then
+        // re-scale it with filtering since canvas.scale doesn't filter
+        // This helps reduce aliasing at the cost of being slightly blurry
+        final int filter_scale = 2;
         Picture thumbnail = view.capturePicture();
         if (thumbnail == null) {
             return null;
         }
+        width *= filter_scale;
+        height *= filter_scale;
         Bitmap bm = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
         Canvas canvas = new Canvas(bm);
         // May need to tweak these values to determine what is the
@@ -1877,7 +1883,10 @@
         canvas.scale(scaleFactor, scaleFactor);
 
         thumbnail.draw(canvas);
-        return bm;
+        Bitmap ret = Bitmap.createScaledBitmap(bm, width / filter_scale,
+                height / filter_scale, true);
+        bm.recycle();
+        return ret;
     }
 
     private void updateScreenshot(WebView view) {