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

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

Issue 1772463002: use Make instead of Create to return a shared shader (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 d175f238cd60a9ac67b97eda59fc3587f1718944..1560cd2f391906c1b5495c308836dad19391acdc 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -68,8 +68,9 @@ SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
}
const SkPoint center = buffer.readPoint();
const SkScalar radius = buffer.readScalar();
- return SkGradientShader::CreateRadial(center, radius, desc.fColors, desc.fPos, desc.fCount,
- desc.fTileMode, desc.fGradFlags, desc.fLocalMatrix);
+ return SkGradientShader::MakeRadial(center, radius, desc.fColors, desc.fPos, desc.fCount,
+ desc.fTileMode, desc.fGradFlags,
+ desc.fLocalMatrix).release();
}
void SkRadialGradient::flatten(SkWriteBuffer& buffer) const {
@@ -313,9 +314,7 @@ const GrFragmentProcessor* GrRadialGradient::TestCreate(GrProcessorTestData* d)
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateRadial(center, radius,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeRadial(center, radius, colors, stops, colorCount, tm);
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality);
GrAlwaysAssert(fp);
« 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