| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #ifndef GrTypesPriv_DEFINED | 8 #ifndef GrTypesPriv_DEFINED |
| 9 #define GrTypesPriv_DEFINED | 9 #define GrTypesPriv_DEFINED |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 enum GrShaderType { | 32 enum GrShaderType { |
| 33 kVertex_GrShaderType, | 33 kVertex_GrShaderType, |
| 34 kGeometry_GrShaderType, | 34 kGeometry_GrShaderType, |
| 35 kFragment_GrShaderType, | 35 kFragment_GrShaderType, |
| 36 | 36 |
| 37 kLastkFragment_GrShaderType = kFragment_GrShaderType | 37 kLastkFragment_GrShaderType = kFragment_GrShaderType |
| 38 }; | 38 }; |
| 39 static const int kGrShaderTypeCount = kLastkFragment_GrShaderType + 1; | 39 static const int kGrShaderTypeCount = kLastkFragment_GrShaderType + 1; |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * Precisions of shader language variables. Not all shading languages support pr
ecisions or actually |
| 43 * vary the internal precision based on the qualifiers. |
| 44 */ |
| 45 enum GrSLPrecision { |
| 46 kLow_GrSLPrecision, |
| 47 kMedium_GrSLPrecision, |
| 48 kHigh_GrSLPrecision, |
| 49 |
| 50 // Default precision is medium. This is because on OpenGL ES 2 highp support
is not |
| 51 // guaranteed. On (non-ES) OpenGL the specifiers have no effect on precision
. |
| 52 kDefault_GrSLPrecision = kMedium_GrSLPrecision, |
| 53 |
| 54 kLast_GrSLPrecision = kHigh_GrSLPrecision |
| 55 }; |
| 56 |
| 57 static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1; |
| 58 |
| 59 /** |
| 42 * Gets the vector size of the SLType. Returns -1 for void, matrices, and sample
rs. | 60 * Gets the vector size of the SLType. Returns -1 for void, matrices, and sample
rs. |
| 43 */ | 61 */ |
| 44 static inline int GrSLTypeVectorCount(GrSLType type) { | 62 static inline int GrSLTypeVectorCount(GrSLType type) { |
| 45 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); | 63 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); |
| 46 static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1 }; | 64 static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1 }; |
| 47 return kCounts[type]; | 65 return kCounts[type]; |
| 48 | 66 |
| 49 GR_STATIC_ASSERT(0 == kVoid_GrSLType); | 67 GR_STATIC_ASSERT(0 == kVoid_GrSLType); |
| 50 GR_STATIC_ASSERT(1 == kFloat_GrSLType); | 68 GR_STATIC_ASSERT(1 == kFloat_GrSLType); |
| 51 GR_STATIC_ASSERT(2 == kVec2f_GrSLType); | 69 GR_STATIC_ASSERT(2 == kVec2f_GrSLType); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 /** | 218 /** |
| 201 * Indicates the type of pending IO operations that can be recorded for gpu reso
urces. | 219 * Indicates the type of pending IO operations that can be recorded for gpu reso
urces. |
| 202 */ | 220 */ |
| 203 enum GrIOType { | 221 enum GrIOType { |
| 204 kRead_GrIOType, | 222 kRead_GrIOType, |
| 205 kWrite_GrIOType, | 223 kWrite_GrIOType, |
| 206 kRW_GrIOType | 224 kRW_GrIOType |
| 207 }; | 225 }; |
| 208 | 226 |
| 209 #endif | 227 #endif |
| OLD | NEW |