Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms.
BUG=skia:2889
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/542723004
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 4834811..ffec662 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -69,7 +69,9 @@
GrDrawState& GrDrawState::operator=(const GrDrawState& that) {
SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numTotalStages());
- this->setRenderTarget(that.fRenderTarget.get());
+ SkASSERT(!that.fRenderTarget.ownsPendingIO());
+ SkASSERT(!this->fRenderTarget.ownsPendingIO());
+ this->setRenderTarget(that.getRenderTarget());
fColor = that.fColor;
fViewMatrix = that.fViewMatrix;
fSrcBlend = that.fSrcBlend;
@@ -103,11 +105,13 @@
void GrDrawState::onReset(const SkMatrix* initialViewMatrix) {
SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numTotalStages());
+ SkASSERT(!fRenderTarget.ownsPendingIO());
+
fGeometryProcessor.reset(NULL);
fColorStages.reset();
fCoverageStages.reset();
- fRenderTarget.reset(NULL);
+ fRenderTarget.reset();
this->setDefaultVertexAttribs();
@@ -609,4 +613,3 @@
return SkToBool(fBlendOptFlags & (GrRODrawState::kEmitTransBlack_BlendOptFlag |
GrRODrawState::kEmitCoverage_BlendOptFlag));
}
-