OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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/GrGLShaderBuilder.h" | 8 #include "gl/GrGLShaderBuilder.h" |
9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 this->fsCodeAppendf("\tvec4 %s = %s;\n", inColorName.c_str(), inColo
r.c_str()); | 532 this->fsCodeAppendf("\tvec4 %s = %s;\n", inColorName.c_str(), inColo
r.c_str()); |
533 inColor = inColorName; | 533 inColor = inColorName; |
534 } | 534 } |
535 | 535 |
536 // create var to hold stage result | 536 // create var to hold stage result |
537 SkString outColorName; | 537 SkString outColorName; |
538 this->nameVariable(&outColorName, '\0', "output"); | 538 this->nameVariable(&outColorName, '\0', "output"); |
539 this->fsCodeAppendf("\tvec4 %s;\n", outColorName.c_str()); | 539 this->fsCodeAppendf("\tvec4 %s;\n", outColorName.c_str()); |
540 outColor = outColorName; | 540 outColor = outColorName; |
541 | 541 |
| 542 |
542 programEffectsBuilder->emitEffect(stage, | 543 programEffectsBuilder->emitEffect(stage, |
543 effectKeys[e], | 544 effectKeys[e], |
544 outColor.c_str(), | 545 outColor.c_str(), |
545 inColor.isOnes() ? NULL : inColor.c_st
r(), | 546 inColor.isOnes() ? NULL : inColor.c_st
r(), |
546 fCodeStage.stageIndex()); | 547 fCodeStage.stageIndex()); |
547 | 548 |
548 inColor = outColor; | 549 inColor = outColor; |
549 effectEmitted = true; | 550 effectEmitted = true; |
550 } | 551 } |
551 | 552 |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 | 990 |
990 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, | 991 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, |
991 effectCnt); | 992 effectCnt); |
992 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, | 993 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, |
993 effectStages, | 994 effectStages, |
994 effectKeys, | 995 effectKeys, |
995 effectCnt, | 996 effectCnt, |
996 inOutFSColor); | 997 inOutFSColor); |
997 return pathTexGenEffectsBuilder.finish(); | 998 return pathTexGenEffectsBuilder.finish(); |
998 } | 999 } |
OLD | NEW |