Chromium Code Reviews| Index: src/effects/SkPerlinNoiseShader.cpp |
| diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp |
| index a37dff5cda6a0e9f6a653fc69d77ca9f4b730429..da0dc7cf57493fb4e9db9b753256350c26590a28 100644 |
| --- a/src/effects/SkPerlinNoiseShader.cpp |
| +++ b/src/effects/SkPerlinNoiseShader.cpp |
| @@ -726,7 +726,9 @@ GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random, |
| stitchTiles ? &tileSize : NULL); |
| SkPaint paint; |
| - GrEffectRef* effect = shader->asNewEffect(context, paint, NULL); |
| + GrColor grColor; |
| + GrEffectRef* effect; |
| + shader->asNewEffect(context, paint, &grColor, &effect, NULL); |
| SkDELETE(shader); |
| @@ -1278,8 +1280,9 @@ void GrGLSimplexNoise::setData(const GrGLUniformManager& uman, const GrDrawEffec |
| ///////////////////////////////////////////////////////////////////// |
| -GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, |
| - const SkMatrix* externalLocalMatrix) const { |
| +bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, GrColor* grColor, |
| + GrEffectRef** grEffect, const SkMatrix* externalLocalMatrix) |
| +const { |
|
jvanverth1
2014/06/05 17:36:31
indent 'const {', and grColor never gets set by th
dandov
2014/06/06 21:50:43
Done.
|
| SkASSERT(NULL != context); |
| SkMatrix localMatrix = this->getLocalMatrix(); |
| @@ -1294,7 +1297,8 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& |
| } |
| SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter( |
| clearColor, SkXfermode::kSrc_Mode)); |
| - return cf->asNewEffect(context); |
| + *grEffect = cf->asNewEffect(context); |
| + return true; |
| } |
| // Either we don't stitch tiles, either we have a valid tile size |
| @@ -1303,7 +1307,7 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& |
| #ifdef SK_USE_SIMPLEX_NOISE |
| // Simplex noise is currently disabled but can be enabled by defining SK_USE_SIMPLEX_NOISE |
| sk_ignore_unused_variable(context); |
| - GrEffectRef* effect = |
| + *grEffect = |
| GrSimplexNoiseEffect::Create(fType, fPaintingData->fBaseFrequency, |
| fNumOctaves, fStitchTiles, fSeed, |
| this->getLocalMatrix(), paint.getAlpha()); |
| @@ -1313,7 +1317,7 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& |
| GrTexture* noiseTexture = GrLockAndRefCachedBitmapTexture( |
| context, fPaintingData->getNoiseBitmap(), NULL); |
| - GrEffectRef* effect = (NULL != permutationsTexture) && (NULL != noiseTexture) ? |
| + *grEffect = (NULL != permutationsTexture) && (NULL != noiseTexture) ? |
| GrPerlinNoiseEffect::Create(fType, fPaintingData->fBaseFrequency, |
| fNumOctaves, fStitchTiles, |
| fPaintingData->fStitchDataInit, |
| @@ -1332,14 +1336,16 @@ GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& |
| } |
| #endif |
| - return effect; |
| + return true; |
| } |
| #else |
| -GrEffectRef* SkPerlinNoiseShader::asNewEffect(GrContext*, const SkPaint&, const SkMatrix*) const { |
| +bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint, GrColor* grColor, |
| + GrEffectRef** grEffect, const SkMatrix* localMatrix) const { |
| SkDEBUGFAIL("Should not call in GPU-less build"); |
| - return NULL; |
| + *grEffect = NULL; |
| + return false; |
| } |
| #endif |