Chromium Code Reviews| Index: src/core/SkBitmapProcShader.cpp |
| diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp |
| index 8e25530cee5dabe85cbfde36638fc0fe84533096..f81b938d8256f19114206504c970cccc9b296a3c 100644 |
| --- a/src/core/SkBitmapProcShader.cpp |
| +++ b/src/core/SkBitmapProcShader.cpp |
| @@ -382,19 +382,19 @@ void SkBitmapProcShader::toString(SkString* str) const { |
| #include "effects/GrSimpleTextureEffect.h" |
| #include "SkGr.h" |
| -GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint, |
| - const SkMatrix* localMatrix) const { |
| +bool SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint, GrColor* grColor, |
| + GrEffectRef** grEffect, const SkMatrix* localMatrix) const { |
|
bsalomon
2014/06/05 17:32:44
Doesn't this function need to set grColor?
jvanverth1
2014/06/05 17:36:30
grColor never gets set by this method
dandov
2014/06/06 21:50:43
Done.
dandov
2014/06/06 21:50:43
Done.
dandov
2014/06/06 21:50:43
The grColor is set the alpha of the SkPaint's alph
|
| SkMatrix matrix; |
| matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height()); |
| SkMatrix lmInverse; |
| if (!this->getLocalMatrix().invert(&lmInverse)) { |
| - return NULL; |
| + return false; |
| } |
| if (localMatrix) { |
| SkMatrix inv; |
| if (!localMatrix->invert(&inv)) { |
| - return NULL; |
| + return false; |
| } |
| lmInverse.postConcat(inv); |
| } |
| @@ -450,16 +450,16 @@ GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& |
| if (NULL == texture) { |
| SkErrorInternals::SetError( kInternalError_SkError, |
| "Couldn't convert bitmap to texture."); |
| - return NULL; |
| + return false; |
| } |
| - GrEffectRef* effect = NULL; |
| + *grEffect = NULL; |
|
bsalomon
2014/06/05 17:32:44
I don't think we should require this. The passed i
dandov
2014/06/06 21:50:43
Done.
|
| if (useBicubic) { |
| - effect = GrBicubicEffect::Create(texture, matrix, tm); |
| + *grEffect = GrBicubicEffect::Create(texture, matrix, tm); |
| } else { |
| - effect = GrSimpleTextureEffect::Create(texture, matrix, params); |
| + *grEffect = GrSimpleTextureEffect::Create(texture, matrix, params); |
| } |
| GrUnlockAndUnrefCachedBitmapTexture(texture); |
| - return effect; |
| + return true; |
| } |
| #endif |