| 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 36e0b9dced3cb5361d473b31a0b6fb066daf9bed..7d4ae14f3a8b6cb1e3bb06b3958e2ee29a0e8141 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Image.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
|
| @@ -185,11 +185,11 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& dstRect, const Flo
|
|
|
| namespace {
|
|
|
| -PassRefPtr<SkShader> createPatternShader(const SkImage* image, const SkMatrix& shaderMatrix,
|
| +sk_sp<SkShader> createPatternShader(const SkImage* image, const SkMatrix& shaderMatrix,
|
| const SkPaint& paint, const FloatSize& spacing)
|
| {
|
| if (spacing.isZero())
|
| - return adoptRef(image->newShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix));
|
| + return image->makeShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix);
|
|
|
| // Arbitrary tiling is currently only supported for SkPictureShader - so we use it instead
|
| // of a plain bitmap shader to implement spacing.
|
| @@ -200,10 +200,10 @@ PassRefPtr<SkShader> createPatternShader(const SkImage* image, const SkMatrix& s
|
| SkPictureRecorder recorder;
|
| SkCanvas* canvas = recorder.beginRecording(tileRect);
|
| canvas->drawImage(image, 0, 0, &paint);
|
| - RefPtr<const SkPicture> picture = adoptRef(recorder.endRecordingAsPicture());
|
| + sk_sp<SkPicture> picture(recorder.endRecordingAsPicture());
|
|
|
| - return adoptRef(SkShader::CreatePictureShader(
|
| - picture.get(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix, nullptr));
|
| + return SkShader::MakePictureShader(
|
| + std::move(picture), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix, nullptr);
|
| }
|
|
|
| } // anonymous namespace
|
| @@ -249,9 +249,8 @@ void Image::drawPattern(GraphicsContext& context, const FloatRect& floatSrcRect,
|
| paint.setXfermodeMode(compositeOp);
|
| paint.setFilterQuality(context.computeFilterQuality(this, destRect, normSrcRect));
|
| paint.setAntiAlias(context.shouldAntialias());
|
| - RefPtr<SkShader> shader = createPatternShader(image.get(), localMatrix, paint,
|
| - FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.height() / scale.height()));
|
| - paint.setShader(shader.get());
|
| + paint.setShader(createPatternShader(image.get(), localMatrix, paint,
|
| + FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.height() / scale.height())));
|
| context.drawRect(destRect, paint);
|
| }
|
|
|
|
|