Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 59173005: Show perlin issue (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added gm suppression Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/perlinnoise.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « gm/perlinnoise.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698