| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
| 9 #include "GrBezierEffect.h" | 9 #include "GrBezierEffect.h" |
| 10 | 10 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder, | 335 void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder, |
| 336 const GrDrawEffect& drawEffect, | 336 const GrDrawEffect& drawEffect, |
| 337 const GrEffectKey& key, | 337 const GrEffectKey& key, |
| 338 const char* outputColor, | 338 const char* outputColor, |
| 339 const char* inputColor, | 339 const char* inputColor, |
| 340 const TransformedCoordsArray&, | 340 const TransformedCoordsArray&, |
| 341 const TextureSamplerArray& samplers) { | 341 const TextureSamplerArray& samplers) { |
| 342 const char *vsName, *fsName; | 342 const char *vsName, *fsName; |
| 343 | 343 |
| 344 builder->addVarying(kVec4f_GrSLType, "CubicCoeffs", | 344 builder->addVarying(kVec4f_GrSLType, "CubicCoeffs", |
| 345 &vsName, &fsName); | 345 &vsName, &fsName, GrGLShaderVar::kHigh_Precision); |
| 346 | 346 |
| 347 GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); | 347 GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); |
| 348 const SkString* attr0Name = | 348 const SkString* attr0Name = |
| 349 vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]
); | 349 vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]
); |
| 350 vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str()); | 350 vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str()); |
| 351 | 351 |
| 352 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); | 352 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
| 353 | 353 |
| 354 GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHig
h_Precision); | 354 GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHig
h_Precision); |
| 355 GrGLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Prec
ision); | 355 GrGLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Prec
ision); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 GrTexture*[]) { | 471 GrTexture*[]) { |
| 472 GrEffect* effect; | 472 GrEffect* effect; |
| 473 do { | 473 do { |
| 474 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( | 474 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( |
| 475 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); | 475 random->nextULessThan(kGrEff
ectEdgeTypeCnt)); |
| 476 effect = GrCubicEffect::Create(edgeType, caps); | 476 effect = GrCubicEffect::Create(edgeType, caps); |
| 477 } while (NULL == effect); | 477 } while (NULL == effect); |
| 478 return effect; | 478 return effect; |
| 479 } | 479 } |
| 480 | 480 |
| OLD | NEW |