| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrGLPathProgramBuilder.h" | 8 #include "GrGLPathProgramBuilder.h" |
| 9 #include "gl/GrGLGpu.h" | 9 #include "gl/GrGLGpu.h" |
| 10 #include "gl/GrGLPathProgram.h" | 10 #include "gl/GrGLPathProgram.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 fSeparableVaryingInfos, fGeometryProcessor, fXfer
Processor, | 22 fSeparableVaryingInfos, fGeometryProcessor, fXfer
Processor, |
| 23 fFragmentProcessors.get(), &fSamplerUniforms); | 23 fFragmentProcessors.get(), &fSamplerUniforms); |
| 24 } | 24 } |
| 25 | 25 |
| 26 GrGLProgramBuilder::SeparableVaryingHandle GrGLPathProgramBuilder::addSeparableV
arying( | 26 GrGLProgramBuilder::SeparableVaryingHandle GrGLPathProgramBuilder::addSeparableV
arying( |
| 27 const char* name, GrGLVertToFrag* v, GrSLPrecision fsPrecision) { | 27 const char* name, GrGLVertToFrag* v, GrSLPrecision fsPrecision) { |
| 28 this->addVarying(name, v, fsPrecision); | 28 this->addVarying(name, v, fsPrecision); |
| 29 SeparableVaryingInfo& varyingInfo = fSeparableVaryingInfos.push_back(); | 29 SeparableVaryingInfo& varyingInfo = fSeparableVaryingInfos.push_back(); |
| 30 varyingInfo.fVariable = this->getFragmentShaderBuilder()->fInputs.back(); | 30 varyingInfo.fVariable = this->getFragmentShaderBuilder()->fInputs.back(); |
| 31 varyingInfo.fLocation = fSeparableVaryingInfos.count() - 1; | 31 varyingInfo.fLocation = fSeparableVaryingInfos.count() - 1; |
| 32 return SeparableVaryingHandle::CreateFromSeparableVaryingIndex(varyingInfo.f
Location); | 32 return SeparableVaryingHandle(varyingInfo.fLocation); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void GrGLPathProgramBuilder::bindProgramResourceLocations(GrGLuint programID) { | 35 void GrGLPathProgramBuilder::bindProgramResourceLocations(GrGLuint programID) { |
| 36 this->INHERITED::bindProgramResourceLocations(programID); | 36 this->INHERITED::bindProgramResourceLocations(programID); |
| 37 if (!fGpu->glPathRendering()->shouldBindFragmentInputs()) { | 37 if (!fGpu->glPathRendering()->shouldBindFragmentInputs()) { |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 int count = fSeparableVaryingInfos.count(); | 40 int count = fSeparableVaryingInfos.count(); |
| 41 for (int i = 0; i < count; ++i) { | 41 for (int i = 0; i < count; ++i) { |
| 42 GL_CALL(BindFragmentInputLocation(programID, | 42 GL_CALL(BindFragmentInputLocation(programID, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 54 int count = fSeparableVaryingInfos.count(); | 54 int count = fSeparableVaryingInfos.count(); |
| 55 for (int i = 0; i < count; ++i) { | 55 for (int i = 0; i < count; ++i) { |
| 56 GrGLint location; | 56 GrGLint location; |
| 57 GL_CALL_RET(location, | 57 GL_CALL_RET(location, |
| 58 GetProgramResourceLocation(programID, | 58 GetProgramResourceLocation(programID, |
| 59 GR_GL_FRAGMENT_INPUT, | 59 GR_GL_FRAGMENT_INPUT, |
| 60 fSeparableVaryingInfos[i].fVariab
le.c_str())); | 60 fSeparableVaryingInfos[i].fVariab
le.c_str())); |
| 61 fSeparableVaryingInfos[i].fLocation = location; | 61 fSeparableVaryingInfos[i].fLocation = location; |
| 62 } | 62 } |
| 63 } | 63 } |
| OLD | NEW |