| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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/GrGLProgram.h" | 8 #include "gl/GrGLProgram.h" |
| 9 #include "gl/GrGLSLPrettyPrint.h" | 9 #include "gl/GrGLSLPrettyPrint.h" |
| 10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 fVS.emitCodeBeforeEffects(color, coverage); | 336 fVS.emitCodeBeforeEffects(color, coverage); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void GrGLFullProgramBuilder::emitCodeAfterEffects() { | 339 void GrGLFullProgramBuilder::emitCodeAfterEffects() { |
| 340 fVS.emitCodeAfterEffects(); | 340 fVS.emitCodeAfterEffects(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 void GrGLFullProgramBuilder::addVarying(GrSLType type, | 343 void GrGLFullProgramBuilder::addVarying(GrSLType type, |
| 344 const char* name, | 344 const char* name, |
| 345 const char** vsOutName, | 345 const char** vsOutName, |
| 346 const char** fsInName) { | 346 const char** fsInName, |
| 347 GrGLShaderVar::Precision fsPrecision) { |
| 347 fVS.addVarying(type, name, vsOutName); | 348 fVS.addVarying(type, name, vsOutName); |
| 348 | 349 |
| 349 SkString* fsInputName = fVS.fOutputs.back().accessName(); | 350 SkString* fsInputName = fVS.fOutputs.back().accessName(); |
| 350 | 351 |
| 351 #if GR_GL_EXPERIMENTAL_GS | 352 #if GR_GL_EXPERIMENTAL_GS |
| 352 if (desc().getHeader().fExperimentalGS) { | 353 if (desc().getHeader().fExperimentalGS) { |
| 353 // TODO let the caller use these names | 354 // TODO let the caller use these names |
| 354 fGS.addVarying(type, fsInputName->c_str(), NULL); | 355 fGS.addVarying(type, fsInputName->c_str(), NULL); |
| 355 fsInputName = fGS.fOutputs.back().accessName(); | 356 fsInputName = fGS.fOutputs.back().accessName(); |
| 356 } | 357 } |
| 357 #endif | 358 #endif |
| 358 fFS.addVarying(type, fsInputName->c_str(), fsInName); | 359 fFS.addVarying(type, fsInputName->c_str(), fsInName, fsPrecision); |
| 359 } | 360 } |
| 360 | 361 |
| 361 GrGLFullProgramBuilder::VaryingHandle | 362 GrGLFullProgramBuilder::VaryingHandle |
| 362 GrGLFullProgramBuilder::addSeparableVarying(GrSLType type, | 363 GrGLFullProgramBuilder::addSeparableVarying(GrSLType type, |
| 363 const char* name, | 364 const char* name, |
| 364 const char** vsOutName, | 365 const char** vsOutName, |
| 365 const char** fsInName) { | 366 const char** fsInName) { |
| 366 addVarying(type, name, vsOutName, fsInName); | 367 addVarying(type, name, vsOutName, fsInName); |
| 367 SeparableVaryingInfo& varying = fSeparableVaryingInfos.push_back(); | 368 SeparableVaryingInfo& varying = fSeparableVaryingInfos.push_back(); |
| 368 varying.fVariable = fFS.fInputs.back(); | 369 varying.fVariable = fFS.fInputs.back(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 426 |
| 426 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, | 427 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, |
| 427 effectCnt); | 428 effectCnt); |
| 428 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, | 429 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, |
| 429 effectStages, | 430 effectStages, |
| 430 effectCnt, | 431 effectCnt, |
| 431 keyProvider, | 432 keyProvider, |
| 432 inOutFSColor); | 433 inOutFSColor); |
| 433 return pathTexGenEffectsBuilder.finish(); | 434 return pathTexGenEffectsBuilder.finish(); |
| 434 } | 435 } |
| OLD | NEW |