Index: src/gpu/GrDrawingManager.cpp |
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp |
index 74459daa48b0514fe51d599bedd960cf7c7a2bc2..c33b4460752917c6283e39ca5790ce01ad54e1ea 100644 |
--- a/src/gpu/GrDrawingManager.cpp |
+++ b/src/gpu/GrDrawingManager.cpp |
@@ -5,6 +5,8 @@ |
* found in the LICENSE file. |
*/ |
+#define ENABLE_MDB 1 |
+ |
#include "GrAtlasTextContext.h" |
#include "GrDrawContext.h" |
#include "GrDrawingManager.h" |
@@ -14,10 +16,10 @@ |
#include "GrStencilAndCoverTextContext.h" |
#include "SkTTopoSort.h" |
-//#define ENABLE_MDB 1 |
- |
void GrDrawingManager::cleanup() { |
for (int i = 0; i < fDrawTargets.count(); ++i) { |
+ fDrawTargets[i]->makeClosed(); // no drawTarget should receive a new command after this |
+ fDrawTargets[i]->clearRT(); |
fDrawTargets[i]->unref(); |
} |
@@ -74,6 +76,8 @@ void GrDrawingManager::flush() { |
for (int i = 0; i < fDrawTargets.count(); ++i) { |
fDrawTargets[i]->prepareBatches(&fFlushState); |
+ // this causes an assert to fire |
+// fDrawTargets[i]->unref(); |
} |
// Upload all data to the GPU |
@@ -83,7 +87,7 @@ void GrDrawingManager::flush() { |
fDrawTargets[i]->drawBatches(&fFlushState); |
} |
- SkASSERT(fFlushState.lastFlushedToken() == fFlushState.currentToken()); |
+ SkASSERT(fFlushState.lastFlushedToken() == fFlushState.currentToken2()); |
#ifndef ENABLE_MDB |
// When MDB is disabled we keep reusing the same drawTarget |
@@ -97,6 +101,7 @@ void GrDrawingManager::flush() { |
fDrawTargets[i]->reset(); |
} |
fFlushState.reset(); |
+ fDrawTargets.reset(); |
} |
GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props, |