| 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 7d4ae14f3a8b6cb1e3bb06b3958e2ee29a0e8141..36e0b9dced3cb5361d473b31a0b6fb066daf9bed 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Image.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
|
| @@ -185,11 +185,11 @@
|
|
|
| namespace {
|
|
|
| -sk_sp<SkShader> createPatternShader(const SkImage* image, const SkMatrix& shaderMatrix,
|
| +PassRefPtr<SkShader> createPatternShader(const SkImage* image, const SkMatrix& shaderMatrix,
|
| const SkPaint& paint, const FloatSize& spacing)
|
| {
|
| if (spacing.isZero())
|
| - return image->makeShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix);
|
| + return adoptRef(image->newShader(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 @@
|
| SkPictureRecorder recorder;
|
| SkCanvas* canvas = recorder.beginRecording(tileRect);
|
| canvas->drawImage(image, 0, 0, &paint);
|
| - sk_sp<SkPicture> picture(recorder.endRecordingAsPicture());
|
| -
|
| - return SkShader::MakePictureShader(
|
| - std::move(picture), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix, nullptr);
|
| + RefPtr<const SkPicture> picture = adoptRef(recorder.endRecordingAsPicture());
|
| +
|
| + return adoptRef(SkShader::CreatePictureShader(
|
| + picture.get(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &shaderMatrix, nullptr));
|
| }
|
|
|
| } // anonymous namespace
|
| @@ -249,8 +249,9 @@
|
| paint.setXfermodeMode(compositeOp);
|
| paint.setFilterQuality(context.computeFilterQuality(this, destRect, normSrcRect));
|
| paint.setAntiAlias(context.shouldAntialias());
|
| - paint.setShader(createPatternShader(image.get(), localMatrix, paint,
|
| - FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.height() / scale.height())));
|
| + RefPtr<SkShader> shader = createPatternShader(image.get(), localMatrix, paint,
|
| + FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.height() / scale.height()));
|
| + paint.setShader(shader.get());
|
| context.drawRect(destRect, paint);
|
| }
|
|
|
|
|