| 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 "GrGLGLSL.h" | 8 #include "GrGLGLSL.h" |
| 9 #include "GrGLContext.h" | 9 #include "GrGLContext.h" |
| 10 #include "GrGLUtil.h" | 10 #include "GrGLUtil.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } else { | 41 } else { |
| 42 *generation = k110_GrGLSLGeneration; | 42 *generation = k110_GrGLSLGeneration; |
| 43 } | 43 } |
| 44 return true; | 44 return true; |
| 45 default: | 45 default: |
| 46 SkFAIL("Unknown GL Standard"); | 46 SkFAIL("Unknown GL Standard"); |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 void GrGLAppendGLSLDefaultFloatPrecisionDeclaration(GrSLPrecision p, GrGLStandar
d s, SkString* out) { | |
| 52 // Desktop GLSL has added precision qualifiers but they don't do anything. | |
| 53 if (kGLES_GrGLStandard == s) { | |
| 54 switch (p) { | |
| 55 case kHigh_GrSLPrecision: | |
| 56 out->append("precision highp float;\n"); | |
| 57 break; | |
| 58 case kMedium_GrSLPrecision: | |
| 59 out->append("precision mediump float;\n"); | |
| 60 break; | |
| 61 case kLow_GrSLPrecision: | |
| 62 out->append("precision lowp float;\n"); | |
| 63 break; | |
| 64 default: | |
| 65 SkFAIL("Unknown precision value."); | |
| 66 } | |
| 67 } | |
| 68 } | |
| OLD | NEW |