Make GrCopySurfaceOp participate in the GrOplist DAG

Change-Id: Ic72884c8447ad950a91a2afe9566dd5a92dd6f11
Reviewed-on: https://skia-review.googlesource.com/46582
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2017-09-14 10:56:45 -04:00 committed by Skia Commit-Bot
parent d0530ba8f4
commit 9d6c64f29a
7 changed files with 21 additions and 10 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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"

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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;

View File

@ -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());