Chromium Code Reviews| Index: src/effects/SkXfermodeImageFilter.cpp |
| diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp |
| index a318ceb9088b0a2c6359043f1a062d448d8558f7..c96bb2f585ac46b166463ec5427264917f8c1027 100644 |
| --- a/src/effects/SkXfermodeImageFilter.cpp |
| +++ b/src/effects/SkXfermodeImageFilter.cpp |
| @@ -119,23 +119,23 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, |
| SkIntToScalar(backgroundOffset.fY-foregroundOffset.fY)); |
| - GrPaint paint; |
| SkRect srcRect; |
| src.getBounds(&srcRect); |
| if (NULL != xferEffect) { |
| - paint.colorStage(0)->setEffect( |
| - GrSimpleTextureEffect::Create(foregroundTex, foregroundMatrix))->unref(); |
| - paint.colorStage(1)->setEffect(xferEffect)->unref(); |
| + GrPaint paint; |
| + paint.addColorTextureEffect(foregroundTex, foregroundMatrix); |
| + paint.addColorEffect(xferEffect)->unref(); |
| context->drawRect(paint, srcRect); |
| } else { |
|
robertphillips
2013/07/12 12:54:33
foregroundPaint, backgroundPaint?
fgPaint, bgPaint
bsalomon
2013/07/12 13:38:59
yeah, that's better.
|
| + GrPaint paint1; |
| SkMatrix backgroundMatrix = GrEffect::MakeDivByTextureWHMatrix(backgroundTex); |
| - paint.colorStage(0)->setEffect( |
| - GrSimpleTextureEffect::Create(backgroundTex, backgroundMatrix))->unref(); |
| - context->drawRect(paint, srcRect); |
| - paint.setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm)); |
| - paint.colorStage(0)->setEffect( |
| - GrSimpleTextureEffect::Create(foregroundTex, foregroundMatrix))->unref(); |
| - context->drawRect(paint, srcRect); |
| + paint1.addColorTextureEffect(backgroundTex, backgroundMatrix); |
| + context->drawRect(paint1, srcRect); |
| + |
| + GrPaint paint2; |
| + paint2.setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm)); |
| + paint2.addColorTextureEffect(foregroundTex, foregroundMatrix); |
| + context->drawRect(paint2, srcRect); |
| } |
| offset->fX += backgroundOffset.fX; |
| offset->fY += backgroundOffset.fY; |