chromium/third_party/skia/src/gpu/ganesh/GrDDLTask.cpp

/*
 * Copyright 2020 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "src/gpu/ganesh/GrDDLTask.h"

#include "include/core/SkString.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTArray.h"
#include "include/private/chromium/GrDeferredDisplayList.h"
#include "src/gpu/ganesh/GrDeferredDisplayListPriv.h"
#include "src/gpu/ganesh/GrDrawingManager.h"
#include "src/gpu/ganesh/GrRenderTargetProxy.h"
#include "src/gpu/ganesh/GrResourceAllocator.h"

#include <utility>

class GrOpFlushState;
class GrRecordingContext;
class GrSurfaceProxy;
struct SkIRect;

GrDDLTask::GrDDLTask(GrDrawingManager* drawingMgr,
                     sk_sp<GrRenderTargetProxy> ddlTarget,
                     sk_sp<const GrDeferredDisplayList> ddl)
        :{}

GrDDLTask::~GrDDLTask() {}

void GrDDLTask::endFlush(GrDrawingManager* drawingManager) {}

void GrDDLTask::disown(GrDrawingManager* drawingManager) {}

bool GrDDLTask::onIsUsed(GrSurfaceProxy* proxy) const {}

void GrDDLTask::gatherProxyIntervals(GrResourceAllocator* alloc) const {}

GrRenderTask::ExpectedOutcome GrDDLTask::onMakeClosed(GrRecordingContext*,
                                                      SkIRect* targetUpdateBounds) {}

void GrDDLTask::onPrepare(GrOpFlushState* flushState) {}

bool GrDDLTask::onExecute(GrOpFlushState* flushState) {}

#if defined(GPU_TEST_UTILS)
void GrDDLTask::dump(const SkString& label,
                     SkString indent,
                     bool printDependencies,
                     bool close) const {
    INHERITED::dump(label, indent, printDependencies, false);

    SkDebugf("%sDDL Target: ", indent.c_str());
    if (fDDLTarget) {
        SkString proxyStr = fDDLTarget->dump();
        SkDebugf("%s", proxyStr.c_str());
    }
    SkDebugf("\n");

    SkDebugf("%s%d sub-tasks\n", indent.c_str(), fDDL->priv().numRenderTasks());

    SkString subIndent(indent);
    subIndent.append("    ");

    int index = 0;
    for (auto& task : fDDL->priv().renderTasks()) {
        SkString subLabel;
        subLabel.printf("sub-task %d/%d", index++, fDDL->priv().numRenderTasks());
        task->dump(subLabel, subIndent, printDependencies, true);
    }

    if (close) {
        SkDebugf("%s--------------------------------------------------------------\n\n",
                 indent.c_str());
    }
}
#endif