When GL_RGBA readPixels are slow do swizzle using a draw then readPixels with GL_BGRA
Review URL: http://codereview.appspot.com/5339051/
git-svn-id: http://skia.googlecode.com/svn/trunk@2631 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGLProgram.h b/src/gpu/GrGLProgram.h
index 9abf1b1..e0f8fbc 100644
--- a/src/gpu/GrGLProgram.h
+++ b/src/gpu/GrGLProgram.h
@@ -125,19 +125,26 @@
kFetchModeCnt,
};
- enum InputConfig {
+ /**
+ Describes how to swizzle the texture's components. If swizzling
+ can be applied outside of the shader (GL_ARB_texture_swizzle) that
+ is preferrable to using this enum. Changing the enum value used
+ causes another program to be generated.
+ */
+ enum Swizzle {
/**
- The texture has r,g,b, and optionally a.
+ No swizzling applied to the inputs
*/
- kColor_InputConfig,
+ kNone_Swizzle,
/**
- 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).
+ Swap the R and B channels
+ */
+ kSwapRAndB_Swizzle,
+ /**
+ Smear alpha across all four channels.
*/
- kAlphaOnly_InputConfig,
-
- kInputConfigCnt
+ kAlphaSmear_Swizzle,
+ kSwizzleCnt
};
enum CoordMapping {
kIdentity_CoordMapping,
@@ -151,7 +158,7 @@
};
uint8_t fOptFlags;
- uint8_t fInputConfig; // casts to enum InputConfig
+ uint8_t fSwizzle; // casts to enum Swizzle
uint8_t fFetchMode; // casts to enum FetchMode
uint8_t fCoordMapping; // casts to enum CoordMapping
uint8_t fKernelWidth;