Fix error in Palette resize function

This ultimately led to the internal bitmap
used for color extraction being very
very small, which hurt quality. Since we
are now using the correct size, performance
has dropped by roughly 25%.

500 iterations (now vs previously)
Pixel: 3620ms, 2712ms
N5: 14996ms, 12435ms
GN: 31540ms, 24109ms

Test: all pass
BUG: 31392794

Change-Id: I7cc81e9ab2f44895a5ee9f4736d92318f4dfdced
diff --git a/v7/palette/src/main/java/android/support/v7/graphics/Palette.java b/v7/palette/src/main/java/android/support/v7/graphics/Palette.java
index 93570de..d092587 100644
--- a/v7/palette/src/main/java/android/support/v7/graphics/Palette.java
+++ b/v7/palette/src/main/java/android/support/v7/graphics/Palette.java
@@ -84,7 +84,7 @@
         void onGenerated(Palette palette);
     }
 
-    static final int DEFAULT_RESIZE_BITMAP_AREA = 160 * 160;
+    static final int DEFAULT_RESIZE_BITMAP_AREA = 112 * 112;
     static final int DEFAULT_CALCULATE_NUMBER_COLORS = 16;
 
     static final float MIN_CONTRAST_TITLE_TEXT = 3.0f;
@@ -909,7 +909,7 @@
             if (mResizeArea > 0) {
                 final int bitmapArea = bitmap.getWidth() * bitmap.getHeight();
                 if (bitmapArea > mResizeArea) {
-                    scaleRatio = mResizeArea / (double) bitmapArea;
+                    scaleRatio = Math.sqrt(mResizeArea / (double) bitmapArea);
                 }
             } else if (mResizeMaxDimension > 0) {
                 final int maxDimension = Math.max(bitmap.getWidth(), bitmap.getHeight());