Do premul and r/b swap conversions in a custom effect

Review URL: https://codereview.appspot.com/6473060/



git-svn-id: http://skia.googlecode.com/svn/trunk@5284 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index e14198c..fd24518 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -14,6 +14,7 @@
 
 #include "gl/GrGpuGL.h"
 #include "GrProgramStageFactory.h"
+#include "effects/GrConfigConversionEffect.h"
 
 #include "GrRandom.h"
 #include "Test.h"
@@ -44,12 +45,6 @@
                                           GrContext* context,
                                           GrTexture* dummyTextures[]) {
 
-    // TODO: Remove this when generator doesn't apply this non-custom-stage
-    // notion to custom stages automatically.
-    static const uint32_t kMulByAlphaMask =
-        StageDesc::kMulRGBByAlpha_RoundUp_InConfigFlag |
-        StageDesc::kMulRGBByAlpha_RoundDown_InConfigFlag;
-
     // The new code uses SkRandom not GrRandom.
     // TODO: Remove GrRandom.
     SkRandom sk_random;
@@ -82,10 +77,6 @@
     };
     static const int IN_CONFIG_FLAGS[] = {
         StageDesc::kNone_InConfigFlag,
-        StageDesc::kSwapRAndB_InConfigFlag,
-        StageDesc::kSwapRAndB_InConfigFlag |
-        StageDesc::kMulRGBByAlpha_RoundUp_InConfigFlag,
-        StageDesc::kMulRGBByAlpha_RoundDown_InConfigFlag,
         StageDesc::kSmearAlpha_InConfigFlag,
         StageDesc::kSmearRed_InConfigFlag,
     };
@@ -121,7 +112,6 @@
         pdesc.fExperimentalGS = this->getCaps().fGeometryShaderSupport &&
                                 random_bool(&random);
 #endif
-        pdesc.fOutputConfig =  random_int(&random, ProgramDesc::kOutputConfigCnt);
 
         bool edgeAA = random_bool(&random);
         if (edgeAA) {
@@ -212,6 +202,7 @@
 void forceLinking() {
     SkLightingImageFilter::CreateDistantLitDiffuse(SkPoint3(0,0,0), 0, 0, 0);
     SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1);
+    GrConfigConversionEffect::Create(NULL, false);
 }
 
 #endif