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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 static inline bool GrSLTypeIsSamplerType(GrSLType type) { | 198 static inline bool GrSLTypeIsSamplerType(GrSLType type) { |
199 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); | 199 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); |
200 return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType; | 200 return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType; |
201 | 201 |
202 GR_STATIC_ASSERT(8 == kSampler2D_GrSLType); | 202 GR_STATIC_ASSERT(8 == kSampler2D_GrSLType); |
203 GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType); | 203 GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType); |
204 GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType); | 204 GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType); |
205 } | 205 } |
206 | 206 |
| 207 static inline bool GrSLTypeAcceptsPrecision(GrSLType type) { |
| 208 return GrSLTypeIsNumeric(type) || GrSLTypeIsSamplerType(type); |
| 209 } |
| 210 |
207 ////////////////////////////////////////////////////////////////////////////// | 211 ////////////////////////////////////////////////////////////////////////////// |
208 | 212 |
209 /** | 213 /** |
210 * Types used to describe format of vertices in arrays. | 214 * Types used to describe format of vertices in arrays. |
211 */ | 215 */ |
212 enum GrVertexAttribType { | 216 enum GrVertexAttribType { |
213 kFloat_GrVertexAttribType = 0, | 217 kFloat_GrVertexAttribType = 0, |
214 kVec2f_GrVertexAttribType, | 218 kVec2f_GrVertexAttribType, |
215 kVec3f_GrVertexAttribType, | 219 kVec3f_GrVertexAttribType, |
216 kVec4f_GrVertexAttribType, | 220 kVec4f_GrVertexAttribType, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // Takes a pointer to a GrCaps, and will suppress prints if required | 415 // Takes a pointer to a GrCaps, and will suppress prints if required |
412 #define GrCapsDebugf(caps, ...) \ | 416 #define GrCapsDebugf(caps, ...) \ |
413 if (!caps->suppressPrints()) { \ | 417 if (!caps->suppressPrints()) { \ |
414 SkDebugf(__VA_ARGS__); \ | 418 SkDebugf(__VA_ARGS__); \ |
415 } | 419 } |
416 #else | 420 #else |
417 #define GrCapsDebugf(caps, ...) | 421 #define GrCapsDebugf(caps, ...) |
418 #endif | 422 #endif |
419 | 423 |
420 #endif | 424 #endif |
OLD | NEW |