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 "SkTwoPointConicalGradient.h" | 9 #include "SkTwoPointConicalGradient.h" |
10 | 10 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 const TextureSamplerArray& samplers) { | 492 const TextureSamplerArray& samplers) { |
493 SkString fsCoords; | 493 SkString fsCoords; |
494 SkString vsCoordsVarying; | 494 SkString vsCoordsVarying; |
495 GrSLType coordsVaryingType; | 495 GrSLType coordsVaryingType; |
496 this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingT
ype); | 496 this->setupMatrix(builder, key, &fsCoords, &vsCoordsVarying, &coordsVaryingT
ype); |
497 | 497 |
498 this->emitYCoordUniform(builder); | 498 this->emitYCoordUniform(builder); |
499 // 2 copies of uniform array, 1 for each of vertex & fragment shader, | 499 // 2 copies of uniform array, 1 for each of vertex & fragment shader, |
500 // to work around Xoom bug. Doesn't seem to cause performance decrease | 500 // to work around Xoom bug. Doesn't seem to cause performance decrease |
501 // in test apps, but need to keep an eye on it. | 501 // in test apps, but need to keep an eye on it. |
502 fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_ShaderType
, | 502 fVSParamUni = builder->addUniformArray(GrGLShaderBuilder::kVertex_Visibility
, |
503 kFloat_GrSLType, "Conical2VSParams",
6); | 503 kFloat_GrSLType, "Conical2VSParams",
6); |
504 fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_ShaderTy
pe, | 504 fFSParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibili
ty, |
505 kFloat_GrSLType, "Conical2FSParams",
6); | 505 kFloat_GrSLType, "Conical2FSParams",
6); |
506 | 506 |
507 // For radial gradients without perspective we can pass the linear | 507 // For radial gradients without perspective we can pass the linear |
508 // part of the quadratic as a varying. | 508 // part of the quadratic as a varying. |
509 if (kVec2f_GrSLType == coordsVaryingType) { | 509 if (kVec2f_GrSLType == coordsVaryingType) { |
510 builder->addVarying(kFloat_GrSLType, "Conical2BCoeff", | 510 builder->addVarying(kFloat_GrSLType, "Conical2BCoeff", |
511 &fVSVaryingName, &fFSVaryingName); | 511 &fVSVaryingName, &fFSVaryingName); |
512 } | 512 } |
513 | 513 |
514 // VS | 514 // VS |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 str->appendScalar(fCenter2.fY); | 753 str->appendScalar(fCenter2.fY); |
754 str->append(") radius2: "); | 754 str->append(") radius2: "); |
755 str->appendScalar(fRadius2); | 755 str->appendScalar(fRadius2); |
756 str->append(" "); | 756 str->append(" "); |
757 | 757 |
758 this->INHERITED::toString(str); | 758 this->INHERITED::toString(str); |
759 | 759 |
760 str->append(")"); | 760 str->append(")"); |
761 } | 761 } |
762 #endif | 762 #endif |
OLD | NEW |