Chromium Code Reviews| Index: src/gpu/GrContext.cpp |
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
| index 39d0db33b444792a8216cd00ce74d4eded79769a..0f155b25e64aa73dbd70a38e8e8fda6dd91d0f4a 100644 |
| --- a/src/gpu/GrContext.cpp |
| +++ b/src/gpu/GrContext.cpp |
| @@ -1764,20 +1764,16 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, |
| return NULL; |
| } |
| - GrPaint paint; |
| - paint.reset(); |
| - |
| for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) { |
| + GrPaint paint; |
| SkMatrix matrix; |
| matrix.setIDiv(srcTexture->width(), srcTexture->height()); |
| this->setRenderTarget(dstTexture->asRenderTarget()); |
| SkRect dstRect(srcRect); |
| scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f, |
| i < scaleFactorY ? 0.5f : 1.0f); |
| - |
| - paint.colorStage(0)->setEffect(GrSimpleTextureEffect::Create(srcTexture, |
| - matrix, |
| - true))->unref(); |
| + GrTextureParams params(SkShader::kClamp_TileMode, true); |
| + paint.addColorTextureEffect(srcTexture, matrix, params); |
| this->drawRectToRect(paint, dstRect, srcRect); |
| srcRect = dstRect; |
| srcTexture = dstTexture; |
| @@ -1795,7 +1791,7 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, |
| radiusX, srcIRect.height()); |
| this->clear(&clearRect, 0x0); |
| } |
| - |
| + GrPaint paint; |
| this->setRenderTarget(dstTexture->asRenderTarget()); |
| AutoRestoreEffects are; |
|
robertphillips
2013/07/12 12:54:33
can we just pass in NULL here?
bsalomon
2013/07/12 13:38:59
No... it's removing the effects from the draw stat
|
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are); |
| @@ -1815,6 +1811,7 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, |
| } |
| this->setRenderTarget(dstTexture->asRenderTarget()); |
| + GrPaint paint; |
| AutoRestoreEffects are; |
|
robertphillips
2013/07/12 12:54:33
Here too?
|
| GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are); |
| convolve_gaussian(target, srcTexture, srcRect, sigmaY, radiusY, |
| @@ -1833,12 +1830,14 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture, |
| 1, srcIRect.height()); |
| this->clear(&clearRect, 0x0); |
| SkMatrix matrix; |
| - // FIXME: This should be mitchell, not bilinear. |
| matrix.setIDiv(srcTexture->width(), srcTexture->height()); |
| this->setRenderTarget(dstTexture->asRenderTarget()); |
| - paint.colorStage(0)->setEffect(GrSimpleTextureEffect::Create(srcTexture, |
| - matrix, |
| - true))->unref(); |
| + |
| + GrPaint paint; |
| + // FIXME: This should be mitchell, not bilinear. |
| + GrTextureParams params(SkShader::kClamp_TileMode, true); |
| + paint.addColorTextureEffect(srcTexture, matrix, params); |
| + |
| SkRect dstRect(srcRect); |
| scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY); |
| this->drawRectToRect(paint, dstRect, srcRect); |