| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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.h" | 8 #include "SkTwoPointConicalGradient.h" |
| 9 | 9 |
| 10 static int valid_divide(float numer, float denom, float* ratio) { | 10 static int valid_divide(float numer, float denom, float* ratio) { |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 class GrGLConical2Gradient : public GrGLGradientEffect { | 339 class GrGLConical2Gradient : public GrGLGradientEffect { |
| 340 public: | 340 public: |
| 341 | 341 |
| 342 GrGLConical2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffe
ct&); | 342 GrGLConical2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffe
ct&); |
| 343 virtual ~GrGLConical2Gradient() { } | 343 virtual ~GrGLConical2Gradient() { } |
| 344 | 344 |
| 345 virtual void emitCode(GrGLShaderBuilder*, | 345 virtual void emitCode(GrGLShaderBuilder*, |
| 346 const GrDrawEffect&, | 346 const GrDrawEffect&, |
| 347 EffectKey, | 347 EffectKey, |
| 348 const char* outputColor, | 348 const char* outputColor, |
| 349 const char* inputColor, | 349 const GrGLSLExpr4& inputColor, |
| 350 const TransformedCoordsArray&, | 350 const TransformedCoordsArray&, |
| 351 const TextureSamplerArray&) SK_OVERRIDE; | 351 const TextureSamplerArray&) SK_OVERRIDE; |
| 352 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; | 352 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER
RIDE; |
| 353 | 353 |
| 354 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps& caps); | 354 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps& caps); |
| 355 | 355 |
| 356 protected: | 356 protected: |
| 357 | 357 |
| 358 UniformHandle fParamUni; | 358 UniformHandle fParamUni; |
| 359 | 359 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 , fCachedDiffRadius(-SK_ScalarMax) { | 494 , fCachedDiffRadius(-SK_ScalarMax) { |
| 495 | 495 |
| 496 const GrConical2Gradient& data = drawEffect.castEffect<GrConical2Gradient>()
; | 496 const GrConical2Gradient& data = drawEffect.castEffect<GrConical2Gradient>()
; |
| 497 fIsDegenerate = data.isDegenerate(); | 497 fIsDegenerate = data.isDegenerate(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder, | 500 void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder, |
| 501 const GrDrawEffect&, | 501 const GrDrawEffect&, |
| 502 EffectKey key, | 502 EffectKey key, |
| 503 const char* outputColor, | 503 const char* outputColor, |
| 504 const char* inputColor, | 504 const GrGLSLExpr4& inputColor, |
| 505 const TransformedCoordsArray& coords, | 505 const TransformedCoordsArray& coords, |
| 506 const TextureSamplerArray& samplers) { | 506 const TextureSamplerArray& samplers) { |
| 507 this->emitUniforms(builder, key); | 507 this->emitUniforms(builder, key); |
| 508 fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility
, | 508 fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility
, |
| 509 kFloat_GrSLType, "Conical2FSParams", 6)
; | 509 kFloat_GrSLType, "Conical2FSParams", 6)
; |
| 510 | 510 |
| 511 SkString cName("c"); | 511 SkString cName("c"); |
| 512 SkString ac4Name("ac4"); | 512 SkString ac4Name("ac4"); |
| 513 SkString dName("d"); | 513 SkString dName("d"); |
| 514 SkString qName("q"); | 514 SkString qName("q"); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 str->appendScalar(fCenter2.fY); | 727 str->appendScalar(fCenter2.fY); |
| 728 str->append(") radius2: "); | 728 str->append(") radius2: "); |
| 729 str->appendScalar(fRadius2); | 729 str->appendScalar(fRadius2); |
| 730 str->append(" "); | 730 str->append(" "); |
| 731 | 731 |
| 732 this->INHERITED::toString(str); | 732 this->INHERITED::toString(str); |
| 733 | 733 |
| 734 str->append(")"); | 734 str->append(")"); |
| 735 } | 735 } |
| 736 #endif | 736 #endif |
| OLD | NEW |