aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-03 18:49:51 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-03 18:49:51 +0000
commit8d3d210e74e3058f28eb2e59b71cae717ed65996 (patch)
tree5561d157901392320c51c5b012d8907766a9a834
parent5c33b71b96572a752aba29d3e43b8ecac8019a1d (diff)
Ensure that enums used by GrCustomStage TestCreate functions are declared in SK_ALLOW_GLOBAL_STATIC_INITIALIZERS=0 builds (e.g. android)
git-svn-id: http://skia.googlecode.com/svn/trunk@4953 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/gpu/GrCustomStageUnitTest.h13
-rw-r--r--src/gpu/effects/GrColorTableEffect.cpp2
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp4
-rw-r--r--src/gpu/effects/GrMorphologyEffect.cpp4
-rw-r--r--src/gpu/effects/GrSingleTextureEffect.cpp4
-rw-r--r--src/gpu/effects/GrTextureDomainEffect.cpp4
6 files changed, 17 insertions, 14 deletions
diff --git a/include/gpu/GrCustomStageUnitTest.h b/include/gpu/GrCustomStageUnitTest.h
index f928727e4a..6c63bd3d91 100644
--- a/include/gpu/GrCustomStageUnitTest.h
+++ b/include/gpu/GrCustomStageUnitTest.h
@@ -12,6 +12,14 @@
#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[]);
diff --git a/src/gpu/effects/GrColorTableEffect.cpp b/src/gpu/effects/GrColorTableEffect.cpp
index c6ce5599e4..227c91594e 100644
--- a/src/gpu/effects/GrColorTableEffect.cpp
+++ b/src/gpu/effects/GrColorTableEffect.cpp
@@ -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]));
}
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 2d705fa219..92c6ffb169 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -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];
diff --git a/src/gpu/effects/GrMorphologyEffect.cpp b/src/gpu/effects/GrMorphologyEffect.cpp
index 1444e37a60..14b3aef546 100644
--- a/src/gpu/effects/GrMorphologyEffect.cpp
+++ b/src/gpu/effects/GrMorphologyEffect.cpp
@@ -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);
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index ebd09130c0..e1856c9e93 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -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]));
}
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 6b22690197..9384b280ac 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -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);