hardcode the correct ninepatch margins for the button skin

The button is drawn using hardcoded margins that look fine
on a g1. The highres resource has different margins. Changing
the margins alone isn't enough; this also moves the button down
by two pixels to center it better.

Neither the hardcoded margin change nor the offset are
good long-term changes, but they allow us to get by for now.
Marked both with FIXME so we can address this issue by
reading the data directly out of the png, and diagnose why
the button is drawn too high.

fixes http://b/issue?id=2107422
diff --git a/WebKit/android/RenderSkinButton.cpp b/WebKit/android/RenderSkinButton.cpp
index c28dccf..d4483a7 100644
--- a/WebKit/android/RenderSkinButton.cpp
+++ b/WebKit/android/RenderSkinButton.cpp
@@ -51,7 +51,8 @@
     };
 
 static SkBitmap gButton[sizeof(gFiles)/sizeof(gFiles[0])];
-static bool     gDecoded;
+static bool gDecoded;
+static bool gHighRes;
 
 namespace WebCore {
 
@@ -63,6 +64,7 @@
 
     gInited = true;
     gDecoded = true;
+    gHighRes = drawableDirectory[drawableDirectory.length() - 5] == 'h';
     for (size_t i = 0; i < sizeof(gFiles)/sizeof(gFiles[0]); i++) {
         String path = drawableDirectory + gFiles[i].name;
         if (!RenderSkinAndroid::DecodeBitmap(am, path.utf8().data(), &gButton[i])) {
@@ -99,7 +101,16 @@
     SkIRect margin;
 
     margin.set(marginValue, marginValue, marginValue, marginValue);
-    
+    if (gHighRes) {
+    /* FIXME: it shoudn't be necessary to offset the button here,
+       but gives the right results. */
+        bounds.offset(0, SK_Scalar1 * 2);
+    /* FIXME: This temporarily gets around the fact that the margin values and
+       positioning were created for a low res asset, which was used on
+       g1-like devices. A better fix would be to read the offset information
+       out of the png. */
+        margin.set(10, 9, 10, 14);
+    }
     // Draw to the canvas.
     SkNinePatch::DrawNine(canvas, bounds, gButton[newState], margin);
 }