Ensure that enums used by GrCustomStage TestCreate functions are declared in SK_ALLOW...
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 3 Aug 2012 18:49:51 +0000 (18:49 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 3 Aug 2012 18:49:51 +0000 (18:49 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@4953 2bbb7eff-a529-9590-31e7-b0007b416f81

include/gpu/GrCustomStageUnitTest.h
src/gpu/effects/GrColorTableEffect.cpp
src/gpu/effects/GrConvolutionEffect.cpp
src/gpu/effects/GrMorphologyEffect.cpp
src/gpu/effects/GrSingleTextureEffect.cpp
src/gpu/effects/GrTextureDomainEffect.cpp

index f928727..6c63bd3 100644 (file)
 #include "GrNoncopyable.h"
 #include "SkTArray.h"
 
+namespace GrCustomStageUnitTest {
+// Used to access the dummy textures in TestCreate procs.
+enum {
+    kSkiaPMTextureIdx = 0,
+    kAlphaTextureIdx = 1,
+};
+}
+
 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
 
 class GrCustomStage;
@@ -20,11 +28,6 @@ class GrTexture;
 
 class GrCustomStageTestFactory : GrNoncopyable {
 public:
-    // Used to access the dummy textures in TestCreate procs.
-    enum {
-        kSkiaPMTextureIdx = 0,
-        kAlphaTextureIdx = 1,
-    };
 
     typedef GrCustomStage* (*CreateProc)(SkRandom*, GrContext*, GrTexture* dummyTextures[]);
 
index c6ce559..227c915 100644 (file)
@@ -132,5 +132,5 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrColorTableEffect);
 GrCustomStage* GrColorTableEffect::TestCreate(SkRandom* random,
                                               GrContext* context,
                                               GrTexture* textures[]) {
-    return SkNEW_ARGS(GrColorTableEffect, (textures[GrCustomStageTestFactory::kAlphaTextureIdx]));
+    return SkNEW_ARGS(GrColorTableEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx]));
 }
index 2d705fa..92c6ffb 100644 (file)
@@ -187,8 +187,8 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrConvolutionEffect);
 GrCustomStage* GrConvolutionEffect::TestCreate(SkRandom* random,
                                               GrContext* context,
                                               GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageTestFactory::kSkiaPMTextureIdx :
-                                      GrCustomStageTestFactory::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
+                                      GrCustomStageUnitTest::kAlphaTextureIdx;
     Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
     int radius = random->nextRangeU(1, kMaxKernelRadius);
     float kernel[kMaxKernelRadius];
index 1444e37..14b3aef 100644 (file)
@@ -156,8 +156,8 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrMorphologyEffect);
 GrCustomStage* GrMorphologyEffect::TestCreate(SkRandom* random,
                                               GrContext* context,
                                               GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageTestFactory::kSkiaPMTextureIdx :
-                                      GrCustomStageTestFactory::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
+                                      GrCustomStageUnitTest::kAlphaTextureIdx;
     Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
     static const int kMaxRadius = 10;
     int radius = random->nextRangeU(1, kMaxRadius);
index ebd0913..e1856c9 100644 (file)
@@ -64,7 +64,7 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrSingleTextureEffect);
 GrCustomStage* GrSingleTextureEffect::TestCreate(SkRandom* random,
                                                  GrContext* context,
                                                  GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageTestFactory::kSkiaPMTextureIdx :
-                                      GrCustomStageTestFactory::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
+                                      GrCustomStageUnitTest::kAlphaTextureIdx;
     return SkNEW_ARGS(GrSingleTextureEffect, (textures[texIdx]));
 }
index 6b22690..9384b28 100644 (file)
@@ -115,8 +115,8 @@ GR_DEFINE_CUSTOM_STAGE_TEST(GrTextureDomainEffect);
 GrCustomStage* GrTextureDomainEffect::TestCreate(SkRandom* random,
                                                  GrContext* context,
                                                  GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageTestFactory::kSkiaPMTextureIdx :
-                                      GrCustomStageTestFactory::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
+                                      GrCustomStageUnitTest::kAlphaTextureIdx;
     GrRect domain;
     domain.fLeft = random->nextUScalar1();
     domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);