Tweaks to improve the look of the bookmarks page.

Change the size of the thumbnails for hi dpi. Scale the
thumbnails according to the content width.  Make the overlay
on the first item slightly lighter.

See http://b/issue?id=2137041

Change-Id: Ib461459c37ee03d1a6013a404a35c3869a8bb284
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index faf0e6b..ff8a589 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -2335,16 +2335,24 @@
         }
     }
 
+    /**
+     * Constants for the size of the thumbnail created when taking a screenshot
+     */
+    /* package */ static final int THUMBNAIL_WIDTH = 130;
+    /* package */ static final int THUMBNAIL_HEIGHT = 104;
+
     private Bitmap createScreenshot(WebView view) {
         Picture thumbnail = view.capturePicture();
-        // Keep width and height in sync with BrowserBookmarksPage
-        // and bookmark_thumb
-        Bitmap bm = Bitmap.createBitmap(100, 80,
+        Bitmap bm = Bitmap.createBitmap(THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT,
                 Bitmap.Config.ARGB_4444);
         Canvas canvas = new Canvas(bm);
         // May need to tweak these values to determine what is the
         // best scale factor
-        canvas.scale(.5f, .5f);
+        int contentWidth = view.getContentWidth();
+        if (contentWidth > 0) {
+            float scaleFactor = (float) THUMBNAIL_WIDTH / (float) contentWidth;
+            canvas.scale(scaleFactor, scaleFactor);
+        }
         thumbnail.draw(canvas);
         return bm;
     }