aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrDrawingManager.cpp17
-rw-r--r--src/gpu/GrRenderTargetContext.cpp3
2 files changed, 17 insertions, 3 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index b177a43003..09e43c81d5 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -95,6 +95,23 @@ void GrDrawingManager::internalFlush(GrSurfaceProxy*, GrResourceCache::FlushType
fOpLists[i]->makeClosed(*fContext->caps());
}
+#ifdef SK_DEBUG
+ // This block checks for any unnecessary splits in the opLists. If two sequential opLists
+ // share the same backing GrSurfaceProxy it means the opList was artificially split.
+ if (fOpLists.count()) {
+ GrRenderTargetOpList* prevOpList = fOpLists[0]->asRenderTargetOpList();
+ for (int i = 1; i < fOpLists.count(); ++i) {
+ GrRenderTargetOpList* curOpList = fOpLists[i]->asRenderTargetOpList();
+
+ if (prevOpList && curOpList) {
+ SkASSERT(prevOpList->fTarget.get() != curOpList->fTarget.get());
+ }
+
+ prevOpList = curOpList;
+ }
+ }
+#endif
+
#ifdef ENABLE_MDB
SkDEBUGCODE(bool result =)
SkTTopoSort<GrOpList, GrOpList::TopoSortTraits>(&fOpLists);
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index e58b4bb06e..ffcd480302 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -105,9 +105,6 @@ void GrRenderTargetContext::validate() const {
#endif
GrRenderTargetContext::~GrRenderTargetContext() {
- if (fOpList) {
- fOpList->makeClosed(*this->caps());
- }
ASSERT_SINGLE_OWNER
}