Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1786183002: Revert of Switch Blink SkShader clients to sk_sp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Gradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 3de1af13e9a5f4466040c87b7bac98d7ed2af67c..fb40160723e975ef54dfe3cae48bfde4a37f87cb 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -286,15 +286,16 @@
SkPaint paint;
drawForContainer(patternPicture.context().canvas(), paint, containerSize, zoom, tile, srcRect, url);
}
- // TODO(fmalita): convert SkPictureBuilder to return sk_sp<SkPicture>
- sk_sp<SkPicture> tilePicture(const_cast<SkPicture*>(patternPicture.endRecording().leakRef()));
+ RefPtr<const SkPicture> tilePicture = patternPicture.endRecording();
SkMatrix patternTransform;
patternTransform.setTranslate(phase.x() + spacedTile.x(), phase.y() + spacedTile.y());
+ RefPtr<SkShader> patternShader = adoptRef(SkShader::CreatePictureShader(
+ tilePicture.get(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode,
+ &patternTransform, nullptr));
SkPaint paint;
- paint.setShader(SkShader::MakePictureShader(std::move(tilePicture),
- SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &patternTransform, nullptr));
+ paint.setShader(patternShader.get());
paint.setXfermodeMode(compositeOp);
paint.setColorFilter(context.colorFilter());
context.drawRect(dstRect, paint);
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/Gradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698