Index: src/effects/SkPerlinNoiseShader.cpp |
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp |
index 6e53253f292a5d55fb5911e3142ffd411c23a2be..3c1bf2fd0342e44ab3ecb74532d49b7efd198c9c 100644 |
--- a/src/effects/SkPerlinNoiseShader.cpp |
+++ b/src/effects/SkPerlinNoiseShader.cpp |
@@ -961,16 +961,12 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint& |
matrix.preConcat(localMatrix); |
if (0 == fNumOctaves) { |
- SkColor clearColor = 0; |
if (kFractalNoise_Type == fType) { |
- clearColor = SkColorSetARGB(paint.getAlpha() / 2, 127, 127, 127); |
- } |
- SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter( |
- clearColor, SkXfermode::kSrc_Mode)); |
- SkTDArray<GrFragmentProcessor*> array; |
- if (cf->asFragmentProcessors(context, &array)) { |
- SkASSERT(1 == array.count()); // modecolorfilter only returns one |
- *fp = array[0]; // transfer ownership to fp |
+ uint32_t alpha = paint.getAlpha() >> 1; |
+ uint32_t rgb = alpha >> 1; |
+ *paintColor = GrColorPackRGBA(rgb, rgb, rgb, alpha); |
+ } else { |
+ *paintColor = 0; |
} |
return true; |
} |