Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color, one for coverage.
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/16952006
git-svn-id: http://skia.googlecode.com/svn/trunk@9592 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index fc34591..0fab55c 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -191,6 +191,7 @@
if (!avmr.setIdentity(drawState)) {
return;
}
+ GrDrawState::AutoRestoreEffects are(drawState);
enum {
// the SW path renderer shares this stage with glyph
// rendering (kGlyphMaskStage in GrTextContext)
@@ -213,13 +214,11 @@
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
maskMatrix.preConcat(drawState->getViewMatrix());
- GrAssert(!drawState->isStageEnabled(kPathMaskStage));
- drawState->setEffect(kPathMaskStage,
+ drawState->addCoverageEffect(
GrSimpleTextureEffect::Create(texture,
maskMatrix,
false,
GrEffect::kPosition_CoordsType))->unref();
target->drawSimpleRect(dstRect);
- drawState->disableStage(kPathMaskStage);
}