| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 if (0 == shaderId) { | 642 if (0 == shaderId) { |
| 643 return false; | 643 return false; |
| 644 } | 644 } |
| 645 | 645 |
| 646 const GrGLchar* sourceStr = shaderSrc.c_str(); | 646 const GrGLchar* sourceStr = shaderSrc.c_str(); |
| 647 GrGLint sourceLength = static_cast<GrGLint>(shaderSrc.size()); | 647 GrGLint sourceLength = static_cast<GrGLint>(shaderSrc.size()); |
| 648 GR_GL_CALL(gli, ShaderSource(shaderId, 1, &sourceStr, &sourceLength)); | 648 GR_GL_CALL(gli, ShaderSource(shaderId, 1, &sourceStr, &sourceLength)); |
| 649 GR_GL_CALL(gli, CompileShader(shaderId)); | 649 GR_GL_CALL(gli, CompileShader(shaderId)); |
| 650 | 650 |
| 651 // Calling GetShaderiv in Chromium is quite expensive. Assume success in rel
ease builds. | 651 // Calling GetShaderiv in Chromium is quite expensive. Assume success in rel
ease builds. |
| 652 bool checkCompiled = !glCtx.info().isChromium(); | 652 bool checkCompiled = !glCtx.isChromium(); |
| 653 #ifdef SK_DEBUG | 653 #ifdef SK_DEBUG |
| 654 checkCompiled = true; | 654 checkCompiled = true; |
| 655 #endif | 655 #endif |
| 656 if (checkCompiled) { | 656 if (checkCompiled) { |
| 657 GrGLint compiled = GR_GL_INIT_ZERO; | 657 GrGLint compiled = GR_GL_INIT_ZERO; |
| 658 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_COMPILE_STATUS, &compiled)); | 658 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_COMPILE_STATUS, &compiled)); |
| 659 | 659 |
| 660 if (!compiled) { | 660 if (!compiled) { |
| 661 GrGLint infoLen = GR_GL_INIT_ZERO; | 661 GrGLint infoLen = GR_GL_INIT_ZERO; |
| 662 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_INFO_LOG_LENGTH, &infoLe
n)); | 662 GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_INFO_LOG_LENGTH, &infoLe
n)); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 GrGLSLExpr4* inOutFSColor) { | 977 GrGLSLExpr4* inOutFSColor) { |
| 978 | 978 |
| 979 GrGLTexGenProgramEffectsBuilder texGenEffectsBuilder(this, effectCnt); | 979 GrGLTexGenProgramEffectsBuilder texGenEffectsBuilder(this, effectCnt); |
| 980 this->INHERITED::createAndEmitEffects(&texGenEffectsBuilder, | 980 this->INHERITED::createAndEmitEffects(&texGenEffectsBuilder, |
| 981 effectStages, | 981 effectStages, |
| 982 effectKeys, | 982 effectKeys, |
| 983 effectCnt, | 983 effectCnt, |
| 984 inOutFSColor); | 984 inOutFSColor); |
| 985 return texGenEffectsBuilder.finish(); | 985 return texGenEffectsBuilder.finish(); |
| 986 } | 986 } |
| OLD | NEW |