aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrDrawingManager.cpp3
-rw-r--r--src/gpu/GrOpList.h7
-rw-r--r--src/gpu/GrRenderTargetContext.cpp1
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp5
-rw-r--r--src/gpu/GrRenderTargetOpList.h2
-rw-r--r--src/gpu/GrTextureOpList.cpp8
-rw-r--r--src/gpu/ops/GrCopySurfaceOp.h5
7 files changed, 21 insertions, 10 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index bbcd8a85d9..8d9e238f95 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -11,6 +11,7 @@
#include "GrContext.h"
#include "GrGpu.h"
#include "GrOnFlushResourceProvider.h"
+#include "GrOpList.h"
#include "GrRenderTargetContext.h"
#include "GrPathRenderingRenderTargetContext.h"
#include "GrRenderTargetProxy.h"
@@ -120,7 +121,7 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
}
#endif
-#ifdef ENABLE_MDB
+#ifdef ENABLE_MDB_SORT
SkDEBUGCODE(bool result =)
SkTTopoSort<GrOpList, GrOpList::TopoSortTraits>(&fOpLists);
SkASSERT(result);
diff --git a/src/gpu/GrOpList.h b/src/gpu/GrOpList.h
index ef21a24f46..c801f96375 100644
--- a/src/gpu/GrOpList.h
+++ b/src/gpu/GrOpList.h
@@ -13,7 +13,12 @@
#include "SkRefCnt.h"
#include "SkTDArray.h"
-//#define ENABLE_MDB 1
+
+// Turn on/off the explicit distribution of GPU resources at flush time
+//#define MDB_ALLOC_RESOURCES 1
+
+// Turn on/off the sorting of opLists at flush time
+//#define ENABLE_MDB_SORT 1
class GrAuditTrail;
class GrCaps;
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 4f1ad1279e..cd2d099738 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -15,6 +15,7 @@
#include "GrDrawingManager.h"
#include "GrFixedClip.h"
#include "GrGpuResourcePriv.h"
+#include "GrOpList.h"
#include "GrPathRenderer.h"
#include "GrRenderTarget.h"
#include "GrRenderTargetContextPriv.h"
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 1ae35bf2cc..a53a84ca5f 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -247,11 +247,8 @@ bool GrRenderTargetOpList::copySurface(const GrCaps& caps,
if (!op) {
return false;
}
-#ifdef ENABLE_MDB
- this->addDependency(src);
-#endif
- this->recordOp(std::move(op), caps);
+ this->addOp(std::move(op), caps);
return true;
}
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index d80f667655..55fc904839 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -74,7 +74,7 @@ public:
op->visitProxies(addDependency);
- this->recordOp(std::move(op), caps, nullptr, nullptr);
+ this->recordOp(std::move(op), caps);
return this->uniqueID();
}
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index b046e7c272..e5fbb20bf2 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -98,9 +98,11 @@ bool GrTextureOpList::copySurface(const GrCaps& caps,
if (!op) {
return false;
}
-#ifdef ENABLE_MDB
- this->addDependency(src);
-#endif
+
+ auto addDependency = [ &caps, this ] (GrSurfaceProxy* p) {
+ this->addDependency(p, caps);
+ };
+ op->visitProxies(addDependency);
this->recordOp(std::move(op));
return true;
diff --git a/src/gpu/ops/GrCopySurfaceOp.h b/src/gpu/ops/GrCopySurfaceOp.h
index 57548a8268..7debfcd6a9 100644
--- a/src/gpu/ops/GrCopySurfaceOp.h
+++ b/src/gpu/ops/GrCopySurfaceOp.h
@@ -21,6 +21,11 @@ public:
const char* name() const override { return "CopySurface"; }
+ void visitProxies(VisitProxyFunc func) const override {
+ func(fDst.get());
+ func(fSrc.get());
+ }
+
SkString dumpInfo() const override {
SkString string;
string.append(INHERITED::dumpInfo());