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 9ae1fd60567713f10660a605e025ff2c733f920f..7d26d488c44f1f914c7cc9fc6f26678f7793a19d 100644 |
--- a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp |
@@ -5,10 +5,9 @@ |
#include "platform/graphics/ImagePattern.h" |
#include "platform/graphics/Image.h" |
+#include "platform/graphics/paint/PaintShader.h" |
#include "platform/graphics/skia/SkiaUtils.h" |
-#include "third_party/skia/include/core/SkCanvas.h" |
#include "third_party/skia/include/core/SkImage.h" |
-#include "third_party/skia/include/core/SkShader.h" |
#include "third_party/skia/include/core/SkSurface.h" |
namespace blink { |
@@ -41,14 +40,14 @@ bool ImagePattern::isLocalMatrixChanged(const SkMatrix& localMatrix) const { |
return localMatrix != m_previousLocalMatrix; |
} |
-sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) { |
+sk_sp<PaintShader> ImagePattern::createShader(const SkMatrix& localMatrix) { |
if (!m_tileImage) |
- return SkShader::MakeColorShader(SK_ColorTRANSPARENT); |
+ return WrapSkShader(SkShader::MakeColorShader(SK_ColorTRANSPARENT)); |
if (isRepeatXY()) { |
// Fast path: for repeatXY we just return a shader from the original image. |
- return m_tileImage->makeShader(SkShader::kRepeat_TileMode, |
- SkShader::kRepeat_TileMode, &localMatrix); |
+ return MakePaintShaderImage(m_tileImage, SkShader::kRepeat_TileMode, |
+ SkShader::kRepeat_TileMode, &localMatrix); |
} |
// Skia does not have a "draw the tile only once" option. Clamp_TileMode |
@@ -70,7 +69,7 @@ sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) { |
SkSurface::MakeRasterN32Premul(m_tileImage->width() + 2 * borderPixelX, |
m_tileImage->height() + 2 * borderPixelY); |
if (!surface) |
- return SkShader::MakeColorShader(SK_ColorTRANSPARENT); |
+ return WrapSkShader(SkShader::MakeColorShader(SK_ColorTRANSPARENT)); |
SkPaint paint; |
paint.setBlendMode(SkBlendMode::kSrc); |
@@ -81,8 +80,8 @@ sk_sp<SkShader> ImagePattern::createShader(const SkMatrix& localMatrix) { |
SkMatrix adjustedMatrix(localMatrix); |
adjustedMatrix.postTranslate(-borderPixelX, -borderPixelY); |
- return surface->makeImageSnapshot()->makeShader(tileModeX, tileModeY, |
- &adjustedMatrix); |
+ return MakePaintShaderImage(surface->makeImageSnapshot(), tileModeX, |
+ tileModeY, &adjustedMatrix); |
} |
bool ImagePattern::isTextureBacked() const { |