Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size.
R=robertphillips@google.com, jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/18686007
git-svn-id: http://skia.googlecode.com/svn/trunk@10062 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index a318ceb..3df59a8 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -119,23 +119,23 @@
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 {
+ GrPaint backgroundPaint;
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);
+ backgroundPaint.addColorTextureEffect(backgroundTex, backgroundMatrix);
+ context->drawRect(backgroundPaint, srcRect);
+
+ GrPaint foregroundPaint;
+ foregroundPaint.setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm));
+ foregroundPaint.addColorTextureEffect(foregroundTex, foregroundMatrix);
+ context->drawRect(foregroundPaint, srcRect);
}
offset->fX += backgroundOffset.fX;
offset->fY += backgroundOffset.fY;