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

Unified Diff: src/effects/gradients/SkSweepGradient.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/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkSweepGradient.cpp
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 1bdf40e1155d225138c1ad548e08432b014f34d5..3021e4bc084bed4b22d90ff47566c67a606d98d3 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -36,8 +36,8 @@ SkFlattenable* SkSweepGradient::CreateProc(SkReadBuffer& buffer) {
return nullptr;
}
const SkPoint center = buffer.readPoint();
- return SkGradientShader::CreateSweep(center.x(), center.y(), desc.fColors, desc.fPos,
- desc.fCount, desc.fGradFlags, desc.fLocalMatrix);
+ return SkGradientShader::MakeSweep(center.x(), center.y(), desc.fColors, desc.fPos,
+ desc.fCount, desc.fGradFlags, desc.fLocalMatrix).release();
}
void SkSweepGradient::flatten(SkWriteBuffer& buffer) const {
@@ -190,8 +190,8 @@ const GrFragmentProcessor* GrSweepGradient::TestCreate(GrProcessorTestData* d) {
SkScalar* stops = stopsArray;
SkShader::TileMode tmIgnored;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tmIgnored);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateSweep(center.fX, center.fY,
- colors, stops, colorCount));
+ sk_sp<SkShader> shader(SkGradientShader::MakeSweep(center.fX, center.fY, colors, stops,
+ colorCount));
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom),
NULL, kNone_SkFilterQuality);
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698