Index: include/gpu/GrTypesPriv.h |
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h |
index 6a9c44ff9fb9d2c38bc63f069b312a9869cf5a91..c46e25bd0d4410bfb11dcf4a4743072a766e84d7 100644 |
--- a/include/gpu/GrTypesPriv.h |
+++ b/include/gpu/GrTypesPriv.h |
@@ -26,8 +26,9 @@ enum GrSLType { |
kMat44f_GrSLType, |
kSampler2D_GrSLType, |
kSamplerExternal_GrSLType, |
+ kSampler2DRect_GrSLType, |
- kLast_GrSLType = kSamplerExternal_GrSLType |
+ kLast_GrSLType = kSampler2DRect_GrSLType |
}; |
static const int kGrSLTypeCount = kLast_GrSLType + 1; |
@@ -64,7 +65,7 @@ static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1; |
*/ |
static inline int GrSLTypeVectorCount(GrSLType type) { |
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); |
- static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1 }; |
+ static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1 }; |
return kCounts[type]; |
GR_STATIC_ASSERT(0 == kVoid_GrSLType); |
@@ -76,6 +77,7 @@ static inline int GrSLTypeVectorCount(GrSLType type) { |
GR_STATIC_ASSERT(6 == kMat44f_GrSLType); |
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType); |
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType); |
+ GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); |
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount); |
} |
@@ -105,7 +107,8 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) { |
GR_STATIC_ASSERT(6 == kMat44f_GrSLType); |
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType); |
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType); |
- GR_STATIC_ASSERT(9 == kGrSLTypeCount); |
+ GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); |
+ GR_STATIC_ASSERT(10 == kGrSLTypeCount); |
} |
/** Returns the size in bytes for floating point GrSLTypes. For non floating point type returns 0 */ |
@@ -120,7 +123,8 @@ static inline size_t GrSLTypeSize(GrSLType type) { |
9 * sizeof(float), // kMat33f_GrSLType |
16 * sizeof(float), // kMat44f_GrSLType |
0, // kSampler2D_GrSLType |
- 0 // kSamplerExternal_GrSLType |
+ 0, // kSamplerExternal_GrSLType |
+ 0 // kSampler2DRect_GrSLType |
}; |
return kSizes[type]; |
@@ -133,7 +137,17 @@ static inline size_t GrSLTypeSize(GrSLType type) { |
GR_STATIC_ASSERT(6 == kMat44f_GrSLType); |
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType); |
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType); |
- GR_STATIC_ASSERT(9 == kGrSLTypeCount); |
+ GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); |
+ GR_STATIC_ASSERT(10 == kGrSLTypeCount); |
+} |
+ |
+static inline bool GrSLTypeIsSamplerType(GrSLType type) { |
+ SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); |
+ return type >= 7 && type <= 9; |
+ |
+ GR_STATIC_ASSERT(7 == kSampler2D_GrSLType); |
+ GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType); |
+ GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType); |
} |
////////////////////////////////////////////////////////////////////////////// |