Index: src/effects/SkPerlinNoiseShader.cpp |
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp |
index af51afc0316f8438944239f76fe26f63c4a34904..f2ce67924e5d4109800cfafc6b490f8868caf950 100644 |
--- a/src/effects/SkPerlinNoiseShader.cpp |
+++ b/src/effects/SkPerlinNoiseShader.cpp |
@@ -7,6 +7,7 @@ |
#include "SkDither.h" |
#include "SkPerlinNoiseShader.h" |
+#include "SkColorFilter.h" |
#include "SkFlattenableBuffers.h" |
#include "SkShader.h" |
#include "SkUnPreMultiply.h" |
@@ -1295,6 +1296,16 @@ void GrGLSimplexNoise::setData(const GrGLUniformManager& uman, const GrDrawEffec |
GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint) const { |
SkASSERT(NULL != context); |
+ if (0 == fNumOctaves) { |
+ SkColor clearColor = 0; |
+ if (kFractalNoise_Type == fType) { |
+ clearColor = SkColorSetARGB(paint.getAlpha() / 2, 127, 127, 127); |
+ } |
+ SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter( |
bsalomon
2013/11/05 20:30:22
Ha.. ok.
|
+ clearColor, SkXfermode::kSrc_Mode)); |
+ return cf->asNewEffect(context); |
+ } |
+ |
// Either we don't stitch tiles, either we have a valid tile size |
SkASSERT(!fStitchTiles || !fTileSize.isEmpty()); |