Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: src/gpu/GrDrawState.h

Issue 18295008: Remove possiblity of NULL effect in GrEffectStage (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: wrap line Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrDrawState.h
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 52058f5732e4c9cb6beffc56e4a6a59eb1ea65e9..c4f872608bb818b83d256563602d13b4e75b5d29 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -1024,14 +1024,15 @@ public:
drawState->fCommon = fCommon;
drawState->setRenderTarget(fRenderTarget);
// reinflate color/cov stage arrays.
- drawState->fColorStages.reset(fColorStageCnt);
+ drawState->fColorStages.reset();
for (int i = 0; i < fColorStageCnt; ++i) {
- fStages[i].restoreTo(&drawState->fColorStages[i]);
+ SkNEW_APPEND_TO_TARRAY(&drawState->fColorStages, GrEffectStage, (fStages[i]));
}
int coverageStageCnt = fStages.count() - fColorStageCnt;
- drawState->fCoverageStages.reset(coverageStageCnt);
+ drawState->fCoverageStages.reset();
for (int i = 0; i < coverageStageCnt; ++i) {
- fStages[fColorStageCnt + i].restoreTo(&drawState->fCoverageStages[i]);
+ SkNEW_APPEND_TO_TARRAY(&drawState->fCoverageStages,
+ GrEffectStage, (fStages[i + fColorStageCnt]));
}
}

Powered by Google App Engine
This is Rietveld 408576698