OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrGLSL.h" | 8 #include "GrGLSL.h" |
9 #include "GrGLShaderVar.h" | 9 #include "GrGLShaderVar.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
11 | 11 |
12 bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
{ | 12 bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
{ |
13 SkASSERT(NULL != generation); | 13 SkASSERT(generation); |
14 GrGLSLVersion ver = GrGLGetGLSLVersion(gl); | 14 GrGLSLVersion ver = GrGLGetGLSLVersion(gl); |
15 if (GR_GLSL_INVALID_VER == ver) { | 15 if (GR_GLSL_INVALID_VER == ver) { |
16 return false; | 16 return false; |
17 } | 17 } |
18 switch (gl->fStandard) { | 18 switch (gl->fStandard) { |
19 case kGL_GrGLStandard: | 19 case kGL_GrGLStandard: |
20 SkASSERT(ver >= GR_GLSL_VER(1,10)); | 20 SkASSERT(ver >= GR_GLSL_VER(1,10)); |
21 if (ver >= GR_GLSL_VER(1,50)) { | 21 if (ver >= GR_GLSL_VER(1,50)) { |
22 *generation = k150_GrGLSLGeneration; | 22 *generation = k150_GrGLSLGeneration; |
23 } else if (ver >= GR_GLSL_VER(1,40)) { | 23 } else if (ver >= GR_GLSL_VER(1,40)) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 append_tabs(outAppend, tabCnt); | 91 append_tabs(outAppend, tabCnt); |
92 | 92 |
93 if (mulFactor.isZeros()) { | 93 if (mulFactor.isZeros()) { |
94 outAppend->appendf("%s = vec4(0);\n", vec4VarName); | 94 outAppend->appendf("%s = vec4(0);\n", vec4VarName); |
95 } else { | 95 } else { |
96 outAppend->appendf("%s *= %s;\n", vec4VarName, mulFactor.c_str()); | 96 outAppend->appendf("%s *= %s;\n", vec4VarName, mulFactor.c_str()); |
97 } | 97 } |
98 } | 98 } |
OLD | NEW |