summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorShimeng (Simon) Wang <swang@google.com>2010-03-29 14:56:55 -0700
committerShimeng (Simon) Wang <swang@google.com>2010-03-29 14:56:55 -0700
commit0e264b005307cf90741d94b1619940fec20da11a (patch)
tree329103f54f9c515b13dc95b15703cc0b5bb05621 /WebKit
parent526c77460deab759c0c4cb3c7eb701b1d4e92da3 (diff)
downloadexternal_webkit-0e264b005307cf90741d94b1619940fec20da11a.zip
external_webkit-0e264b005307cf90741d94b1619940fec20da11a.tar.gz
external_webkit-0e264b005307cf90741d94b1619940fec20da11a.tar.bz2
Add 2 pixel padding and draw 2 pixel border for flash-on-demand.
Issue: 2411524 Change-Id: I04c94b8122cd85dda071a85f74a054a613b39e8c
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index b0b9b35..424617b 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -1049,10 +1049,17 @@ public:
ctx->save();
ctx->clip(frameRect());
- // Draw a 1 pixel light gray border
ctx->setFillColor(Color::white, DeviceColorSpace);
- ctx->setStrokeColor(Color::lightGray, DeviceColorSpace);
- ctx->drawRect(frameRect());
+ ctx->fillRect(frameRect());
+ if (frameRect().contains(imageRect)) {
+ // Leave a 2 pixel padding.
+ const int pixelWidth = 2;
+ IntRect innerRect = frameRect();
+ innerRect.inflate(-pixelWidth);
+ // Draw a 2 pixel light gray border.
+ ctx->setStrokeColor(Color::lightGray, DeviceColorSpace);
+ ctx->strokeRect(innerRect, pixelWidth);
+ }
// Draw the image in the center
ctx->drawImage(image.get(), DeviceColorSpace, imageRect.location());