Index: Source/platform/graphics/GraphicsLayer.cpp |
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp |
index d4cfec068531bfc6af789a6234b2ea02cd898210..98cc5139f15d2baa6a5d5e2f4cb2dd693b80baaa 100644 |
--- a/Source/platform/graphics/GraphicsLayer.cpp |
+++ b/Source/platform/graphics/GraphicsLayer.cpp |
@@ -952,7 +952,15 @@ void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture |
RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : nullptr; |
if (nativeImage) { |
m_ninePatchLayer = adoptPtr(Platform::current()->compositorSupport()->createNinePatchLayer()); |
- m_ninePatchLayer->setBitmap(nativeImage->bitmap(), aperture); |
+ const SkBitmap& bitmap = nativeImage->bitmap(); |
+ int borderWidth = bitmap.width() - aperture.width(); |
+ int borderHeight = bitmap.height() - aperture.height(); |
+ WebRect border(aperture.x(), aperture.y(), borderWidth, borderHeight); |
+ |
+ m_ninePatchLayer->setBitmap(bitmap); |
+ m_ninePatchLayer->setAperture(aperture); |
+ m_ninePatchLayer->setBorder(border); |
+ |
m_ninePatchLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); |
registerContentsLayer(m_ninePatchLayer->layer()); |
} |