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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 this->emitYCoordUniform(builder); | 535 this->emitYCoordUniform(builder); |
536 SkString fsCoords; | 536 SkString fsCoords; |
537 SkString vsCoordsVarying; | 537 SkString vsCoordsVarying; |
538 GrSLType coordsVaryingType; | 538 GrSLType coordsVaryingType; |
539 this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingT
ype); | 539 this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingT
ype); |
540 | 540 |
541 // 2 copies of uniform array, 1 for each of vertex & fragment shader, | 541 // 2 copies of uniform array, 1 for each of vertex & fragment shader, |
542 // to work around Xoom bug. Doesn't seem to cause performance decrease | 542 // to work around Xoom bug. Doesn't seem to cause performance decrease |
543 // in test apps, but need to keep an eye on it. | 543 // in test apps, but need to keep an eye on it. |
544 fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_ShaderType
, | 544 fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_Visibility
, |
545 kFloat_GrSLType, "Radial2VSParams", 6
); | 545 kFloat_GrSLType, "Radial2VSParams", 6
); |
546 fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_ShaderTy
pe, | 546 fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibili
ty, |
547 kFloat_GrSLType, "Radial2FSParams", 6
); | 547 kFloat_GrSLType, "Radial2FSParams", 6
); |
548 | 548 |
549 // For radial gradients without perspective we can pass the linear | 549 // For radial gradients without perspective we can pass the linear |
550 // part of the quadratic as a varying. | 550 // part of the quadratic as a varying. |
551 if (kVec2f_GrSLType == coordsVaryingType) { | 551 if (kVec2f_GrSLType == coordsVaryingType) { |
552 builder->addVarying(kFloat_GrSLType, "Radial2BCoeff", &fVSVaryingName, &
fFSVaryingName); | 552 builder->addVarying(kFloat_GrSLType, "Radial2BCoeff", &fVSVaryingName, &
fFSVaryingName); |
553 } | 553 } |
554 | 554 |
555 // VS | 555 // VS |
556 { | 556 { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 } | 705 } |
706 | 706 |
707 #else | 707 #else |
708 | 708 |
709 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { | 709 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c
onst { |
710 SkDEBUGFAIL("Should not call in GPU-less build"); | 710 SkDEBUGFAIL("Should not call in GPU-less build"); |
711 return NULL; | 711 return NULL; |
712 } | 712 } |
713 | 713 |
714 #endif | 714 #endif |
OLD | NEW |