Make GrPathRenderer and all derived class be OGA-only
Bug: skia:11837
Change-Id: I92aacf8b412d0158036a5f27aa767590e426bd5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417657
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 2c2d3e3..d5b73c9 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -30,7 +30,6 @@
#include "src/gpu/GrRenderTaskCluster.h"
#include "src/gpu/GrResourceAllocator.h"
#include "src/gpu/GrResourceProvider.h"
-#include "src/gpu/GrSoftwarePathRenderer.h"
#include "src/gpu/GrSurfaceContext.h"
#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
@@ -47,16 +46,30 @@
#include "src/gpu/text/GrSDFTControl.h"
#include "src/image/SkSurface_Gpu.h"
+#if GR_OGA
+#include "src/gpu/GrSoftwarePathRenderer.h"
+#endif
+
///////////////////////////////////////////////////////////////////////////////////////////////////
-GrDrawingManager::GrDrawingManager(GrRecordingContext* context,
+#if GR_OGA
+GrDrawingManager::GrDrawingManager(GrRecordingContext* rContext,
const GrPathRendererChain::Options& optionsForPathRendererChain,
bool reduceOpsTaskSplitting)
- : fContext(context)
+ : fContext(rContext)
, fOptionsForPathRendererChain(optionsForPathRendererChain)
, fPathRendererChain(nullptr)
, fSoftwarePathRenderer(nullptr)
- , fFlushing(false)
- , fReduceOpsTaskSplitting(reduceOpsTaskSplitting) { }
+ , fReduceOpsTaskSplitting(reduceOpsTaskSplitting) {
+}
+
+#else
+
+GrDrawingManager::GrDrawingManager(GrRecordingContext* rContext, bool reduceOpsTaskSplitting)
+ : fContext(rContext)
+ , fReduceOpsTaskSplitting(reduceOpsTaskSplitting) {
+}
+
+#endif
GrDrawingManager::~GrDrawingManager() {
this->closeAllTasks();
@@ -75,9 +88,11 @@
}
}
+#if GR_OGA
// a path renderer may be holding onto resources
fPathRendererChain = nullptr;
fSoftwarePathRenderer = nullptr;
+#endif
}
// MDB TODO: make use of the 'proxies' parameter.
@@ -586,11 +601,13 @@
fContext->priv().detachProgramData(&ddl->fProgramData);
+#if GR_OGA
if (fPathRendererChain) {
if (auto ccpr = fPathRendererChain->getCoverageCountingPathRenderer()) {
ddl->fPendingPaths = ccpr->detachPendingPaths();
}
}
+#endif
SkDEBUGCODE(this->validate());
}
@@ -626,11 +643,13 @@
// The lazy proxy that references it (in the DDL opsTasks) will then steal its GrTexture.
ddl->fLazyProxyData->fReplayDest = newDest.get();
+#if GR_OGA
if (ddl->fPendingPaths.size()) {
GrCoverageCountingPathRenderer* ccpr = this->getCoverageCountingPathRenderer();
ccpr->mergePendingPaths(ddl->fPendingPaths);
}
+#endif
// Add a task to handle drawing and lifetime management of the DDL.
SkDEBUGCODE(auto ddlTask =) this->appendTask(sk_make_sp<GrDDLTask>(this,
@@ -878,6 +897,7 @@
return true;
}
+#if GR_OGA
/*
* This method finds a path renderer that can draw the specified path on
* the provided target.
@@ -936,6 +956,8 @@
return fPathRendererChain->getTessellationPathRenderer();
}
+#endif // GR_OGA
+
void GrDrawingManager::flushIfNecessary() {
auto direct = fContext->asDirectContext();
if (!direct) {