Index: third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
index 7decc3076d51b8801bba501abae5f31b8111bb41..cb21803367f1c215d8cda66c39b5653bee040aba 100644 |
--- a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
@@ -56,7 +56,7 @@ sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) const |
// original, then copy the orignal into it. |
// FIXME: Is there a better way to pad (not scale) an image in skia? |
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( |
- m_tileImage->width() + expandW, m_tileImage->height() + expandH); |
+ m_tileImage->width() + expandW * 2, m_tileImage->height() + expandH * 2); |
if (!surface) |
return SkShader::MakeColorShader(SK_ColorTRANSPARENT); |
@@ -64,7 +64,10 @@ sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) const |
paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
surface->getCanvas()->drawImage(m_tileImage, 0, 0, &paint); |
- return surface->makeImageSnapshot()->makeShader(tileModeX, tileModeY, &localMatrix); |
+ SkMatrix newLocalMatrix(localMatrix); |
+ newLocalMatrix.setTranslate((isRepeatX() ? 0 : -1), (isRepeatY() ? 0 : -1)); |
+ |
+ return surface->makeImageSnapshot()->makeShader(tileModeX, tileModeY, &newLocalMatrix); |
} |
bool ImagePattern::isTextureBacked() const |