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

Unified Diff: src/effects/gradients/SkLinearGradient.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/SkGradientShader.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 15d461960dd8f6b97230d989bbce7d497bc7b660..8ad120991d5176c64fb2439dc823eb76082a48a0 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -78,8 +78,8 @@ SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) {
SkPoint pts[2];
pts[0] = buffer.readPoint();
pts[1] = buffer.readPoint();
- return SkGradientShader::CreateLinear(pts, desc.fColors, desc.fPos, desc.fCount,
- desc.fTileMode, desc.fGradFlags, desc.fLocalMatrix);
+ return SkGradientShader::MakeLinear(pts, desc.fColors, desc.fPos, desc.fCount, desc.fTileMode,
+ desc.fGradFlags, desc.fLocalMatrix).release();
}
void SkLinearGradient::flatten(SkWriteBuffer& buffer) const {
@@ -430,9 +430,7 @@ const GrFragmentProcessor* GrLinearGradient::TestCreate(GrProcessorTestData* d)
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(points,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeLinear(points, 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/SkGradientShader.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698