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 "GrGLVertexShaderBuilder.h" | 8 #include "GrGLVertexShaderBuilder.h" |
9 #include "GrGLProgramBuilder.h" | 9 #include "GrGLFullProgramBuilder.h" |
10 #include "GrGLShaderStringBuilder.h" | 10 #include "GrGLShaderStringBuilder.h" |
11 #include "../GrGpuGL.h" | 11 #include "../GrGpuGL.h" |
12 #include "../../GrOptDrawState.h" | 12 #include "../../GrOptDrawState.h" |
13 | 13 |
14 #define GL_CALL(X) GR_GL_CALL(gpu->glInterface(), X) | 14 #define GL_CALL(X) GR_GL_CALL(gpu->glInterface(), X) |
15 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(gpu->glInterface(), R, X) | 15 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(gpu->glInterface(), R, X) |
16 | 16 |
17 namespace { | 17 namespace { |
18 inline const char* color_attribute_name() { return "inColor"; } | 18 inline const char* color_attribute_name() { return "inColor"; } |
19 inline const char* coverage_attribute_name() { return "inCoverage"; } | 19 inline const char* coverage_attribute_name() { return "inCoverage"; } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 this->addAttribute(GrShaderVar(coverage_attribute_name(), | 192 this->addAttribute(GrShaderVar(coverage_attribute_name(), |
193 kVec4f_GrSLType, | 193 kVec4f_GrSLType, |
194 GrShaderVar::kAttribute_TypeModifier)); | 194 GrShaderVar::kAttribute_TypeModifier)); |
195 const char *vsName, *fsName; | 195 const char *vsName, *fsName; |
196 fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Coverage", &vsName, &f
sName); | 196 fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Coverage", &vsName, &f
sName); |
197 this->codeAppendf("\t%s = %s;\n", vsName, coverage_attribute_name()); | 197 this->codeAppendf("\t%s = %s;\n", vsName, coverage_attribute_name()); |
198 *coverage = fsName; | 198 *coverage = fsName; |
199 } | 199 } |
200 fEffectAttribOffset = fInputs.count(); | 200 fEffectAttribOffset = fInputs.count(); |
201 } | 201 } |
OLD | NEW |