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

Unified Diff: src/effects/gradients/SkLinearGradient.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/SkXfermodeImageFilter.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index f521bd702425fe7e0d1c02314bd9391e84b20082..e9fc865583b3b7b4fb19f092493f19a487519cdb 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -54,7 +54,7 @@ SkLinearGradient::SkLinearGradient(const SkPoint pts[2], const Descriptor& desc)
, fEnd(pts[1]) {
}
-SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) {
+sk_sp<SkFlattenable> SkLinearGradient::CreateProc(SkReadBuffer& buffer) {
DescriptorScope desc;
if (!desc.unflatten(buffer)) {
return nullptr;
@@ -63,7 +63,7 @@ SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) {
pts[0] = buffer.readPoint();
pts[1] = buffer.readPoint();
return SkGradientShader::MakeLinear(pts, desc.fColors, desc.fPos, desc.fCount, desc.fTileMode,
- desc.fGradFlags, desc.fLocalMatrix).release();
+ desc.fGradFlags, desc.fLocalMatrix);
}
void SkLinearGradient::flatten(SkWriteBuffer& buffer) const {
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698