aboutsummaryrefslogtreecommitdiff
path: root/tests/GLProgramsTest.cpp
diff options
context:
space:
mode:
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-03 18:12:20 +0000
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-03 18:12:20 +0000
commit0a7672f85ef7655b343679609d02018f83fcfc23 (patch)
tree182413e9da8c9e33040b7fd22bd0e5ec912a45bd /tests/GLProgramsTest.cpp
parenta9e937c7b712b024de108fa963f92d0e70e4a296 (diff)
Add morphology, convolution, single texture, texture domain effects to new unit test system
Review URL: http://codereview.appspot.com/6442085/ git-svn-id: http://skia.googlecode.com/svn/trunk@4951 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/GLProgramsTest.cpp')
-rw-r--r--tests/GLProgramsTest.cpp62
1 files changed, 2 insertions, 60 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 199cc4989d..1228b4ef47 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -13,9 +13,6 @@
#if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
#include "gl/GrGpuGL.h"
-#include "effects/GrColorTableEffect.h"
-#include "effects/GrConvolutionEffect.h"
-#include "effects/GrMorphologyEffect.h"
#include "SkLightingImageFilter.h"
#include "GrProgramStageFactory.h"
#include "GrRandom.h"
@@ -51,9 +48,6 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
GrContext* context,
GrTexture* dummyTextures[]) {
enum EffectType {
- kConvolution_EffectType,
- kErode_EffectType,
- kDilate_EffectType,
/**
* Lighting effects don't work in unit test because they assume they insert functions and
* assume the names are unique. This breaks when there are two light effects in the same
@@ -68,8 +62,6 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
kSpecularSpot_EffectType,
*/
- kColorTable_EffectType,
-
kEffectCount
};
@@ -79,11 +71,6 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
StageDesc::kMulRGBByAlpha_RoundUp_InConfigFlag |
StageDesc::kMulRGBByAlpha_RoundDown_InConfigFlag;
- static const Gr1DKernelEffect::Direction gKernelDirections[] = {
- Gr1DKernelEffect::kX_Direction,
- Gr1DKernelEffect::kY_Direction
- };
-
// The new code uses SkRandom not GrRandom.
// TODO: Remove GrRandom.
SkRandom sk_random;
@@ -102,48 +89,7 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
// TODO: When matrices are property of the custom-stage then remove the
// no-persp flag code below.
int effect = random_int(random, kEffectCount);
- switch (effect) {
- case kConvolution_EffectType: {
- int direction = random_int(random, 2);
- int kernelRadius = random_int(random, 1, 4);
- float kernel[GrConvolutionEffect::kMaxKernelWidth];
- for (int i = 0; i < GrConvolutionEffect::kMaxKernelWidth; i++) {
- kernel[i] = random->nextF();
- }
- // does not work with perspective or mul-by-alpha-mask
- stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
- stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return SkNEW_ARGS(GrConvolutionEffect,
- (NULL,
- gKernelDirections[direction],
- kernelRadius,
- kernel));
- }
- case kErode_EffectType: {
- int direction = random_int(random, 2);
- int kernelRadius = random_int(random, 1, 4);
- // does not work with perspective or mul-by-alpha-mask
- stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
- stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return SkNEW_ARGS(GrMorphologyEffect,
- (NULL,
- gKernelDirections[direction],
- kernelRadius,
- GrContext::kErode_MorphologyType));
- }
- case kDilate_EffectType: {
- int direction = random_int(random, 2);
- int kernelRadius = random_int(random, 1, 4);
- // does not work with perspective or mul-by-alpha-mask
- stageDesc->fOptFlags |= StageDesc::kNoPerspective_OptFlagBit;
- stageDesc->fInConfigFlags &= ~kMulByAlphaMask;
- return SkNEW_ARGS(GrMorphologyEffect,
- (NULL,
- gKernelDirections[direction],
- kernelRadius,
- GrContext::kDilate_MorphologyType));
- }
- /*
+/* switch (effect) {
case kDiffuseDistant_EffectType: {
SkPoint3 direction = random_point3(random);
direction.normalize();
@@ -230,14 +176,10 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
SkASSERT(ok);
return stage;
}
- */
- case kColorTable_EffectType: {
- GrTexture* alphaTexture = dummyTextures[GrCustomStageTestFactory::kAlphaTextureIdx];
- return SkNEW_ARGS(GrColorTableEffect, (alphaTexture));
- }
default:
GrCrash("Unexpected custom effect type");
}
+ */
return NULL;
}
}