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/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 0c58430..ae98b54 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -292,9 +292,9 @@
////////////////////////////////////////////////////////////////////////////////
-bool GrGpu::setupClipAndFlushState(DrawType type, const GrDeviceCoordTexture* dstCopy) {
-
- if (!fClipMaskManager.setupClipping(this->getClip())) {
+bool GrGpu::setupClipAndFlushState(DrawType type, const GrDeviceCoordTexture* dstCopy,
+ GrDrawState::AutoRestoreEffects* are) {
+ if (!fClipMaskManager.setupClipping(this->getClip(), are)) {
return false;
}
@@ -336,8 +336,10 @@
void GrGpu::onDraw(const DrawInfo& info) {
this->handleDirtyContext();
+ GrDrawState::AutoRestoreEffects are;
if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()),
- info.getDstCopy())) {
+ info.getDstCopy(),
+ &are)) {
return;
}
this->onGpuDraw(info);
@@ -350,7 +352,8 @@
GrAutoTRestore<GrStencilSettings> asr(this->drawState()->stencil());
this->setStencilPathSettings(*path, fill, this->drawState()->stencil());
- if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL)) {
+ GrDrawState::AutoRestoreEffects are;
+ if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are)) {
return;
}