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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
529 | 529 |
530 // Effects have no way to communicate zeros, they treat an empty str ing as ones. | 530 // Effects have no way to communicate zeros, they treat an empty str ing as ones. |
531 this->nameVariable(&inColorName, '\0', "input"); | 531 this->nameVariable(&inColorName, '\0', "input"); |
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 |
540 if (kImagination_GrGLVendor == this->ctxInfo().vendor() && | |
541 kPVRRogueHood_GrGLRenderer == this->ctxInfo().renderer()) | |
bsalomon
2014/07/01 13:54:51
Can't you have a temporary highp var in the config
| |
542 this->fsCodeAppendf("\thighp vec4 %s;\n", outColorName.c_str()); | |
543 else | |
544 this->fsCodeAppendf("\tvec4 %s;\n", outColorName.c_str()); | |
545 | |
540 outColor = outColorName; | 546 outColor = outColorName; |
541 | 547 |
542 | 548 |
543 programEffectsBuilder->emitEffect(stage, | 549 programEffectsBuilder->emitEffect(stage, |
544 effectKeys[e], | 550 effectKeys[e], |
545 outColor.c_str(), | 551 outColor.c_str(), |
546 inColor.isOnes() ? NULL : inColor.c_st r(), | 552 inColor.isOnes() ? NULL : inColor.c_st r(), |
547 fCodeStage.stageIndex()); | 553 fCodeStage.stageIndex()); |
548 | 554 |
549 inColor = outColor; | 555 inColor = outColor; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
990 | 996 |
991 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, | 997 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, |
992 effectCnt); | 998 effectCnt); |
993 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, | 999 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, |
994 effectStages, | 1000 effectStages, |
995 effectKeys, | 1001 effectKeys, |
996 effectCnt, | 1002 effectCnt, |
997 inOutFSColor); | 1003 inOutFSColor); |
998 return pathTexGenEffectsBuilder.finish(); | 1004 return pathTexGenEffectsBuilder.finish(); |
999 } | 1005 } |
OLD | NEW |