OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkTwoPointConicalGradient_gpu.h" | 8 #include "SkTwoPointConicalGradient_gpu.h" |
9 | 9 |
10 #include "SkTwoPointConicalGradient.h" | 10 #include "SkTwoPointConicalGradient.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SkScalar invDiffLen = SkScalarInvert(diffLen); | 53 SkScalar invDiffLen = SkScalarInvert(diffLen); |
54 SkMatrix rot; | 54 SkMatrix rot; |
55 rot.setSinCos(-SkScalarMul(invDiffLen, diff.fY), | 55 rot.setSinCos(-SkScalarMul(invDiffLen, diff.fY), |
56 SkScalarMul(invDiffLen, diff.fX)); | 56 SkScalarMul(invDiffLen, diff.fX)); |
57 invLMatrix->postConcat(rot); | 57 invLMatrix->postConcat(rot); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 class Edge2PtConicalEffect : public GrGradientEffect { | 61 class Edge2PtConicalEffect : public GrGradientEffect { |
62 public: | 62 public: |
| 63 class GLSLEdge2PtConicalProcessor; |
63 | 64 |
64 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, | 65 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, |
65 const SkTwoPointConicalGradient& shad
er, | 66 const SkTwoPointConicalGradient& shad
er, |
66 const SkMatrix& matrix, | 67 const SkMatrix& matrix, |
67 SkShader::TileMode tm) { | 68 SkShader::TileMode tm) { |
68 return sk_sp<GrFragmentProcessor>(new Edge2PtConicalEffect(ctx, shader,
matrix, tm)); | 69 return sk_sp<GrFragmentProcessor>(new Edge2PtConicalEffect(ctx, shader,
matrix, tm)); |
69 } | 70 } |
70 | 71 |
71 virtual ~Edge2PtConicalEffect() {} | 72 virtual ~Edge2PtConicalEffect() {} |
72 | 73 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 GrCoordTransform fBTransform; | 134 GrCoordTransform fBTransform; |
134 SkScalar fCenterX1; | 135 SkScalar fCenterX1; |
135 SkScalar fRadius0; | 136 SkScalar fRadius0; |
136 SkScalar fDiffRadius; | 137 SkScalar fDiffRadius; |
137 | 138 |
138 // @} | 139 // @} |
139 | 140 |
140 typedef GrGradientEffect INHERITED; | 141 typedef GrGradientEffect INHERITED; |
141 }; | 142 }; |
142 | 143 |
143 class GLEdge2PtConicalEffect : public GrGLGradientEffect { | 144 class Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor : public GrGradientEffec
t::GLSLProcessor { |
144 public: | 145 public: |
145 GLEdge2PtConicalEffect(const GrProcessor&); | 146 GLSLEdge2PtConicalProcessor(const GrProcessor&); |
146 virtual ~GLEdge2PtConicalEffect() { } | 147 virtual ~GLSLEdge2PtConicalProcessor() { } |
147 | 148 |
148 virtual void emitCode(EmitArgs&) override; | 149 virtual void emitCode(EmitArgs&) override; |
149 | 150 |
150 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); | 151 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); |
151 | 152 |
152 protected: | 153 protected: |
153 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 154 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
154 | 155 |
155 UniformHandle fParamUni; | 156 UniformHandle fParamUni; |
156 | 157 |
157 const char* fVSVaryingName; | 158 const char* fVSVaryingName; |
158 const char* fFSVaryingName; | 159 const char* fFSVaryingName; |
159 | 160 |
160 // @{ | 161 // @{ |
161 /// Values last uploaded as uniforms | 162 /// Values last uploaded as uniforms |
162 | 163 |
163 SkScalar fCachedRadius; | 164 SkScalar fCachedRadius; |
164 SkScalar fCachedDiffRadius; | 165 SkScalar fCachedDiffRadius; |
165 | 166 |
166 // @} | 167 // @} |
167 | 168 |
168 private: | 169 private: |
169 typedef GrGLGradientEffect INHERITED; | 170 typedef GrGradientEffect::GLSLProcessor INHERITED; |
170 | 171 |
171 }; | 172 }; |
172 | 173 |
173 void Edge2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, | 174 void Edge2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
174 GrProcessorKeyBuilder* b) const
{ | 175 GrProcessorKeyBuilder* b) const
{ |
175 GLEdge2PtConicalEffect::GenKey(*this, caps, b); | 176 Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::GenKey(*this, caps, b); |
176 } | 177 } |
177 | 178 |
178 GrGLSLFragmentProcessor* Edge2PtConicalEffect::onCreateGLSLInstance() const { | 179 GrGLSLFragmentProcessor* Edge2PtConicalEffect::onCreateGLSLInstance() const { |
179 return new GLEdge2PtConicalEffect(*this); | 180 return new Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor(*this); |
180 } | 181 } |
181 | 182 |
182 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Edge2PtConicalEffect); | 183 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Edge2PtConicalEffect); |
183 | 184 |
184 /* | 185 /* |
185 * All Two point conical gradient test create functions may occasionally create
edge case shaders | 186 * All Two point conical gradient test create functions may occasionally create
edge case shaders |
186 */ | 187 */ |
187 sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData*
d) { | 188 sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData*
d) { |
188 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; | 189 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; |
189 SkScalar radius1 = d->fRandom->nextUScalar1(); | 190 SkScalar radius1 = d->fRandom->nextUScalar1(); |
(...skipping 19 matching lines...) Expand all Loading... |
209 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, | 210 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, |
210 colors, stops, colorCoun
t, tm); | 211 colors, stops, colorCoun
t, tm); |
211 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); | 212 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
212 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( | 213 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( |
213 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, | 214 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, |
214 SkSourceGammaTreatment::kRespect)); | 215 SkSourceGammaTreatment::kRespect)); |
215 GrAlwaysAssert(fp); | 216 GrAlwaysAssert(fp); |
216 return fp; | 217 return fp; |
217 } | 218 } |
218 | 219 |
219 GLEdge2PtConicalEffect::GLEdge2PtConicalEffect(const GrProcessor&) | 220 Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::GLSLEdge2PtConicalProcessor(c
onst GrProcessor&) |
220 : fVSVaryingName(nullptr) | 221 : fVSVaryingName(nullptr) |
221 , fFSVaryingName(nullptr) | 222 , fFSVaryingName(nullptr) |
222 , fCachedRadius(-SK_ScalarMax) | 223 , fCachedRadius(-SK_ScalarMax) |
223 , fCachedDiffRadius(-SK_ScalarMax) {} | 224 , fCachedDiffRadius(-SK_ScalarMax) {} |
224 | 225 |
225 void GLEdge2PtConicalEffect::emitCode(EmitArgs& args) { | 226 void Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::emitCode(EmitArgs& args)
{ |
226 const Edge2PtConicalEffect& ge = args.fFp.cast<Edge2PtConicalEffect>(); | 227 const Edge2PtConicalEffect& ge = args.fFp.cast<Edge2PtConicalEffect>(); |
227 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 228 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
228 this->emitUniforms(uniformHandler, ge); | 229 this->emitUniforms(uniformHandler, ge); |
229 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 230 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
230 kVec3f_GrSLType, kDefault_GrSLPrecisi
on, | 231 kVec3f_GrSLType, kDefault_GrSLPrecisi
on, |
231 "Conical2FSParams"); | 232 "Conical2FSParams"); |
232 | 233 |
233 SkString cName("c"); | 234 SkString cName("c"); |
234 SkString tName("t"); | 235 SkString tName("t"); |
235 SkString p0; // start radius | 236 SkString p0; // start radius |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 uniformHandler, | 278 uniformHandler, |
278 args.fGLSLCaps, | 279 args.fGLSLCaps, |
279 ge, | 280 ge, |
280 tName.c_str(), | 281 tName.c_str(), |
281 args.fOutputColor, | 282 args.fOutputColor, |
282 args.fInputColor, | 283 args.fInputColor, |
283 args.fTexSamplers); | 284 args.fTexSamplers); |
284 fragBuilder->codeAppend("\t}\n"); | 285 fragBuilder->codeAppend("\t}\n"); |
285 } | 286 } |
286 | 287 |
287 void GLEdge2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& pdman, | 288 void Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::onSetData( |
288 const GrProcessor& processor) { | 289 const GrGLSLProgramDataManager& pdman, |
| 290 const GrProcessor& processor) { |
289 INHERITED::onSetData(pdman, processor); | 291 INHERITED::onSetData(pdman, processor); |
290 const Edge2PtConicalEffect& data = processor.cast<Edge2PtConicalEffect>(); | 292 const Edge2PtConicalEffect& data = processor.cast<Edge2PtConicalEffect>(); |
291 SkScalar radius0 = data.radius(); | 293 SkScalar radius0 = data.radius(); |
292 SkScalar diffRadius = data.diffRadius(); | 294 SkScalar diffRadius = data.diffRadius(); |
293 | 295 |
294 if (fCachedRadius != radius0 || | 296 if (fCachedRadius != radius0 || |
295 fCachedDiffRadius != diffRadius) { | 297 fCachedDiffRadius != diffRadius) { |
296 | 298 |
297 pdman.set3f(fParamUni, SkScalarToFloat(radius0), | 299 pdman.set3f(fParamUni, SkScalarToFloat(radius0), |
298 SkScalarToFloat(SkScalarMul(radius0, radius0)), SkScalarToFl
oat(diffRadius)); | 300 SkScalarToFloat(SkScalarMul(radius0, radius0)), SkScalarToFl
oat(diffRadius)); |
299 fCachedRadius = radius0; | 301 fCachedRadius = radius0; |
300 fCachedDiffRadius = diffRadius; | 302 fCachedDiffRadius = diffRadius; |
301 } | 303 } |
302 } | 304 } |
303 | 305 |
304 void GLEdge2PtConicalEffect::GenKey(const GrProcessor& processor, | 306 void Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::GenKey(const GrProcessor
& processor, |
305 const GrGLSLCaps&, GrProcessorKeyBuilder* b)
{ | 307 const GrGLSLCaps&, GrProcessorKeyBuilder* b)
{ |
306 b->add32(GenBaseGradientKey(processor)); | 308 b->add32(GenBaseGradientKey(processor)); |
307 } | 309 } |
308 | 310 |
309 ////////////////////////////////////////////////////////////////////////////// | 311 ////////////////////////////////////////////////////////////////////////////// |
310 // Focal Conical Gradients | 312 // Focal Conical Gradients |
311 ////////////////////////////////////////////////////////////////////////////// | 313 ////////////////////////////////////////////////////////////////////////////// |
312 | 314 |
313 static ConicalType set_matrix_focal_conical(const SkTwoPointConicalGradient& sha
der, | 315 static ConicalType set_matrix_focal_conical(const SkTwoPointConicalGradient& sha
der, |
314 SkMatrix* invLMatrix, SkScalar* foca
lX) { | 316 SkMatrix* invLMatrix, SkScalar* foca
lX) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 365 |
364 invLMatrix->postConcat(matrix); | 366 invLMatrix->postConcat(matrix); |
365 | 367 |
366 return conicalType; | 368 return conicalType; |
367 } | 369 } |
368 | 370 |
369 ////////////////////////////////////////////////////////////////////////////// | 371 ////////////////////////////////////////////////////////////////////////////// |
370 | 372 |
371 class FocalOutside2PtConicalEffect : public GrGradientEffect { | 373 class FocalOutside2PtConicalEffect : public GrGradientEffect { |
372 public: | 374 public: |
| 375 class GLSLFocalOutside2PtConicalProcessor; |
373 | 376 |
374 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, | 377 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, |
375 const SkTwoPointConicalGradient& shad
er, | 378 const SkTwoPointConicalGradient& shad
er, |
376 const SkMatrix& matrix, | 379 const SkMatrix& matrix, |
377 SkShader::TileMode tm, | 380 SkShader::TileMode tm, |
378 SkScalar focalX) { | 381 SkScalar focalX) { |
379 return sk_sp<GrFragmentProcessor>( | 382 return sk_sp<GrFragmentProcessor>( |
380 new FocalOutside2PtConicalEffect(ctx, shader, matrix, tm, focalX)); | 383 new FocalOutside2PtConicalEffect(ctx, shader, matrix, tm, focalX)); |
381 } | 384 } |
382 | 385 |
(...skipping 30 matching lines...) Expand all Loading... |
413 } | 416 } |
414 | 417 |
415 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 418 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
416 | 419 |
417 SkScalar fFocalX; | 420 SkScalar fFocalX; |
418 bool fIsFlipped; | 421 bool fIsFlipped; |
419 | 422 |
420 typedef GrGradientEffect INHERITED; | 423 typedef GrGradientEffect INHERITED; |
421 }; | 424 }; |
422 | 425 |
423 class GLFocalOutside2PtConicalEffect : public GrGLGradientEffect { | 426 class FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor |
| 427 : public GrGradientEffect::GLSLProcessor { |
424 public: | 428 public: |
425 GLFocalOutside2PtConicalEffect(const GrProcessor&); | 429 GLSLFocalOutside2PtConicalProcessor(const GrProcessor&); |
426 virtual ~GLFocalOutside2PtConicalEffect() { } | 430 virtual ~GLSLFocalOutside2PtConicalProcessor() { } |
427 | 431 |
428 virtual void emitCode(EmitArgs&) override; | 432 virtual void emitCode(EmitArgs&) override; |
429 | 433 |
430 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); | 434 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); |
431 | 435 |
432 protected: | 436 protected: |
433 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 437 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
434 | 438 |
435 UniformHandle fParamUni; | 439 UniformHandle fParamUni; |
436 | 440 |
437 const char* fVSVaryingName; | 441 const char* fVSVaryingName; |
438 const char* fFSVaryingName; | 442 const char* fFSVaryingName; |
439 | 443 |
440 bool fIsFlipped; | 444 bool fIsFlipped; |
441 | 445 |
442 // @{ | 446 // @{ |
443 /// Values last uploaded as uniforms | 447 /// Values last uploaded as uniforms |
444 | 448 |
445 SkScalar fCachedFocal; | 449 SkScalar fCachedFocal; |
446 | 450 |
447 // @} | 451 // @} |
448 | 452 |
449 private: | 453 private: |
450 typedef GrGLGradientEffect INHERITED; | 454 typedef GrGradientEffect::GLSLProcessor INHERITED; |
451 | 455 |
452 }; | 456 }; |
453 | 457 |
454 void FocalOutside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, | 458 void FocalOutside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
455 GrProcessorKeyBuilder*
b) const { | 459 GrProcessorKeyBuilder*
b) const { |
456 GLFocalOutside2PtConicalEffect::GenKey(*this, caps, b); | 460 FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor::GenKey(*t
his, caps, b); |
457 } | 461 } |
458 | 462 |
459 GrGLSLFragmentProcessor* FocalOutside2PtConicalEffect::onCreateGLSLInstance() co
nst { | 463 GrGLSLFragmentProcessor* FocalOutside2PtConicalEffect::onCreateGLSLInstance() co
nst { |
460 return new GLFocalOutside2PtConicalEffect(*this); | 464 return new FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor
(*this); |
461 } | 465 } |
462 | 466 |
463 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalOutside2PtConicalEffect); | 467 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalOutside2PtConicalEffect); |
464 | 468 |
465 /* | 469 /* |
466 * All Two point conical gradient test create functions may occasionally create
edge case shaders | 470 * All Two point conical gradient test create functions may occasionally create
edge case shaders |
467 */ | 471 */ |
468 sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorT
estData* d) { | 472 sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorT
estData* d) { |
469 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; | 473 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; |
470 SkScalar radius1 = 0.f; | 474 SkScalar radius1 = 0.f; |
(...skipping 16 matching lines...) Expand all Loading... |
487 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, | 491 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, |
488 colors, stops, colorCoun
t, tm); | 492 colors, stops, colorCoun
t, tm); |
489 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); | 493 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
490 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( | 494 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( |
491 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, | 495 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, |
492 SkSourceGammaTreatment::kRespect)); | 496 SkSourceGammaTreatment::kRespect)); |
493 GrAlwaysAssert(fp); | 497 GrAlwaysAssert(fp); |
494 return fp; | 498 return fp; |
495 } | 499 } |
496 | 500 |
497 GLFocalOutside2PtConicalEffect::GLFocalOutside2PtConicalEffect(const GrProcessor
& processor) | 501 FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor |
| 502 ::GLSLFocalOutside2PtConicalProcessor(const GrProces
sor& processor) |
498 : fVSVaryingName(nullptr) | 503 : fVSVaryingName(nullptr) |
499 , fFSVaryingName(nullptr) | 504 , fFSVaryingName(nullptr) |
500 , fCachedFocal(SK_ScalarMax) { | 505 , fCachedFocal(SK_ScalarMax) { |
501 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); | 506 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); |
502 fIsFlipped = data.isFlipped(); | 507 fIsFlipped = data.isFlipped(); |
503 } | 508 } |
504 | 509 |
505 void GLFocalOutside2PtConicalEffect::emitCode(EmitArgs& args) { | 510 void FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor::emitCode
(EmitArgs& args) { |
506 const FocalOutside2PtConicalEffect& ge = args.fFp.cast<FocalOutside2PtConica
lEffect>(); | 511 const FocalOutside2PtConicalEffect& ge = args.fFp.cast<FocalOutside2PtConica
lEffect>(); |
507 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 512 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
508 this->emitUniforms(uniformHandler, ge); | 513 this->emitUniforms(uniformHandler, ge); |
509 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 514 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
510 kVec2f_GrSLType, kDefault_GrSLPrecisi
on, | 515 kVec2f_GrSLType, kDefault_GrSLPrecisi
on, |
511 "Conical2FSParams"); | 516 "Conical2FSParams"); |
512 SkString tName("t"); | 517 SkString tName("t"); |
513 SkString p0; // focalX | 518 SkString p0; // focalX |
514 SkString p1; // 1 - focalX * focalX | 519 SkString p1; // 1 - focalX * focalX |
515 | 520 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 uniformHandler, | 552 uniformHandler, |
548 args.fGLSLCaps, | 553 args.fGLSLCaps, |
549 ge, | 554 ge, |
550 tName.c_str(), | 555 tName.c_str(), |
551 args.fOutputColor, | 556 args.fOutputColor, |
552 args.fInputColor, | 557 args.fInputColor, |
553 args.fTexSamplers); | 558 args.fTexSamplers); |
554 fragBuilder->codeAppend("\t}\n"); | 559 fragBuilder->codeAppend("\t}\n"); |
555 } | 560 } |
556 | 561 |
557 void GLFocalOutside2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& p
dman, | 562 void FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor::onSetDat
a( |
558 const GrProcessor& processor) { | 563 const GrGLSLProgramDataManager& pdma
n, |
| 564 const GrProcessor& processor) { |
559 INHERITED::onSetData(pdman, processor); | 565 INHERITED::onSetData(pdman, processor); |
560 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); | 566 const FocalOutside2PtConicalEffect& data = processor.cast<FocalOutside2PtCon
icalEffect>(); |
561 SkASSERT(data.isFlipped() == fIsFlipped); | 567 SkASSERT(data.isFlipped() == fIsFlipped); |
562 SkScalar focal = data.focal(); | 568 SkScalar focal = data.focal(); |
563 | 569 |
564 if (fCachedFocal != focal) { | 570 if (fCachedFocal != focal) { |
565 SkScalar oneMinus2F = 1.f - SkScalarMul(focal, focal); | 571 SkScalar oneMinus2F = 1.f - SkScalarMul(focal, focal); |
566 | 572 |
567 pdman.set2f(fParamUni, SkScalarToFloat(focal), SkScalarToFloat(oneMinus2
F)); | 573 pdman.set2f(fParamUni, SkScalarToFloat(focal), SkScalarToFloat(oneMinus2
F)); |
568 fCachedFocal = focal; | 574 fCachedFocal = focal; |
569 } | 575 } |
570 } | 576 } |
571 | 577 |
572 void GLFocalOutside2PtConicalEffect::GenKey(const GrProcessor& processor, | 578 void FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor::GenKey( |
| 579 const GrProcessor& processor, |
573 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { | 580 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { |
574 uint32_t* key = b->add32n(2); | 581 uint32_t* key = b->add32n(2); |
575 key[0] = GenBaseGradientKey(processor); | 582 key[0] = GenBaseGradientKey(processor); |
576 key[1] = processor.cast<FocalOutside2PtConicalEffect>().isFlipped(); | 583 key[1] = processor.cast<FocalOutside2PtConicalEffect>().isFlipped(); |
577 } | 584 } |
578 | 585 |
579 ////////////////////////////////////////////////////////////////////////////// | 586 ////////////////////////////////////////////////////////////////////////////// |
580 | 587 |
581 class GLFocalInside2PtConicalEffect; | |
582 | |
583 class FocalInside2PtConicalEffect : public GrGradientEffect { | 588 class FocalInside2PtConicalEffect : public GrGradientEffect { |
584 public: | 589 public: |
| 590 class GLSLFocalInside2PtConicalProcessor; |
585 | 591 |
586 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, | 592 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, |
587 const SkTwoPointConicalGradient& shad
er, | 593 const SkTwoPointConicalGradient& shad
er, |
588 const SkMatrix& matrix, | 594 const SkMatrix& matrix, |
589 SkShader::TileMode tm, | 595 SkShader::TileMode tm, |
590 SkScalar focalX) { | 596 SkScalar focalX) { |
591 return sk_sp<GrFragmentProcessor>( | 597 return sk_sp<GrFragmentProcessor>( |
592 new FocalInside2PtConicalEffect(ctx, shader, matrix, tm, focalX)); | 598 new FocalInside2PtConicalEffect(ctx, shader, matrix, tm, focalX)); |
593 } | 599 } |
594 | 600 |
595 virtual ~FocalInside2PtConicalEffect() {} | 601 virtual ~FocalInside2PtConicalEffect() {} |
596 | 602 |
597 const char* name() const override { | 603 const char* name() const override { |
598 return "Two-Point Conical Gradient Focal Inside"; | 604 return "Two-Point Conical Gradient Focal Inside"; |
599 } | 605 } |
600 | 606 |
601 SkScalar focal() const { return fFocalX; } | 607 SkScalar focal() const { return fFocalX; } |
602 | 608 |
603 typedef GLFocalInside2PtConicalEffect GLSLProcessor; | 609 typedef FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor GLSL
Processor; |
604 | 610 |
605 private: | 611 private: |
606 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; | 612 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
607 | 613 |
608 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; | 614 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const
override; |
609 | 615 |
610 bool onIsEqual(const GrFragmentProcessor& sBase) const override { | 616 bool onIsEqual(const GrFragmentProcessor& sBase) const override { |
611 const FocalInside2PtConicalEffect& s = sBase.cast<FocalInside2PtConicalE
ffect>(); | 617 const FocalInside2PtConicalEffect& s = sBase.cast<FocalInside2PtConicalE
ffect>(); |
612 return (INHERITED::onIsEqual(sBase) && | 618 return (INHERITED::onIsEqual(sBase) && |
613 this->fFocalX == s.fFocalX); | 619 this->fFocalX == s.fFocalX); |
614 } | 620 } |
615 | 621 |
616 FocalInside2PtConicalEffect(GrContext* ctx, | 622 FocalInside2PtConicalEffect(GrContext* ctx, |
617 const SkTwoPointConicalGradient& shader, | 623 const SkTwoPointConicalGradient& shader, |
618 const SkMatrix& matrix, | 624 const SkMatrix& matrix, |
619 SkShader::TileMode tm, | 625 SkShader::TileMode tm, |
620 SkScalar focalX) | 626 SkScalar focalX) |
621 : INHERITED(ctx, shader, matrix, tm), fFocalX(focalX) { | 627 : INHERITED(ctx, shader, matrix, tm), fFocalX(focalX) { |
622 this->initClassID<FocalInside2PtConicalEffect>(); | 628 this->initClassID<FocalInside2PtConicalEffect>(); |
623 } | 629 } |
624 | 630 |
625 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 631 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
626 | 632 |
627 SkScalar fFocalX; | 633 SkScalar fFocalX; |
628 | 634 |
629 typedef GrGradientEffect INHERITED; | 635 typedef GrGradientEffect INHERITED; |
630 }; | 636 }; |
631 | 637 |
632 class GLFocalInside2PtConicalEffect : public GrGLGradientEffect { | 638 class FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor |
| 639 : public GrGradientEffect::GLSLProcessor { |
633 public: | 640 public: |
634 GLFocalInside2PtConicalEffect(const GrProcessor&); | 641 GLSLFocalInside2PtConicalProcessor(const GrProcessor&); |
635 virtual ~GLFocalInside2PtConicalEffect() {} | 642 virtual ~GLSLFocalInside2PtConicalProcessor() {} |
636 | 643 |
637 virtual void emitCode(EmitArgs&) override; | 644 virtual void emitCode(EmitArgs&) override; |
638 | 645 |
639 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); | 646 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); |
640 | 647 |
641 protected: | 648 protected: |
642 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 649 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
643 | 650 |
644 UniformHandle fFocalUni; | 651 UniformHandle fFocalUni; |
645 | 652 |
646 const char* fVSVaryingName; | 653 const char* fVSVaryingName; |
647 const char* fFSVaryingName; | 654 const char* fFSVaryingName; |
648 | 655 |
649 // @{ | 656 // @{ |
650 /// Values last uploaded as uniforms | 657 /// Values last uploaded as uniforms |
651 | 658 |
652 SkScalar fCachedFocal; | 659 SkScalar fCachedFocal; |
653 | 660 |
654 // @} | 661 // @} |
655 | 662 |
656 private: | 663 private: |
657 typedef GrGLGradientEffect INHERITED; | 664 typedef GrGradientEffect::GLSLProcessor INHERITED; |
658 | 665 |
659 }; | 666 }; |
660 | 667 |
661 void FocalInside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, | 668 void FocalInside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
662 GrProcessorKeyBuilder* b
) const { | 669 GrProcessorKeyBuilder* b
) const { |
663 GLFocalInside2PtConicalEffect::GenKey(*this, caps, b); | 670 FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor::GenKey(*thi
s, caps, b); |
664 } | 671 } |
665 | 672 |
666 GrGLSLFragmentProcessor* FocalInside2PtConicalEffect::onCreateGLSLInstance() con
st { | 673 GrGLSLFragmentProcessor* FocalInside2PtConicalEffect::onCreateGLSLInstance() con
st { |
667 return new GLFocalInside2PtConicalEffect(*this); | 674 return new FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor(*
this); |
668 } | 675 } |
669 | 676 |
670 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalInside2PtConicalEffect); | 677 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalInside2PtConicalEffect); |
671 | 678 |
672 /* | 679 /* |
673 * All Two point conical gradient test create functions may occasionally create
edge case shaders | 680 * All Two point conical gradient test create functions may occasionally create
edge case shaders |
674 */ | 681 */ |
675 sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTe
stData* d) { | 682 sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTe
stData* d) { |
676 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; | 683 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; |
677 SkScalar radius1 = 0.f; | 684 SkScalar radius1 = 0.f; |
(...skipping 18 matching lines...) Expand all Loading... |
696 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, | 703 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, |
697 colors, stops, colorCoun
t, tm); | 704 colors, stops, colorCoun
t, tm); |
698 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); | 705 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
699 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( | 706 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( |
700 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, | 707 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, |
701 SkSourceGammaTreatment::kRespect)); | 708 SkSourceGammaTreatment::kRespect)); |
702 GrAlwaysAssert(fp); | 709 GrAlwaysAssert(fp); |
703 return fp; | 710 return fp; |
704 } | 711 } |
705 | 712 |
706 GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrProcessor&) | 713 FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor |
| 714 ::GLSLFocalInside2PtConicalProcessor(const GrProcesso
r&) |
707 : fVSVaryingName(nullptr) | 715 : fVSVaryingName(nullptr) |
708 , fFSVaryingName(nullptr) | 716 , fFSVaryingName(nullptr) |
709 , fCachedFocal(SK_ScalarMax) {} | 717 , fCachedFocal(SK_ScalarMax) {} |
710 | 718 |
711 void GLFocalInside2PtConicalEffect::emitCode(EmitArgs& args) { | 719 void FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor::emitCode(E
mitArgs& args) { |
712 const FocalInside2PtConicalEffect& ge = args.fFp.cast<FocalInside2PtConicalE
ffect>(); | 720 const FocalInside2PtConicalEffect& ge = args.fFp.cast<FocalInside2PtConicalE
ffect>(); |
713 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 721 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
714 this->emitUniforms(uniformHandler, ge); | 722 this->emitUniforms(uniformHandler, ge); |
715 fFocalUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 723 fFocalUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
716 kFloat_GrSLType, kDefault_GrSLPrecisi
on, | 724 kFloat_GrSLType, kDefault_GrSLPrecisi
on, |
717 "Conical2FSParams"); | 725 "Conical2FSParams"); |
718 SkString tName("t"); | 726 SkString tName("t"); |
719 | 727 |
720 // this is the distance along x-axis from the end center to focal point in | 728 // this is the distance along x-axis from the end center to focal point in |
721 // transformed coordinates | 729 // transformed coordinates |
(...skipping 11 matching lines...) Expand all Loading... |
733 this->emitColor(fragBuilder, | 741 this->emitColor(fragBuilder, |
734 uniformHandler, | 742 uniformHandler, |
735 args.fGLSLCaps, | 743 args.fGLSLCaps, |
736 ge, | 744 ge, |
737 tName.c_str(), | 745 tName.c_str(), |
738 args.fOutputColor, | 746 args.fOutputColor, |
739 args.fInputColor, | 747 args.fInputColor, |
740 args.fTexSamplers); | 748 args.fTexSamplers); |
741 } | 749 } |
742 | 750 |
743 void GLFocalInside2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& pd
man, | 751 void FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor::onSetData( |
744 const GrProcessor& processor) { | 752 const GrGLSLProgramDataManager& pdma
n, |
| 753 const GrProcessor& processor) { |
745 INHERITED::onSetData(pdman, processor); | 754 INHERITED::onSetData(pdman, processor); |
746 const FocalInside2PtConicalEffect& data = processor.cast<FocalInside2PtConic
alEffect>(); | 755 const FocalInside2PtConicalEffect& data = processor.cast<FocalInside2PtConic
alEffect>(); |
747 SkScalar focal = data.focal(); | 756 SkScalar focal = data.focal(); |
748 | 757 |
749 if (fCachedFocal != focal) { | 758 if (fCachedFocal != focal) { |
750 pdman.set1f(fFocalUni, SkScalarToFloat(focal)); | 759 pdman.set1f(fFocalUni, SkScalarToFloat(focal)); |
751 fCachedFocal = focal; | 760 fCachedFocal = focal; |
752 } | 761 } |
753 } | 762 } |
754 | 763 |
755 void GLFocalInside2PtConicalEffect::GenKey(const GrProcessor& processor, | 764 void FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor::GenKey( |
756 const GrGLSLCaps&, GrProcessorKeyBuil
der* b) { | 765 const GrProcessor& processor, |
| 766 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { |
757 b->add32(GenBaseGradientKey(processor)); | 767 b->add32(GenBaseGradientKey(processor)); |
758 } | 768 } |
759 | 769 |
760 ////////////////////////////////////////////////////////////////////////////// | 770 ////////////////////////////////////////////////////////////////////////////// |
761 // Circle Conical Gradients | 771 // Circle Conical Gradients |
762 ////////////////////////////////////////////////////////////////////////////// | 772 ////////////////////////////////////////////////////////////////////////////// |
763 | 773 |
764 struct CircleConicalInfo { | 774 struct CircleConicalInfo { |
765 SkPoint fCenterEnd; | 775 SkPoint fCenterEnd; |
766 SkScalar fA; | 776 SkScalar fA; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 826 |
817 // if A ends up being negative, the start circle is contained completely ins
ide the end cirlce | 827 // if A ends up being negative, the start circle is contained completely ins
ide the end cirlce |
818 if (A < 0.f) { | 828 if (A < 0.f) { |
819 return kInside_ConicalType; | 829 return kInside_ConicalType; |
820 } | 830 } |
821 return kOutside_ConicalType; | 831 return kOutside_ConicalType; |
822 } | 832 } |
823 | 833 |
824 class CircleInside2PtConicalEffect : public GrGradientEffect { | 834 class CircleInside2PtConicalEffect : public GrGradientEffect { |
825 public: | 835 public: |
| 836 class GLSLCircleInside2PtConicalProcessor; |
826 | 837 |
827 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, | 838 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, |
828 const SkTwoPointConicalGradient& shad
er, | 839 const SkTwoPointConicalGradient& shad
er, |
829 const SkMatrix& matrix, | 840 const SkMatrix& matrix, |
830 SkShader::TileMode tm, | 841 SkShader::TileMode tm, |
831 const CircleConicalInfo& info) { | 842 const CircleConicalInfo& info) { |
832 return sk_sp<GrFragmentProcessor>( | 843 return sk_sp<GrFragmentProcessor>( |
833 new CircleInside2PtConicalEffect(ctx, shader, matrix, tm, info)); | 844 new CircleInside2PtConicalEffect(ctx, shader, matrix, tm, info)); |
834 } | 845 } |
835 | 846 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 this->initClassID<CircleInside2PtConicalEffect>(); | 878 this->initClassID<CircleInside2PtConicalEffect>(); |
868 } | 879 } |
869 | 880 |
870 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 881 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
871 | 882 |
872 const CircleConicalInfo fInfo; | 883 const CircleConicalInfo fInfo; |
873 | 884 |
874 typedef GrGradientEffect INHERITED; | 885 typedef GrGradientEffect INHERITED; |
875 }; | 886 }; |
876 | 887 |
877 class GLCircleInside2PtConicalEffect : public GrGLGradientEffect { | 888 class CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor |
| 889 : public GrGradientEffect::GLSLProcessor { |
878 public: | 890 public: |
879 GLCircleInside2PtConicalEffect(const GrProcessor&); | 891 GLSLCircleInside2PtConicalProcessor(const GrProcessor&); |
880 virtual ~GLCircleInside2PtConicalEffect() {} | 892 virtual ~GLSLCircleInside2PtConicalProcessor() {} |
881 | 893 |
882 virtual void emitCode(EmitArgs&) override; | 894 virtual void emitCode(EmitArgs&) override; |
883 | 895 |
884 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); | 896 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); |
885 | 897 |
886 protected: | 898 protected: |
887 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 899 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
888 | 900 |
889 UniformHandle fCenterUni; | 901 UniformHandle fCenterUni; |
890 UniformHandle fParamUni; | 902 UniformHandle fParamUni; |
891 | 903 |
892 const char* fVSVaryingName; | 904 const char* fVSVaryingName; |
893 const char* fFSVaryingName; | 905 const char* fFSVaryingName; |
894 | 906 |
895 // @{ | 907 // @{ |
896 /// Values last uploaded as uniforms | 908 /// Values last uploaded as uniforms |
897 | 909 |
898 SkScalar fCachedCenterX; | 910 SkScalar fCachedCenterX; |
899 SkScalar fCachedCenterY; | 911 SkScalar fCachedCenterY; |
900 SkScalar fCachedA; | 912 SkScalar fCachedA; |
901 SkScalar fCachedB; | 913 SkScalar fCachedB; |
902 SkScalar fCachedC; | 914 SkScalar fCachedC; |
903 | 915 |
904 // @} | 916 // @} |
905 | 917 |
906 private: | 918 private: |
907 typedef GrGLGradientEffect INHERITED; | 919 typedef GrGradientEffect::GLSLProcessor INHERITED; |
908 | 920 |
909 }; | 921 }; |
910 | 922 |
911 void CircleInside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, | 923 void CircleInside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
912 GrProcessorKeyBuilder*
b) const { | 924 GrProcessorKeyBuilder*
b) const { |
913 GLCircleInside2PtConicalEffect::GenKey(*this, caps, b); | 925 CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor::GenKey(*t
his, caps, b); |
914 } | 926 } |
915 | 927 |
916 GrGLSLFragmentProcessor* CircleInside2PtConicalEffect::onCreateGLSLInstance() co
nst { | 928 GrGLSLFragmentProcessor* CircleInside2PtConicalEffect::onCreateGLSLInstance() co
nst { |
917 return new GLCircleInside2PtConicalEffect(*this); | 929 return new CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor
(*this); |
918 } | 930 } |
919 | 931 |
920 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleInside2PtConicalEffect); | 932 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleInside2PtConicalEffect); |
921 | 933 |
922 /* | 934 /* |
923 * All Two point conical gradient test create functions may occasionally create
edge case shaders | 935 * All Two point conical gradient test create functions may occasionally create
edge case shaders |
924 */ | 936 */ |
925 sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorT
estData* d) { | 937 sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorT
estData* d) { |
926 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; | 938 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; |
927 SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius
1 != 0 | 939 SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius
1 != 0 |
(...skipping 17 matching lines...) Expand all Loading... |
945 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, | 957 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, |
946 colors, stops, colorCoun
t, tm); | 958 colors, stops, colorCoun
t, tm); |
947 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); | 959 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
948 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( | 960 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( |
949 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, | 961 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, |
950 SkSourceGammaTreatment::kRespect)); | 962 SkSourceGammaTreatment::kRespect)); |
951 GrAlwaysAssert(fp); | 963 GrAlwaysAssert(fp); |
952 return fp; | 964 return fp; |
953 } | 965 } |
954 | 966 |
955 GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrProcessor
& processor) | 967 CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor |
| 968 ::GLSLCircleInside2PtConicalProcessor(const GrProces
sor& processor) |
956 : fVSVaryingName(nullptr) | 969 : fVSVaryingName(nullptr) |
957 , fFSVaryingName(nullptr) | 970 , fFSVaryingName(nullptr) |
958 , fCachedCenterX(SK_ScalarMax) | 971 , fCachedCenterX(SK_ScalarMax) |
959 , fCachedCenterY(SK_ScalarMax) | 972 , fCachedCenterY(SK_ScalarMax) |
960 , fCachedA(SK_ScalarMax) | 973 , fCachedA(SK_ScalarMax) |
961 , fCachedB(SK_ScalarMax) | 974 , fCachedB(SK_ScalarMax) |
962 , fCachedC(SK_ScalarMax) {} | 975 , fCachedC(SK_ScalarMax) {} |
963 | 976 |
964 void GLCircleInside2PtConicalEffect::emitCode(EmitArgs& args) { | 977 void CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor::emitCode
(EmitArgs& args) { |
965 const CircleInside2PtConicalEffect& ge = args.fFp.cast<CircleInside2PtConica
lEffect>(); | 978 const CircleInside2PtConicalEffect& ge = args.fFp.cast<CircleInside2PtConica
lEffect>(); |
966 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 979 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
967 this->emitUniforms(uniformHandler, ge); | 980 this->emitUniforms(uniformHandler, ge); |
968 fCenterUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 981 fCenterUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
969 kVec2f_GrSLType, kDefault_GrSLPrecis
ion, | 982 kVec2f_GrSLType, kDefault_GrSLPrecis
ion, |
970 "Conical2FSCenter"); | 983 "Conical2FSCenter"); |
971 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 984 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
972 kVec3f_GrSLType, kDefault_GrSLPrecisi
on, | 985 kVec3f_GrSLType, kDefault_GrSLPrecisi
on, |
973 "Conical2FSParams"); | 986 "Conical2FSParams"); |
974 SkString tName("t"); | 987 SkString tName("t"); |
(...skipping 26 matching lines...) Expand all Loading... |
1001 this->emitColor(fragBuilder, | 1014 this->emitColor(fragBuilder, |
1002 uniformHandler, | 1015 uniformHandler, |
1003 args.fGLSLCaps, | 1016 args.fGLSLCaps, |
1004 ge, | 1017 ge, |
1005 tName.c_str(), | 1018 tName.c_str(), |
1006 args.fOutputColor, | 1019 args.fOutputColor, |
1007 args.fInputColor, | 1020 args.fInputColor, |
1008 args.fTexSamplers); | 1021 args.fTexSamplers); |
1009 } | 1022 } |
1010 | 1023 |
1011 void GLCircleInside2PtConicalEffect::onSetData(const GrGLSLProgramDataManager& p
dman, | 1024 void CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor::onSetDat
a( |
1012 const GrProcessor& processor) { | 1025 const GrGLSLProgramDataManager& pdma
n, |
| 1026 const GrProcessor& processor) { |
1013 INHERITED::onSetData(pdman, processor); | 1027 INHERITED::onSetData(pdman, processor); |
1014 const CircleInside2PtConicalEffect& data = processor.cast<CircleInside2PtCon
icalEffect>(); | 1028 const CircleInside2PtConicalEffect& data = processor.cast<CircleInside2PtCon
icalEffect>(); |
1015 SkScalar centerX = data.centerX(); | 1029 SkScalar centerX = data.centerX(); |
1016 SkScalar centerY = data.centerY(); | 1030 SkScalar centerY = data.centerY(); |
1017 SkScalar A = data.A(); | 1031 SkScalar A = data.A(); |
1018 SkScalar B = data.B(); | 1032 SkScalar B = data.B(); |
1019 SkScalar C = data.C(); | 1033 SkScalar C = data.C(); |
1020 | 1034 |
1021 if (fCachedCenterX != centerX || fCachedCenterY != centerY || | 1035 if (fCachedCenterX != centerX || fCachedCenterY != centerY || |
1022 fCachedA != A || fCachedB != B || fCachedC != C) { | 1036 fCachedA != A || fCachedB != B || fCachedC != C) { |
1023 | 1037 |
1024 pdman.set2f(fCenterUni, SkScalarToFloat(centerX), SkScalarToFloat(center
Y)); | 1038 pdman.set2f(fCenterUni, SkScalarToFloat(centerX), SkScalarToFloat(center
Y)); |
1025 pdman.set3f(fParamUni, SkScalarToFloat(A), SkScalarToFloat(B), SkScalarT
oFloat(C)); | 1039 pdman.set3f(fParamUni, SkScalarToFloat(A), SkScalarToFloat(B), SkScalarT
oFloat(C)); |
1026 | 1040 |
1027 fCachedCenterX = centerX; | 1041 fCachedCenterX = centerX; |
1028 fCachedCenterY = centerY; | 1042 fCachedCenterY = centerY; |
1029 fCachedA = A; | 1043 fCachedA = A; |
1030 fCachedB = B; | 1044 fCachedB = B; |
1031 fCachedC = C; | 1045 fCachedC = C; |
1032 } | 1046 } |
1033 } | 1047 } |
1034 | 1048 |
1035 void GLCircleInside2PtConicalEffect::GenKey(const GrProcessor& processor, | 1049 void CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor::GenKey( |
| 1050 const GrProcessor& processor, |
1036 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { | 1051 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { |
1037 b->add32(GenBaseGradientKey(processor)); | 1052 b->add32(GenBaseGradientKey(processor)); |
1038 } | 1053 } |
1039 | 1054 |
1040 ////////////////////////////////////////////////////////////////////////////// | 1055 ////////////////////////////////////////////////////////////////////////////// |
1041 | 1056 |
1042 class CircleOutside2PtConicalEffect : public GrGradientEffect { | 1057 class CircleOutside2PtConicalEffect : public GrGradientEffect { |
1043 public: | 1058 public: |
| 1059 class GLSLCircleOutside2PtConicalProcessor; |
1044 | 1060 |
1045 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, | 1061 static sk_sp<GrFragmentProcessor> Make(GrContext* ctx, |
1046 const SkTwoPointConicalGradient& shad
er, | 1062 const SkTwoPointConicalGradient& shad
er, |
1047 const SkMatrix& matrix, | 1063 const SkMatrix& matrix, |
1048 SkShader::TileMode tm, | 1064 SkShader::TileMode tm, |
1049 const CircleConicalInfo& info) { | 1065 const CircleConicalInfo& info) { |
1050 return sk_sp<GrFragmentProcessor>( | 1066 return sk_sp<GrFragmentProcessor>( |
1051 new CircleOutside2PtConicalEffect(ctx, shader, matrix, tm, info)); | 1067 new CircleOutside2PtConicalEffect(ctx, shader, matrix, tm, info)); |
1052 } | 1068 } |
1053 | 1069 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 | 1113 |
1098 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 1114 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
1099 | 1115 |
1100 const CircleConicalInfo fInfo; | 1116 const CircleConicalInfo fInfo; |
1101 SkScalar fTLimit; | 1117 SkScalar fTLimit; |
1102 bool fIsFlipped; | 1118 bool fIsFlipped; |
1103 | 1119 |
1104 typedef GrGradientEffect INHERITED; | 1120 typedef GrGradientEffect INHERITED; |
1105 }; | 1121 }; |
1106 | 1122 |
1107 class GLCircleOutside2PtConicalEffect : public GrGLGradientEffect { | 1123 class CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor |
| 1124 : public GrGradientEffect::GLSLProcessor { |
1108 public: | 1125 public: |
1109 GLCircleOutside2PtConicalEffect(const GrProcessor&); | 1126 GLSLCircleOutside2PtConicalProcessor(const GrProcessor&); |
1110 virtual ~GLCircleOutside2PtConicalEffect() {} | 1127 virtual ~GLSLCircleOutside2PtConicalProcessor() {} |
1111 | 1128 |
1112 virtual void emitCode(EmitArgs&) override; | 1129 virtual void emitCode(EmitArgs&) override; |
1113 | 1130 |
1114 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); | 1131 static void GenKey(const GrProcessor&, const GrGLSLCaps& caps, GrProcessorKe
yBuilder* b); |
1115 | 1132 |
1116 protected: | 1133 protected: |
1117 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; | 1134 void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override
; |
1118 | 1135 |
1119 UniformHandle fCenterUni; | 1136 UniformHandle fCenterUni; |
1120 UniformHandle fParamUni; | 1137 UniformHandle fParamUni; |
1121 | 1138 |
1122 const char* fVSVaryingName; | 1139 const char* fVSVaryingName; |
1123 const char* fFSVaryingName; | 1140 const char* fFSVaryingName; |
1124 | 1141 |
1125 bool fIsFlipped; | 1142 bool fIsFlipped; |
1126 | 1143 |
1127 // @{ | 1144 // @{ |
1128 /// Values last uploaded as uniforms | 1145 /// Values last uploaded as uniforms |
1129 | 1146 |
1130 SkScalar fCachedCenterX; | 1147 SkScalar fCachedCenterX; |
1131 SkScalar fCachedCenterY; | 1148 SkScalar fCachedCenterY; |
1132 SkScalar fCachedA; | 1149 SkScalar fCachedA; |
1133 SkScalar fCachedB; | 1150 SkScalar fCachedB; |
1134 SkScalar fCachedC; | 1151 SkScalar fCachedC; |
1135 SkScalar fCachedTLimit; | 1152 SkScalar fCachedTLimit; |
1136 | 1153 |
1137 // @} | 1154 // @} |
1138 | 1155 |
1139 private: | 1156 private: |
1140 typedef GrGLGradientEffect INHERITED; | 1157 typedef GrGradientEffect::GLSLProcessor INHERITED; |
1141 | 1158 |
1142 }; | 1159 }; |
1143 | 1160 |
1144 void CircleOutside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, | 1161 void CircleOutside2PtConicalEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps
, |
1145 GrProcessorKeyBuilder*
b) const { | 1162 GrProcessorKeyBuilder*
b) const { |
1146 GLCircleOutside2PtConicalEffect::GenKey(*this, caps, b); | 1163 CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor::GenKey(
*this, caps, b); |
1147 } | 1164 } |
1148 | 1165 |
1149 GrGLSLFragmentProcessor* CircleOutside2PtConicalEffect::onCreateGLSLInstance() c
onst { | 1166 GrGLSLFragmentProcessor* CircleOutside2PtConicalEffect::onCreateGLSLInstance() c
onst { |
1150 return new GLCircleOutside2PtConicalEffect(*this); | 1167 return new CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcess
or(*this); |
1151 } | 1168 } |
1152 | 1169 |
1153 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleOutside2PtConicalEffect); | 1170 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleOutside2PtConicalEffect); |
1154 | 1171 |
1155 /* | 1172 /* |
1156 * All Two point conical gradient test create functions may occasionally create
edge case shaders | 1173 * All Two point conical gradient test create functions may occasionally create
edge case shaders |
1157 */ | 1174 */ |
1158 sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessor
TestData* d) { | 1175 sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessor
TestData* d) { |
1159 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; | 1176 SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}; |
1160 SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius
1 != 0 | 1177 SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius
1 != 0 |
(...skipping 18 matching lines...) Expand all Loading... |
1179 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, | 1196 auto shader = SkGradientShader::MakeTwoPointConical(center1, radius1, center
2, radius2, |
1180 colors, stops, colorCoun
t, tm); | 1197 colors, stops, colorCoun
t, tm); |
1181 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); | 1198 SkMatrix viewMatrix = GrTest::TestMatrix(d->fRandom); |
1182 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( | 1199 sk_sp<GrFragmentProcessor> fp = shader->asFragmentProcessor(SkShader::AsFPAr
gs( |
1183 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, | 1200 d->fContext, &viewMatrix, NULL, kNone_SkFilterQuality, nullptr, |
1184 SkSourceGammaTreatment::kRespect)); | 1201 SkSourceGammaTreatment::kRespect)); |
1185 GrAlwaysAssert(fp); | 1202 GrAlwaysAssert(fp); |
1186 return fp; | 1203 return fp; |
1187 } | 1204 } |
1188 | 1205 |
1189 GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrProcess
or& processor) | 1206 CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor |
| 1207 ::GLSLCircleOutside2PtConicalProcessor(const GrProc
essor& processor) |
1190 : fVSVaryingName(nullptr) | 1208 : fVSVaryingName(nullptr) |
1191 , fFSVaryingName(nullptr) | 1209 , fFSVaryingName(nullptr) |
1192 , fCachedCenterX(SK_ScalarMax) | 1210 , fCachedCenterX(SK_ScalarMax) |
1193 , fCachedCenterY(SK_ScalarMax) | 1211 , fCachedCenterY(SK_ScalarMax) |
1194 , fCachedA(SK_ScalarMax) | 1212 , fCachedA(SK_ScalarMax) |
1195 , fCachedB(SK_ScalarMax) | 1213 , fCachedB(SK_ScalarMax) |
1196 , fCachedC(SK_ScalarMax) | 1214 , fCachedC(SK_ScalarMax) |
1197 , fCachedTLimit(SK_ScalarMax) { | 1215 , fCachedTLimit(SK_ScalarMax) { |
1198 const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtC
onicalEffect>(); | 1216 const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtC
onicalEffect>(); |
1199 fIsFlipped = data.isFlipped(); | 1217 fIsFlipped = data.isFlipped(); |
1200 } | 1218 } |
1201 | 1219 |
1202 void GLCircleOutside2PtConicalEffect::emitCode(EmitArgs& args) { | 1220 void CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor::emitCo
de(EmitArgs& args) { |
1203 const CircleOutside2PtConicalEffect& ge = args.fFp.cast<CircleOutside2PtConi
calEffect>(); | 1221 const CircleOutside2PtConicalEffect& ge = args.fFp.cast<CircleOutside2PtConi
calEffect>(); |
1204 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 1222 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
1205 this->emitUniforms(uniformHandler, ge); | 1223 this->emitUniforms(uniformHandler, ge); |
1206 fCenterUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 1224 fCenterUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
1207 kVec2f_GrSLType, kDefault_GrSLPrecis
ion, | 1225 kVec2f_GrSLType, kDefault_GrSLPrecis
ion, |
1208 "Conical2FSCenter"); | 1226 "Conical2FSCenter"); |
1209 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, | 1227 fParamUni = uniformHandler->addUniform(kFragment_GrShaderFlag, |
1210 kVec4f_GrSLType, kDefault_GrSLPrecisi
on, | 1228 kVec4f_GrSLType, kDefault_GrSLPrecisi
on, |
1211 "Conical2FSParams"); | 1229 "Conical2FSParams"); |
1212 SkString tName("t"); | 1230 SkString tName("t"); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 uniformHandler, | 1274 uniformHandler, |
1257 args.fGLSLCaps, | 1275 args.fGLSLCaps, |
1258 ge, | 1276 ge, |
1259 tName.c_str(), | 1277 tName.c_str(), |
1260 args.fOutputColor, | 1278 args.fOutputColor, |
1261 args.fInputColor, | 1279 args.fInputColor, |
1262 args.fTexSamplers); | 1280 args.fTexSamplers); |
1263 fragBuilder->codeAppend("\t}\n"); | 1281 fragBuilder->codeAppend("\t}\n"); |
1264 } | 1282 } |
1265 | 1283 |
1266 void GLCircleOutside2PtConicalEffect::onSetData(const GrGLSLProgramDataManager&
pdman, | 1284 void CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor::onSetD
ata( |
| 1285 const GrGLSLProgramDataManager&
pdman, |
1267 const GrProcessor& processor) { | 1286 const GrProcessor& processor) { |
1268 INHERITED::onSetData(pdman, processor); | 1287 INHERITED::onSetData(pdman, processor); |
1269 const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtC
onicalEffect>(); | 1288 const CircleOutside2PtConicalEffect& data = processor.cast<CircleOutside2PtC
onicalEffect>(); |
1270 SkASSERT(data.isFlipped() == fIsFlipped); | 1289 SkASSERT(data.isFlipped() == fIsFlipped); |
1271 SkScalar centerX = data.centerX(); | 1290 SkScalar centerX = data.centerX(); |
1272 SkScalar centerY = data.centerY(); | 1291 SkScalar centerY = data.centerY(); |
1273 SkScalar A = data.A(); | 1292 SkScalar A = data.A(); |
1274 SkScalar B = data.B(); | 1293 SkScalar B = data.B(); |
1275 SkScalar C = data.C(); | 1294 SkScalar C = data.C(); |
1276 SkScalar tLimit = data.tLimit(); | 1295 SkScalar tLimit = data.tLimit(); |
1277 | 1296 |
1278 if (fCachedCenterX != centerX || fCachedCenterY != centerY || | 1297 if (fCachedCenterX != centerX || fCachedCenterY != centerY || |
1279 fCachedA != A || fCachedB != B || fCachedC != C || fCachedTLimit != tLim
it) { | 1298 fCachedA != A || fCachedB != B || fCachedC != C || fCachedTLimit != tLim
it) { |
1280 | 1299 |
1281 pdman.set2f(fCenterUni, SkScalarToFloat(centerX), SkScalarToFloat(center
Y)); | 1300 pdman.set2f(fCenterUni, SkScalarToFloat(centerX), SkScalarToFloat(center
Y)); |
1282 pdman.set4f(fParamUni, SkScalarToFloat(A), SkScalarToFloat(B), SkScalarT
oFloat(C), | 1301 pdman.set4f(fParamUni, SkScalarToFloat(A), SkScalarToFloat(B), SkScalarT
oFloat(C), |
1283 SkScalarToFloat(tLimit)); | 1302 SkScalarToFloat(tLimit)); |
1284 | 1303 |
1285 fCachedCenterX = centerX; | 1304 fCachedCenterX = centerX; |
1286 fCachedCenterY = centerY; | 1305 fCachedCenterY = centerY; |
1287 fCachedA = A; | 1306 fCachedA = A; |
1288 fCachedB = B; | 1307 fCachedB = B; |
1289 fCachedC = C; | 1308 fCachedC = C; |
1290 fCachedTLimit = tLimit; | 1309 fCachedTLimit = tLimit; |
1291 } | 1310 } |
1292 } | 1311 } |
1293 | 1312 |
1294 void GLCircleOutside2PtConicalEffect::GenKey(const GrProcessor& processor, | 1313 void CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor::GenKey
( |
1295 const GrGLSLCaps&, GrProcessorKeyBu
ilder* b) { | 1314 const GrProcessor& processor, |
| 1315 const GrGLSLCaps&, GrProcessorKeyBui
lder* b) { |
1296 uint32_t* key = b->add32n(2); | 1316 uint32_t* key = b->add32n(2); |
1297 key[0] = GenBaseGradientKey(processor); | 1317 key[0] = GenBaseGradientKey(processor); |
1298 key[1] = processor.cast<CircleOutside2PtConicalEffect>().isFlipped(); | 1318 key[1] = processor.cast<CircleOutside2PtConicalEffect>().isFlipped(); |
1299 } | 1319 } |
1300 | 1320 |
1301 ////////////////////////////////////////////////////////////////////////////// | 1321 ////////////////////////////////////////////////////////////////////////////// |
1302 | 1322 |
1303 sk_sp<GrFragmentProcessor> Gr2PtConicalGradientEffect::Make(GrContext* ctx, | 1323 sk_sp<GrFragmentProcessor> Gr2PtConicalGradientEffect::Make(GrContext* ctx, |
1304 const SkTwoPointConi
calGradient& shader, | 1324 const SkTwoPointConi
calGradient& shader, |
1305 SkShader::TileMode t
m, | 1325 SkShader::TileMode t
m, |
(...skipping 30 matching lines...) Expand all Loading... |
1336 return CircleInside2PtConicalEffect::Make(ctx, shader, matrix, tm, info)
; | 1356 return CircleInside2PtConicalEffect::Make(ctx, shader, matrix, tm, info)
; |
1337 } else if (type == kEdge_ConicalType) { | 1357 } else if (type == kEdge_ConicalType) { |
1338 set_matrix_edge_conical(shader, &matrix); | 1358 set_matrix_edge_conical(shader, &matrix); |
1339 return Edge2PtConicalEffect::Make(ctx, shader, matrix, tm); | 1359 return Edge2PtConicalEffect::Make(ctx, shader, matrix, tm); |
1340 } else { | 1360 } else { |
1341 return CircleOutside2PtConicalEffect::Make(ctx, shader, matrix, tm, info
); | 1361 return CircleOutside2PtConicalEffect::Make(ctx, shader, matrix, tm, info
); |
1342 } | 1362 } |
1343 } | 1363 } |
1344 | 1364 |
1345 #endif | 1365 #endif |
OLD | NEW |