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/include/gpu/GrGLConfig.h b/include/gpu/GrGLConfig.h
index 45b551c..f9a801d 100644
--- a/include/gpu/GrGLConfig.h
+++ b/include/gpu/GrGLConfig.h
@@ -77,6 +77,10 @@
  * It is not extern "C".
  * The GrGLInterface field fCallback specifies the function ptr and there is an
  * additional field fCallbackData of type intptr_t for client data.
+ *
+ * GR_GL_RGBA_8888_READBACK_SLOW: Set this to 1 if it is known that performing
+ * glReadPixels with format=GL_RGBA, type=GL_UNISIGNED_BYTE is significantly 
+ * slower than format=GL_BGRA, type=GL_UNISIGNED_BYTE.
  */
 
 #if !defined(GR_GL_LOG_CALLS)
@@ -111,6 +115,10 @@
     #define GR_GL_PER_GL_FUNC_CALLBACK          0
 #endif
 
+#if !defined(GR_GL_RGBA_8888_READBACK_SLOW)
+    #define GR_GL_RGBA_8888_READBACK_SLOW       0
+#endif
+
 #if(GR_GL_NO_CONSTANT_ATTRIBUTES) && (GR_GL_ATTRIBUTE_MATRICES)
     #error "Cannot combine GR_GL_NO_CONSTANT_ATTRIBUTES and GR_GL_ATTRIBUTE_MATRICES"
 #endif