| 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 GR_GL_CALL(gli, GetShaderInfoLog(shaderId, infoLen+1, | 760 GR_GL_CALL(gli, GetShaderInfoLog(shaderId, infoLen+1, |
| 761 &length, (char*)log.get())); | 761 &length, (char*)log.get())); |
| 762 GrPrintf(shaderSrc.c_str()); | 762 GrPrintf(shaderSrc.c_str()); |
| 763 GrPrintf("\n%s", log.get()); | 763 GrPrintf("\n%s", log.get()); |
| 764 } | 764 } |
| 765 SkDEBUGFAIL("Shader compilation failed!"); | 765 SkDEBUGFAIL("Shader compilation failed!"); |
| 766 GR_GL_CALL(gli, DeleteShader(shaderId)); | 766 GR_GL_CALL(gli, DeleteShader(shaderId)); |
| 767 return 0; | 767 return 0; |
| 768 } | 768 } |
| 769 } | 769 } |
| 770 |
| 771 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("skia.gpu"), "skia_gpu::GLSha
der", |
| 772 TRACE_EVENT_SCOPE_THREAD, "shader", TRACE_STR_COPY(shad
erSrc.c_str())); |
| 770 if (c_PrintShaders) { | 773 if (c_PrintShaders) { |
| 771 GrPrintf(shaderSrc.c_str()); | 774 GrPrintf(shaderSrc.c_str()); |
| 772 GrPrintf("\n"); | 775 GrPrintf("\n"); |
| 773 } | 776 } |
| 774 | 777 |
| 775 // Attach the shader, but defer deletion until after we have linked the prog
ram. | 778 // Attach the shader, but defer deletion until after we have linked the prog
ram. |
| 776 // This works around a bug in the Android emulator's GLES2 wrapper which | 779 // This works around a bug in the Android emulator's GLES2 wrapper which |
| 777 // will immediately delete the shader object and free its memory even though
it's | 780 // will immediately delete the shader object and free its memory even though
it's |
| 778 // attached to a program, which then causes glLinkProgram to fail. | 781 // attached to a program, which then causes glLinkProgram to fail. |
| 779 GR_GL_CALL(gli, AttachShader(programId, shaderId)); | 782 GR_GL_CALL(gli, AttachShader(programId, shaderId)); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 | 1099 |
| 1097 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, | 1100 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, |
| 1098 effectCnt); | 1101 effectCnt); |
| 1099 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, | 1102 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, |
| 1100 effectStages, | 1103 effectStages, |
| 1101 effectKeys, | 1104 effectKeys, |
| 1102 effectCnt, | 1105 effectCnt, |
| 1103 inOutFSColor); | 1106 inOutFSColor); |
| 1104 return pathTexGenEffectsBuilder.finish(); | 1107 return pathTexGenEffectsBuilder.finish(); |
| 1105 } | 1108 } |
| OLD | NEW |