Index: third_party/WebKit/Source/platform/graphics/Image.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp |
index b3e3178382e1f7c8aa96c09484751fe024083210..5438a87664526d06109ea6b7454b4d0df7f0cf58 100644 |
--- a/third_party/WebKit/Source/platform/graphics/Image.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/Image.cpp |
@@ -227,14 +227,16 @@ void Image::DrawTiledBorder(GraphicsContext& ctxt, |
namespace { |
-sk_sp<PaintShader> CreatePatternShader(const PaintImage& image, |
- const SkMatrix& shader_matrix, |
- const PaintFlags& paint, |
- const FloatSize& spacing, |
- SkShader::TileMode tmx, |
- SkShader::TileMode tmy) { |
- if (spacing.IsZero()) |
- return MakePaintShaderImage(image.sk_image(), tmx, tmy, &shader_matrix); |
+std::unique_ptr<PaintShader> CreatePatternShader(const PaintImage& image, |
+ const SkMatrix& shader_matrix, |
+ const PaintFlags& paint, |
+ const FloatSize& spacing, |
+ SkShader::TileMode tmx, |
+ SkShader::TileMode tmy) { |
+ if (spacing.IsZero()) { |
+ return WTF::MakeUnique<PaintShader>(image.sk_image(), tmx, tmy, |
+ &shader_matrix); |
+ } |
// Arbitrary tiling is currently only supported for SkPictureShader, so we use |
// that instead of a plain bitmap shader to implement spacing. |
@@ -246,8 +248,8 @@ sk_sp<PaintShader> CreatePatternShader(const PaintImage& image, |
PaintCanvas* canvas = recorder.beginRecording(tile_rect); |
canvas->drawImage(image, 0, 0, &paint); |
- return MakePaintShaderRecord(recorder.finishRecordingAsPicture(), tile_rect, |
- tmx, tmy, &shader_matrix); |
+ return WTF::MakeUnique<PaintShader>(recorder.finishRecordingAsPicture(), |
+ tile_rect, tmx, tmy, &shader_matrix); |
} |
SkShader::TileMode ComputeTileMode(float left, |
@@ -327,7 +329,7 @@ void Image::DrawPattern(GraphicsContext& context, |
// If the shader could not be instantiated (e.g. non-invertible matrix), |
// draw transparent. |
// Note: we can't simply bail, because of arbitrary blend mode. |
- if (!flags.getShader()) |
+ if (!flags.HasShader()) |
flags.setColor(SK_ColorTRANSPARENT); |
context.DrawRect(dest_rect, flags); |
@@ -359,9 +361,10 @@ bool Image::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) { |
if (!image) |
return false; |
- flags.setShader(image->makeShader(SkShader::kRepeat_TileMode, |
- SkShader::kRepeat_TileMode, &local_matrix)); |
- if (!flags.getShader()) |
+ flags.setShader( |
+ WTF::MakeUnique<PaintShader>(std::move(image), SkShader::kRepeat_TileMode, |
+ SkShader::kRepeat_TileMode, &local_matrix)); |
+ if (!flags.HasShader()) |
return false; |
// Animation is normally refreshed in draw() impls, which we don't call when |