#include "src/gpu/ganesh/GrRenderTask.h"
#include "include/core/SkRect.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "src/gpu/ganesh/GrDrawingManager.h"
#include "src/gpu/ganesh/GrRenderTargetProxy.h"
#include "src/gpu/ganesh/GrSurface.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/GrTextureProxyPriv.h"
#include "src/gpu/ganesh/GrTextureResolveManager.h"
#include "src/gpu/ganesh/GrTextureResolveRenderTask.h"
#include <algorithm>
#include <atomic>
#include <utility>
uint32_t GrRenderTask::CreateUniqueID() { … }
GrRenderTask::GrRenderTask()
: … { … }
void GrRenderTask::disown(GrDrawingManager* drawingMgr) { … }
void GrRenderTask::makeSkippable() { … }
#ifdef SK_DEBUG
GrRenderTask::~GrRenderTask() { … }
bool GrRenderTask::deferredProxiesAreInstantiated() const { … }
#endif
void GrRenderTask::makeClosed(GrRecordingContext* rContext) { … }
void GrRenderTask::prepare(GrOpFlushState* flushState) { … }
void GrRenderTask::addDependency(GrRenderTask* dependedOn) { … }
void GrRenderTask::addDependenciesFromOtherTask(GrRenderTask* otherTask) { … }
void GrRenderTask::addDependency(GrDrawingManager* drawingMgr,
GrSurfaceProxy* dependedOn,
skgpu::Mipmapped mipmapped,
GrTextureResolveManager textureResolveManager,
const GrCaps& caps) { … }
void GrRenderTask::replaceDependency(const GrRenderTask* toReplace, GrRenderTask* replaceWith) { … }
void GrRenderTask::replaceDependent(const GrRenderTask* toReplace, GrRenderTask* replaceWith) { … }
bool GrRenderTask::dependsOn(const GrRenderTask* dependedOn) const { … }
void GrRenderTask::addDependent(GrRenderTask* dependent) { … }
#ifdef SK_DEBUG
bool GrRenderTask::isDependent(const GrRenderTask* dependent) const { … }
void GrRenderTask::validate() const { … }
#endif
bool GrRenderTask::isInstantiated() const { … }
void GrRenderTask::addTarget(GrDrawingManager* drawingMgr, sk_sp<GrSurfaceProxy> proxy) { … }
#if defined(GPU_TEST_UTILS)
void GrRenderTask::dump(const SkString& label,
SkString indent,
bool printDependencies,
bool close) const {
SkDebugf("%s%s --------------------------------------------------------------\n",
indent.c_str(),
label.c_str());
SkDebugf("%s%s task - renderTaskID: %u\n", indent.c_str(), this->name(), fUniqueID);
if (!fTargets.empty()) {
SkDebugf("%sTargets: \n", indent.c_str());
for (const sk_sp<GrSurfaceProxy>& target : fTargets) {
SkASSERT(target);
SkString proxyStr = target->dump();
SkDebugf("%s%s\n", indent.c_str(), proxyStr.c_str());
}
}
if (printDependencies) {
SkDebugf("%sI rely On (%d): ", indent.c_str(), fDependencies.size());
for (int i = 0; i < fDependencies.size(); ++i) {
SkDebugf("%u, ", fDependencies[i]->fUniqueID);
}
SkDebugf("\n");
SkDebugf("%s(%d) Rely On Me: ", indent.c_str(), fDependents.size());
for (int i = 0; i < fDependents.size(); ++i) {
SkDebugf("%u, ", fDependents[i]->fUniqueID);
}
SkDebugf("\n");
}
if (close) {
SkDebugf("%s--------------------------------------------------------------\n\n",
indent.c_str());
}
}
#endif