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

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient_gpu.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/SkTwoPointConicalGradient.cpp ('k') | src/utils/SkMeshUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index 5b0855ab7c71e0ee0c48299d2b7801e4ac66d8f1..539436928cafbcbfe83f9295910b2efb51ffd805 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -207,10 +207,8 @@ const GrFragmentProcessor* Edge2PtConicalEffect::TestCreate(GrProcessorTestData*
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center1, radius1,
- center2, radius2,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
+ colors, stops, colorCount, tm);
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality);
GrAlwaysAssert(fp);
@@ -484,10 +482,8 @@ const GrFragmentProcessor* FocalOutside2PtConicalEffect::TestCreate(GrProcessorT
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center1, radius1,
- center2, radius2,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
+ colors, stops, colorCount, tm);
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality);
GrAlwaysAssert(fp);
@@ -692,10 +688,8 @@ const GrFragmentProcessor* FocalInside2PtConicalEffect::TestCreate(GrProcessorTe
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center1, radius1,
- center2, radius2,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
+ colors, stops, colorCount, tm);
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality);
GrAlwaysAssert(fp);
@@ -940,10 +934,8 @@ const GrFragmentProcessor* CircleInside2PtConicalEffect::TestCreate(GrProcessorT
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center1, radius1,
- center2, radius2,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
+ colors, stops, colorCount, tm);
const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality);
GrAlwaysAssert(fp);
@@ -1173,10 +1165,8 @@ const GrFragmentProcessor* CircleOutside2PtConicalEffect::TestCreate(GrProcessor
SkScalar* stops = stopsArray;
SkShader::TileMode tm;
int colorCount = RandomGradientParams(d->fRandom, colors, &stops, &tm);
- SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center1, radius1,
- center2, radius2,
- colors, stops, colorCount,
- tm));
+ auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center2, radius2,
+ 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/SkTwoPointConicalGradient.cpp ('k') | src/utils/SkMeshUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698