OSDN Git Service

Fix the background of the placeholder.
authorPatrick Scott <phanna@android.com>
Wed, 24 Mar 2010 18:18:50 +0000 (14:18 -0400)
committerPatrick Scott <phanna@android.com>
Wed, 24 Mar 2010 18:18:50 +0000 (14:18 -0400)
Draw a light gray 1 pixel border instead of using an asset.

Bug: 2411524
Change-Id: Ibc95148e2bf13e0dcc58d747e3733cc6993dddf6

WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp

index 677f0da..b0b9b35 100644 (file)
@@ -1027,10 +1027,8 @@ public:
         // with slight modification.
 
         static RefPtr<Image> image;
-        static RefPtr<Image> bg;
-        if (!image || !bg) {
+        if (!image) {
             image = Image::loadPlatformResource("togglePlugin");
-            bg = Image::loadPlatformResource("togglePluginBg");
         }
 
         IntRect imageRect(x(), y(), image->width(), image->height());
@@ -1050,8 +1048,13 @@ public:
 
         ctx->save();
         ctx->clip(frameRect());
-        ctx->drawTiledImage(bg.get(), DeviceColorSpace, frameRect(),
-                IntPoint(), IntSize(bg->width(), bg->height()));
+
+        // Draw a 1 pixel light gray border
+        ctx->setFillColor(Color::white, DeviceColorSpace);
+        ctx->setStrokeColor(Color::lightGray, DeviceColorSpace);
+        ctx->drawRect(frameRect());
+
+        // Draw the image in the center
         ctx->drawImage(image.get(), DeviceColorSpace, imageRect.location());
         ctx->restore();
     }