Add support for GL_ARB_texture_swizzle
Review URL: http://codereview.appspot.com/5347042/
git-svn-id: http://skia.googlecode.com/svn/trunk@2615 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGLProgram.h b/src/gpu/GrGLProgram.h
index 58e24d9..53bc0d8 100644
--- a/src/gpu/GrGLProgram.h
+++ b/src/gpu/GrGLProgram.h
@@ -109,12 +109,6 @@
kCustomTextureDomain_OptFlagBit = 1 << 2,
kIsEnabled_OptFlagBit = 1 << 7
};
- enum Modulation {
- kColor_Modulation,
- kAlpha_Modulation,
-
- kModulationCnt
- };
enum FetchMode {
kSingle_FetchMode,
k2x2_FetchMode,
@@ -122,6 +116,20 @@
kFetchModeCnt,
};
+ enum InputConfig {
+ /**
+ The texture has r,g,b, and optionally a.
+ */
+ kColor_InputConfig,
+ /**
+ The texture is alpha only. This should only be used if the
+ caller is unable to map the r,g,b sample values to the
+ texture's alpha channel (GL_ARB_texture_swizzle).
+ */
+ kAlphaOnly_InputConfig,
+
+ kInputConfigCnt
+ };
enum CoordMapping {
kIdentity_CoordMapping,
kRadialGradient_CoordMapping,
@@ -134,8 +142,8 @@
};
uint8_t fOptFlags;
- uint8_t fModulation; // casts to enum Modulation
- uint8_t fFetchMode; // casts to enum FetchMode
+ uint8_t fInputConfig; // casts to enum InputConfig
+ uint8_t fFetchMode; // casts to enum FetchMode
uint8_t fCoordMapping; // casts to enum CoordMapping
uint8_t fKernelWidth;
@@ -153,13 +161,13 @@
// Specifies where the intitial color comes from before the stages are
// applied.
- enum ColorType {
- kSolidWhite_ColorType,
- kTransBlack_ColorType,
- kAttribute_ColorType,
- kUniform_ColorType,
+ enum ColorInput {
+ kSolidWhite_ColorInput,
+ kTransBlack_ColorInput,
+ kAttribute_ColorInput,
+ kUniform_ColorInput,
- kColorTypeCnt
+ kColorInputCnt
};
// Dual-src blending makes use of a secondary output color that can be
// used as a per-pixel blend coeffecient. This controls whether a
@@ -186,8 +194,8 @@
bool fExperimentalGS;
#endif
- uint8_t fColorType; // casts to enum ColorType
- uint8_t fDualSrcOutput; // casts to enum DualSrcOutput
+ uint8_t fColorInput; // casts to enum ColorInput
+ uint8_t fDualSrcOutput; // casts to enum DualSrcOutput
int8_t fFirstCoverageStage;
SkBool8 fEmitsPointSize;
SkBool8 fEdgeAAConcave;