aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-12 14:39:07 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-12 14:39:07 +0000
commitc76230868d45838b61c3ee25140839a5ec3689ac (patch)
tree34efcd123d2c90b3a3f10bdc7adb80f5f65a515b
parent233e4b80e056b0529aadbcc9cf8fb8754433cde1 (diff)
Fix the lighting filters unit test and re-enable it.
Review URL: http://codereview.appspot.com/6355098/ git-svn-id: http://skia.googlecode.com/svn/trunk@4568 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/gpu/gl/GrGpuGL_unittest.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gpu/gl/GrGpuGL_unittest.cpp b/src/gpu/gl/GrGpuGL_unittest.cpp
index 8ef2094f14..044d4777d9 100644
--- a/src/gpu/gl/GrGpuGL_unittest.cpp
+++ b/src/gpu/gl/GrGpuGL_unittest.cpp
@@ -40,14 +40,12 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
kDilate_EffectType,
kRadialGradient_EffectType,
kRadial2Gradient_EffectType,
-#if 0
kDiffuseDistant_EffectType,
kDiffusePoint_EffectType,
kDiffuseSpot_EffectType,
kSpecularDistant_EffectType,
kSpecularPoint_EffectType,
kSpecularSpot_EffectType,
-#endif
kSweepGradient_EffectType,
kEffectCount
@@ -120,7 +118,6 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
case kSweepGradient_EffectType: {
return SkNEW(GrSweepGradient);
}
-#if 0
case kDiffuseDistant_EffectType: {
SkPoint3 direction = random_point3(random);
direction.normalize();
@@ -130,7 +127,8 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
SkAutoTUnref<SkImageFilter> filter(SkLightingImageFilter::CreateDistantLitDiffuse(direction, lightColor, surfaceScale, kd));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
case kDiffusePoint_EffectType: {
@@ -141,7 +139,8 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
SkAutoTUnref<SkImageFilter> filter(SkLightingImageFilter::CreatePointLitDiffuse(location, lightColor, surfaceScale, kd));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
case kDiffuseSpot_EffectType: {
@@ -157,7 +156,8 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
case kSpecularDistant_EffectType: {
@@ -170,7 +170,8 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
SkAutoTUnref<SkImageFilter> filter(SkLightingImageFilter::CreateDistantLitSpecular(direction, lightColor, surfaceScale, ks, shininess));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
case kSpecularPoint_EffectType: {
@@ -182,7 +183,8 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
SkAutoTUnref<SkImageFilter> filter(SkLightingImageFilter::CreatePointLitSpecular(location, lightColor, surfaceScale, ks, shininess));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
case kSpecularSpot_EffectType: {
@@ -198,10 +200,10 @@ GrCustomStage* create_random_effect(StageDesc* stageDesc,
location, target, specularExponent, cutoffAngle, lightColor, surfaceScale, ks, shininess));
// does not work with perspective or mul-by-alpha-mask
GrCustomStage* stage;
- SkASSERT(filter->asNewCustomStage(&stage));
+ bool ok = filter->asNewCustomStage(&stage);
+ SkASSERT(ok);
return stage;
}
-#endif
default:
GrCrash("Unexpected custom effect type");
}