Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa
Review URL: https://codereview.chromium.org/1316513002
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index 30f0fdf..c88e756 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -183,7 +183,7 @@
/*
* All Two point conical gradient test create functions may occasionally create edge case shaders
*/
-GrFragmentProcessor* Edge2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
+const GrFragmentProcessor* Edge2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
SkScalar radius1 = d->fRandom->nextUScalar1();
SkPoint center2;
@@ -209,12 +209,9 @@
center2, radius2,
colors, stops, colorCount,
tm));
- SkPaint paint;
- GrFragmentProcessor* fp;
- GrColor paintColor;
- SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
- GrTest::TestMatrix(d->fRandom), nullptr,
- &paintColor, d->fProcDataManager, &fp));
+ const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
+ GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality, d->fProcDataManager);
+ GrAlwaysAssert(fp);
return fp;
}
@@ -465,7 +462,7 @@
/*
* All Two point conical gradient test create functions may occasionally create edge case shaders
*/
-GrFragmentProcessor* FocalOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
+const GrFragmentProcessor* FocalOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
SkScalar radius1 = 0.f;
SkPoint center2;
@@ -488,15 +485,10 @@
center2, radius2,
colors, stops, colorCount,
tm));
- SkPaint paint;
- GrFragmentProcessor* effect;
- GrColor paintColor;
- GrPaint grPaint;
- SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
- GrTest::TestMatrix(d->fRandom), nullptr,
- &paintColor, d->fProcDataManager,
- &effect));
- return effect;
+ const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
+ GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality, d->fProcDataManager);
+ GrAlwaysAssert(fp);
+ return fp;
}
GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrProcessor& processor)
@@ -676,7 +668,7 @@
/*
* All Two point conical gradient test create functions may occasionally create edge case shaders
*/
-GrFragmentProcessor* FocalInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
+const GrFragmentProcessor* FocalInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
SkScalar radius1 = 0.f;
SkPoint center2;
@@ -701,12 +693,9 @@
center2, radius2,
colors, stops, colorCount,
tm));
- SkPaint paint;
- GrColor paintColor;
- GrFragmentProcessor* fp;
- SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
- GrTest::TestMatrix(d->fRandom), nullptr,
- &paintColor, d->fProcDataManager, &fp));
+ const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
+ GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality, d->fProcDataManager);
+ GrAlwaysAssert(fp);
return fp;
}
@@ -923,8 +912,7 @@
/*
* All Two point conical gradient test create functions may occasionally create edge case shaders
*/
-GrFragmentProcessor*
-CircleInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
+const GrFragmentProcessor* CircleInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius1 != 0
SkPoint center2;
@@ -948,12 +936,9 @@
center2, radius2,
colors, stops, colorCount,
tm));
- SkPaint paint;
- GrColor paintColor;
- GrFragmentProcessor* fp;
- SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
- GrTest::TestMatrix(d->fRandom), nullptr,
- &paintColor, d->fProcDataManager, &fp));
+ const GrFragmentProcessor* fp = shader->asFragmentProcessor(d->fContext,
+ GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality, d->fProcDataManager);
+ GrAlwaysAssert(fp);
return fp;
}
@@ -1154,7 +1139,7 @@
/*
* All Two point conical gradient test create functions may occasionally create edge case shaders
*/
-GrFragmentProcessor* CircleOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
+const GrFragmentProcessor* CircleOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius1 != 0
SkPoint center2;
@@ -1179,12 +1164,10 @@
center2, radius2,
colors, stops, colorCount,
tm));
- SkPaint paint;
- GrColor paintColor;
- GrFragmentProcessor* fp;
- SkAssertResult(shader->asFragmentProcessor(d->fContext, paint,
- GrTest::TestMatrix(d->fRandom), nullptr,
- &paintColor, d->fProcDataManager, &fp));
+ const GrFragmentProcessor* fp = shader->asFragmentProcessor(
+ d->fContext,GrTest::TestMatrix(d->fRandom), NULL, kNone_SkFilterQuality,
+ d->fProcDataManager);
+ GrAlwaysAssert(fp);
return fp;
}