| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "SkTwoPointRadialGradient.h" | 9 #include "SkTwoPointRadialGradient.h" |
| 10 | 10 |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 SkString p3; | 582 SkString p3; |
| 583 SkString p4; | 583 SkString p4; |
| 584 SkString p5; | 584 SkString p5; |
| 585 builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0); | 585 builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0); |
| 586 builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1); | 586 builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1); |
| 587 builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2); | 587 builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2); |
| 588 builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3); | 588 builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3); |
| 589 builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4); | 589 builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4); |
| 590 builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5); | 590 builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5); |
| 591 | 591 |
| 592 GrGLFPFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 592 GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
| 593 // We interpolate the linear component in coords[1]. | 593 // We interpolate the linear component in coords[1]. |
| 594 SkASSERT(coords[0].getType() == coords[1].getType()); | 594 SkASSERT(coords[0].getType() == coords[1].getType()); |
| 595 const char* coords2D; | 595 const char* coords2D; |
| 596 SkString bVar; | 596 SkString bVar; |
| 597 if (kVec3f_GrSLType == coords[0].getType()) { | 597 if (kVec3f_GrSLType == coords[0].getType()) { |
| 598 fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\
n", | 598 fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\
n", |
| 599 coords[0].c_str(), coords[1].c_str(), coords[0].c
_str()); | 599 coords[0].c_str(), coords[1].c_str(), coords[0].c
_str()); |
| 600 coords2D = "interpolants.xy"; | 600 coords2D = "interpolants.xy"; |
| 601 bVar = "interpolants.z"; | 601 bVar = "interpolants.z"; |
| 602 } else { | 602 } else { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 #else | 715 #else |
| 716 | 716 |
| 717 bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext*, const SkPaint&, c
onst SkMatrix&, | 717 bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext*, const SkPaint&, c
onst SkMatrix&, |
| 718 const SkMatrix*, | 718 const SkMatrix*, |
| 719 GrColor*, GrFragmentProcessor
**) const { | 719 GrColor*, GrFragmentProcessor
**) const { |
| 720 SkDEBUGFAIL("Should not call in GPU-less build"); | 720 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 721 return false; | 721 return false; |
| 722 } | 722 } |
| 723 | 723 |
| 724 #endif | 724 #endif |
| OLD | NEW |