| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 if (!this->finish()) { | 76 if (!this->finish()) { |
| 77 return false; | 77 return false; |
| 78 } | 78 } |
| 79 | 79 |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 ////////////////////////////////////////////////////////////////////////////// | 83 ////////////////////////////////////////////////////////////////////////////// |
| 84 | 84 |
| 85 GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu, | 85 GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu, const GrOptDrawState& optSt
ate, |
| 86 const GrGLProgramDesc& desc) | 86 const GrGLProgramDesc& desc) |
| 87 : fEffectEmitter(NULL) | 87 : fEffectEmitter(NULL) |
| 88 , fFragOnly(SkToBool(desc.getHeader().fUseFragShaderOnly)) | 88 , fFragOnly(SkToBool(desc.getHeader().fUseFragShaderOnly)) |
| 89 , fTexCoordSetCnt(0) | 89 , fTexCoordSetCnt(0) |
| 90 , fProgramID(0) | 90 , fProgramID(0) |
| 91 , fFS(this, desc) | 91 , fFS(this, desc) |
| 92 , fSeparableVaryingInfos(kVarsPerBlock) | 92 , fSeparableVaryingInfos(kVarsPerBlock) |
| 93 , fGrProcessorEmitter(this) | 93 , fGrProcessorEmitter(this) |
| 94 , fOptState(optState) |
| 94 , fDesc(desc) | 95 , fDesc(desc) |
| 95 , fGpu(gpu) | 96 , fGpu(gpu) |
| 96 , fUniforms(kVarsPerBlock) { | 97 , fUniforms(kVarsPerBlock) { |
| 97 } | 98 } |
| 98 | 99 |
| 99 void GrGLProgramBuilder::nameVariable(SkString* out, char prefix, const char* na
me) { | 100 void GrGLProgramBuilder::nameVariable(SkString* out, char prefix, const char* na
me) { |
| 100 if ('\0' == prefix) { | 101 if ('\0' == prefix) { |
| 101 *out = name; | 102 *out = name; |
| 102 } else { | 103 } else { |
| 103 out->printf("%c%s", prefix, name); | 104 out->printf("%c%s", prefix, name); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 GetProgramResourceLocation(programId, | 322 GetProgramResourceLocation(programId, |
| 322 GR_GL_FRAGMENT_INPUT, | 323 GR_GL_FRAGMENT_INPUT, |
| 323 fSeparableVaryingInfos[i].fVariab
le.c_str())); | 324 fSeparableVaryingInfos[i].fVariab
le.c_str())); |
| 324 fSeparableVaryingInfos[i].fLocation = location; | 325 fSeparableVaryingInfos[i].fLocation = location; |
| 325 } | 326 } |
| 326 } | 327 } |
| 327 | 328 |
| 328 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { | 329 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { |
| 329 return fGpu->ctxInfo(); | 330 return fGpu->ctxInfo(); |
| 330 } | 331 } |
| OLD | NEW |