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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrFontAtlasSizes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrFontAtlasSizes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698