Index: src/gpu/GrRenderTarget.cpp |
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp |
index 75477021cf14330a9fc367676e7e5c609f619db3..ad56cf761fff6e62afc5380d2532d9c82af48708 100644 |
--- a/src/gpu/GrRenderTarget.cpp |
+++ b/src/gpu/GrRenderTarget.cpp |
@@ -15,13 +15,6 @@ |
#include "GrGpu.h" |
#include "GrRenderTargetPriv.h" |
#include "GrStencilAttachment.h" |
- |
-GrRenderTarget::~GrRenderTarget() { |
- if (fLastDrawTarget) { |
- fLastDrawTarget->clearRT(); |
- } |
- SkSafeUnref(fLastDrawTarget); |
-} |
void GrRenderTarget::discard() { |
// go through context so that all necessary flushing occurs |
@@ -64,26 +57,24 @@ |
void GrRenderTarget::onRelease() { |
SkSafeSetNull(fStencilAttachment); |
+ fLastDrawTarget = nullptr; |
INHERITED::onRelease(); |
} |
void GrRenderTarget::onAbandon() { |
SkSafeSetNull(fStencilAttachment); |
+ fLastDrawTarget = nullptr; |
INHERITED::onAbandon(); |
} |
void GrRenderTarget::setLastDrawTarget(GrDrawTarget* dt) { |
if (fLastDrawTarget) { |
- // The non-MDB world never closes so we can't check this condition |
-#ifdef ENABLE_MDB |
SkASSERT(fLastDrawTarget->isClosed()); |
-#endif |
- fLastDrawTarget->clearRT(); |
} |
- SkRefCnt_SafeAssign(fLastDrawTarget, dt); |
+ fLastDrawTarget = dt; |
} |
/////////////////////////////////////////////////////////////////////////////// |