Make remaining GrOp derived classes be skgpu::v1 only
I will follow up with a CL actually moving the newly V1-only files to their final homes and adding namespaces.
Bug: skia:11837
Change-Id: I0fed1a802ae93a4357c53cde2b665ad6ddb49a6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index bf034f7..9298588 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -43,8 +43,8 @@
#include "src/gpu/text/GrSDFTControl.h"
#include "src/image/SkSurface_Gpu.h"
-#include "src/gpu/GrOpsTask.h"
#if SK_GPU_V1
+#include "src/gpu/GrOpsTask.h"
#include "src/gpu/GrSoftwarePathRenderer.h"
#endif
@@ -370,7 +370,7 @@
return;
}
-#ifdef SK_DEBUG
+#if SK_GPU_V1 && defined(SK_DEBUG)
// This block checks for any unnecessary splits in the opsTasks. If two sequential opsTasks
// could have merged it means the opsTask was artificially split.
if (!fDAG.empty()) {
@@ -427,6 +427,7 @@
int newCount = 0;
for (int i = 0; i < fDAG.count(); i++) {
sk_sp<GrRenderTask>& task = fDAG[i];
+#if SK_GPU_V1
if (auto opsTask = task->asOpsTask()) {
size_t remaining = fDAG.size() - i - 1;
SkSpan<sk_sp<GrRenderTask>> nextTasks{fDAG.end() - remaining, remaining};
@@ -436,6 +437,7 @@
}
i += removeCount;
}
+#endif
fDAG[newCount++] = std::move(task);
}
fDAG.resize_back(newCount);
@@ -608,6 +610,7 @@
SkIPoint offset) {
SkDEBUGCODE(this->validate());
+#if SK_GPU_V1
if (fActiveOpsTask) {
// This is a temporary fix for the partial-MDB world. In that world we're not
// reordering so ops that (in the single opsTask world) would've just glommed onto the
@@ -616,6 +619,7 @@
fActiveOpsTask->makeClosed(fContext);
fActiveOpsTask = nullptr;
}
+#endif
// Propagate the DDL proxy's state information to the replay target.
if (ddl->priv().targetProxy()->isMSAADirty()) {
@@ -646,6 +650,7 @@
#ifdef SK_DEBUG
void GrDrawingManager::validate() const {
+#if SK_GPU_V1
if (fActiveOpsTask) {
SkASSERT(!fDAG.empty());
SkASSERT(!fActiveOpsTask->isClosed());
@@ -676,10 +681,12 @@
} else {
SkASSERT(fActiveOpsTask == nullptr);
}
+#endif // SK_GPU_V1
}
-#endif
+#endif // SK_DEBUG
void GrDrawingManager::closeActiveOpsTask() {
+#if SK_GPU_V1
if (fActiveOpsTask) {
// This is a temporary fix for the partial-MDB world. In that world we're not
// reordering so ops that (in the single opsTask world) would've just glommed onto the
@@ -688,8 +695,10 @@
fActiveOpsTask->makeClosed(fContext);
fActiveOpsTask = nullptr;
}
+#endif
}
+#if SK_GPU_V1
sk_sp<GrOpsTask> GrDrawingManager::newOpsTask(GrSurfaceProxyView surfaceView,
sk_sp<GrArenas> arenas,
bool flushTimeOpsTask) {
@@ -742,6 +751,7 @@
SkDEBUGCODE(this->validate());
}
+#endif // SK_GPU_V1
GrTextureResolveRenderTask* GrDrawingManager::newTextureResolveRenderTask(const GrCaps& caps) {
// Unlike in the "new opsTask" case, we do not want to close the active opsTask, nor (if we are
@@ -767,6 +777,7 @@
std::move(semaphores),
numSemaphores);
+#if SK_GPU_V1
if (fActiveOpsTask && (fActiveOpsTask->target(0) == proxy.get())) {
SkASSERT(this->getLastRenderTask(proxy.get()) == fActiveOpsTask);
this->insertTaskBeforeLast(waitTask);
@@ -784,7 +795,9 @@
// get a circular self dependency of waitTask on waitTask.
waitTask->addDependenciesFromOtherTask(fActiveOpsTask);
fActiveOpsTask->addDependency(waitTask.get());
- } else {
+ } else
+#endif
+ {
// In this case we just close the previous RenderTask and start and append the waitTask
// to the DAG. Since it is the last task now we call setLastRenderTask on the proxy. If
// there is a lastTask on the proxy we make waitTask depend on that task. This