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

Unified Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.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 | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkRadialGradient.cpp
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 1312b3692781e311f5cb48ab72f218c8f52d631e..e666ac3cbd0d71baa7c33c2cc0767f9706ef3d0b 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -60,7 +60,7 @@ SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const {
return kRadial_GradientType;
}
-SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
+sk_sp<SkFlattenable> SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
DescriptorScope desc;
if (!desc.unflatten(buffer)) {
return nullptr;
@@ -68,8 +68,7 @@ SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
const SkPoint center = buffer.readPoint();
const SkScalar radius = buffer.readScalar();
return SkGradientShader::MakeRadial(center, radius, desc.fColors, desc.fPos, desc.fCount,
- desc.fTileMode, desc.fGradFlags,
- desc.fLocalMatrix).release();
+ desc.fTileMode, desc.fGradFlags, desc.fLocalMatrix);
}
void SkRadialGradient::flatten(SkWriteBuffer& buffer) const {
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698