OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkTwoPointConicalGradient_gpu.h" | 9 #include "SkTwoPointConicalGradient_gpu.h" |
10 | 10 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 SkShader::TileMode tm; | 210 SkShader::TileMode tm; |
211 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 211 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
212 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, | 212 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, |
213 center
2, radius2, | 213 center
2, radius2, |
214 colors
, stops, colorCount, | 214 colors
, stops, colorCount, |
215 tm)); | 215 tm)); |
216 SkPaint paint; | 216 SkPaint paint; |
217 GrFragmentProcessor* fp; | 217 GrFragmentProcessor* fp; |
218 GrColor paintColor; | 218 GrColor paintColor; |
219 SkAssertResult(shader->asFragmentProcessor(context, paint, | 219 SkAssertResult(shader->asFragmentProcessor(context, paint, |
220 GrProcessorUnitTest::TestMatrix(r
andom), NULL, | 220 GrTest::TestMatrix(random), NULL, |
221 &paintColor, &fp)); | 221 &paintColor, &fp)); |
222 return fp; | 222 return fp; |
223 } | 223 } |
224 | 224 |
225 GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrProcessor&) | 225 GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrProcessor&) |
226 : fVSVaryingName(NULL) | 226 : fVSVaryingName(NULL) |
227 , fFSVaryingName(NULL) | 227 , fFSVaryingName(NULL) |
228 , fCachedRadius(-SK_ScalarMax) | 228 , fCachedRadius(-SK_ScalarMax) |
229 , fCachedDiffRadius(-SK_ScalarMax) {} | 229 , fCachedDiffRadius(-SK_ScalarMax) {} |
230 | 230 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 497 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
498 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, | 498 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, |
499 center
2, radius2, | 499 center
2, radius2, |
500 colors
, stops, colorCount, | 500 colors
, stops, colorCount, |
501 tm)); | 501 tm)); |
502 SkPaint paint; | 502 SkPaint paint; |
503 GrFragmentProcessor* effect; | 503 GrFragmentProcessor* effect; |
504 GrColor paintColor; | 504 GrColor paintColor; |
505 | 505 |
506 SkAssertResult(shader->asFragmentProcessor(context, paint, | 506 SkAssertResult(shader->asFragmentProcessor(context, paint, |
507 GrProcessorUnitTest::TestMatrix(r
andom), NULL, | 507 GrTest::TestMatrix(random), NULL, |
508 &paintColor, &effect)); | 508 &paintColor, &effect)); |
509 return effect; | 509 return effect; |
510 } | 510 } |
511 | 511 |
512 GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrProcessor
& processor) | 512 GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrProcessor
& processor) |
513 : fVSVaryingName(NULL) | 513 : fVSVaryingName(NULL) |
514 , fFSVaryingName(NULL) | 514 , fFSVaryingName(NULL) |
515 , fCachedFocal(SK_ScalarMax) { | 515 , fCachedFocal(SK_ScalarMax) { |
516 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); | 516 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); |
517 fIsFlipped = data.isFlipped(); | 517 fIsFlipped = data.isFlipped(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 SkShader::TileMode tm; | 717 SkShader::TileMode tm; |
718 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 718 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
719 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, | 719 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, |
720 center
2, radius2, | 720 center
2, radius2, |
721 colors
, stops, colorCount, | 721 colors
, stops, colorCount, |
722 tm)); | 722 tm)); |
723 SkPaint paint; | 723 SkPaint paint; |
724 GrColor paintColor; | 724 GrColor paintColor; |
725 GrFragmentProcessor* fp; | 725 GrFragmentProcessor* fp; |
726 SkAssertResult(shader->asFragmentProcessor(context, paint, | 726 SkAssertResult(shader->asFragmentProcessor(context, paint, |
727 GrProcessorUnitTest::TestMatrix(r
andom), NULL, | 727 GrTest::TestMatrix(random), NULL, |
728 &paintColor, &fp)); | 728 &paintColor, &fp)); |
729 return fp; | 729 return fp; |
730 } | 730 } |
731 | 731 |
732 GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrProcessor&) | 732 GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrProcessor&) |
733 : fVSVaryingName(NULL) | 733 : fVSVaryingName(NULL) |
734 , fFSVaryingName(NULL) | 734 , fFSVaryingName(NULL) |
735 , fCachedFocal(SK_ScalarMax) {} | 735 , fCachedFocal(SK_ScalarMax) {} |
736 | 736 |
737 void GLFocalInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder, | 737 void GLFocalInside2PtConicalEffect::emitCode(GrGLFPBuilder* builder, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 SkShader::TileMode tm; | 972 SkShader::TileMode tm; |
973 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 973 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
974 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, | 974 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, |
975 center
2, radius2, | 975 center
2, radius2, |
976 colors
, stops, colorCount, | 976 colors
, stops, colorCount, |
977 tm)); | 977 tm)); |
978 SkPaint paint; | 978 SkPaint paint; |
979 GrColor paintColor; | 979 GrColor paintColor; |
980 GrFragmentProcessor* processor; | 980 GrFragmentProcessor* processor; |
981 SkAssertResult(shader->asFragmentProcessor(context, paint, | 981 SkAssertResult(shader->asFragmentProcessor(context, paint, |
982 GrProcessorUnitTest::TestMatrix(r
andom), NULL, | 982 GrTest::TestMatrix(random), NULL, |
983 &paintColor, &processor)); | 983 &paintColor, &processor)); |
984 return processor; | 984 return processor; |
985 } | 985 } |
986 | 986 |
987 GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrProcessor
& processor) | 987 GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrProcessor
& processor) |
988 : fVSVaryingName(NULL) | 988 : fVSVaryingName(NULL) |
989 , fFSVaryingName(NULL) | 989 , fFSVaryingName(NULL) |
990 , fCachedCenterX(SK_ScalarMax) | 990 , fCachedCenterX(SK_ScalarMax) |
991 , fCachedCenterY(SK_ScalarMax) | 991 , fCachedCenterY(SK_ScalarMax) |
992 , fCachedA(SK_ScalarMax) | 992 , fCachedA(SK_ScalarMax) |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 int colorCount = RandomGradientParams(random, colors, &stops, &tm); | 1214 int colorCount = RandomGradientParams(random, colors, &stops, &tm); |
1215 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, | 1215 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateTwoPointConical(center
1, radius1, |
1216 center
2, radius2, | 1216 center
2, radius2, |
1217 colors
, stops, colorCount, | 1217 colors
, stops, colorCount, |
1218 tm)); | 1218 tm)); |
1219 SkPaint paint; | 1219 SkPaint paint; |
1220 GrColor paintColor; | 1220 GrColor paintColor; |
1221 GrFragmentProcessor* processor; | 1221 GrFragmentProcessor* processor; |
1222 | 1222 |
1223 SkAssertResult(shader->asFragmentProcessor(context, paint, | 1223 SkAssertResult(shader->asFragmentProcessor(context, paint, |
1224 GrProcessorUnitTest::TestMatrix(r
andom), NULL, | 1224 GrTest::TestMatrix(random), NULL, |
1225 &paintColor, &processor)); | 1225 &paintColor, &processor)); |
1226 return processor; | 1226 return processor; |
1227 } | 1227 } |
1228 | 1228 |
1229 GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrProcess
or& processor) | 1229 GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrProcess
or& processor) |
1230 : fVSVaryingName(NULL) | 1230 : fVSVaryingName(NULL) |
1231 , fFSVaryingName(NULL) | 1231 , fFSVaryingName(NULL) |
1232 , fCachedCenterX(SK_ScalarMax) | 1232 , fCachedCenterX(SK_ScalarMax) |
1233 , fCachedCenterY(SK_ScalarMax) | 1233 , fCachedCenterY(SK_ScalarMax) |
1234 , fCachedA(SK_ScalarMax) | 1234 , fCachedA(SK_ScalarMax) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); | 1372 return CircleInside2PtConicalEffect::Create(ctx, shader, matrix, tm, inf
o); |
1373 } else if (type == kEdge_ConicalType) { | 1373 } else if (type == kEdge_ConicalType) { |
1374 set_matrix_edge_conical(shader, &matrix); | 1374 set_matrix_edge_conical(shader, &matrix); |
1375 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); | 1375 return Edge2PtConicalEffect::Create(ctx, shader, matrix, tm); |
1376 } else { | 1376 } else { |
1377 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); | 1377 return CircleOutside2PtConicalEffect::Create(ctx, shader, matrix, tm, in
fo); |
1378 } | 1378 } |
1379 } | 1379 } |
1380 | 1380 |
1381 #endif | 1381 #endif |
OLD | NEW |