aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetOpList.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-09-14 12:45:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-14 18:42:51 +0000
commitd375dbf1557de71ce8e348e6002463f076cc3967 (patch)
tree7987175183702bb5e8839c272bc4fca37932af02 /src/gpu/GrRenderTargetOpList.cpp
parentd27392f8a43c5efe2fdb40387aa5c03e611dbea4 (diff)
Land scaffolding for explicit MDB resource allocation
Change-Id: I1cb30b50068e99181788181683e82e2421d0038a Reviewed-on: https://skia-review.googlesource.com/46701 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetOpList.cpp')
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index a53a84ca5f..15cb4f16c6 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -12,6 +12,7 @@
#include "GrGpuCommandBuffer.h"
#include "GrRect.h"
#include "GrRenderTargetContext.h"
+#include "GrResourceAllocator.h"
#include "instanced/InstancedRendering.h"
#include "ops/GrClearOp.h"
#include "ops/GrCopySurfaceOp.h"
@@ -252,6 +253,25 @@ bool GrRenderTargetOpList::copySurface(const GrCaps& caps,
return true;
}
+void GrRenderTargetOpList::gatherProxyIntervals(GrResourceAllocator* alloc) const {
+ unsigned int cur = alloc->numOps();
+
+ // Add the interval for all the writes to this opList's target
+ alloc->addInterval(fTarget.get(), cur, cur+fRecordedOps.count()-1);
+
+ auto gather = [ alloc ] (GrSurfaceProxy* p) {
+ alloc->addInterval(p);
+ };
+ for (int i = 0; i < fRecordedOps.count(); ++i) {
+ SkASSERT(alloc->curOp() == cur+i);
+
+ const GrOp* op = fRecordedOps[i].fOp.get(); // only diff from the GrTextureOpList version
+ op->visitProxies(gather);
+
+ alloc->incOps();
+ }
+}
+
static inline bool can_reorder(const SkRect& a, const SkRect& b) { return !GrRectsOverlap(a, b); }
bool GrRenderTargetOpList::combineIfPossible(const RecordedOp& a, GrOp* b,