Move GrPathRenderer and GrPathRendererChain to skgpu::v1 namespace
Bug: skia:11837
Change-Id: I42abcd3724ac1e2c71d3bd13ff6295a4683af5e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440261
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/AAConvexPathRenderer.cpp b/src/gpu/ops/AAConvexPathRenderer.cpp
index a71beaa..fde56ce 100644
--- a/src/gpu/ops/AAConvexPathRenderer.cpp
+++ b/src/gpu/ops/AAConvexPathRenderer.cpp
@@ -910,7 +910,7 @@
namespace skgpu::v1 {
-GrPathRenderer::CanDrawPath AAConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath AAConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
// This check requires convexity and known direction, since the direction is used to build
// the geometry segments. Degenerate convex paths will fall through to some other path renderer.
if (args.fCaps->shaderCaps()->shaderDerivativeSupport() &&
diff --git a/src/gpu/ops/AAConvexPathRenderer.h b/src/gpu/ops/AAConvexPathRenderer.h
index 6963fd6..5acaa0e 100644
--- a/src/gpu/ops/AAConvexPathRenderer.h
+++ b/src/gpu/ops/AAConvexPathRenderer.h
@@ -8,11 +8,11 @@
#ifndef AAConvexPathRenderer_DEFINED
#define AAConvexPathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
namespace skgpu::v1 {
-class AAConvexPathRenderer final : public GrPathRenderer {
+class AAConvexPathRenderer final : public PathRenderer {
public:
AAConvexPathRenderer() = default;
@@ -22,8 +22,6 @@
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bool onDrawPath(const DrawPathArgs&) override;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/AAHairLinePathRenderer.cpp b/src/gpu/ops/AAHairLinePathRenderer.cpp
index 1643b8e..a008e87 100644
--- a/src/gpu/ops/AAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/AAHairLinePathRenderer.cpp
@@ -1285,8 +1285,7 @@
namespace skgpu::v1 {
-GrPathRenderer::CanDrawPath
-AAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath AAHairLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
if (GrAAType::kCoverage != args.fAAType) {
return CanDrawPath::kNo;
}
diff --git a/src/gpu/ops/AAHairLinePathRenderer.h b/src/gpu/ops/AAHairLinePathRenderer.h
index 39c5646..9d69e40 100644
--- a/src/gpu/ops/AAHairLinePathRenderer.h
+++ b/src/gpu/ops/AAHairLinePathRenderer.h
@@ -8,11 +8,11 @@
#ifndef AAHairLinePathRenderer_DEFINED
#define AAHairLinePathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
namespace skgpu::v1 {
-class AAHairLinePathRenderer final : public GrPathRenderer {
+class AAHairLinePathRenderer final : public PathRenderer {
public:
AAHairLinePathRenderer() = default;
@@ -22,8 +22,6 @@
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bool onDrawPath(const DrawPathArgs&) override;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/AALinearizingConvexPathRenderer.cpp b/src/gpu/ops/AALinearizingConvexPathRenderer.cpp
index 19e7c4e..584d7e6 100644
--- a/src/gpu/ops/AALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/AALinearizingConvexPathRenderer.cpp
@@ -375,7 +375,7 @@
namespace skgpu::v1 {
-GrPathRenderer::CanDrawPath
+PathRenderer::CanDrawPath
AALinearizingConvexPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
if (GrAAType::kCoverage != args.fAAType) {
return CanDrawPath::kNo;
diff --git a/src/gpu/ops/AALinearizingConvexPathRenderer.h b/src/gpu/ops/AALinearizingConvexPathRenderer.h
index b047087..cd0a871 100644
--- a/src/gpu/ops/AALinearizingConvexPathRenderer.h
+++ b/src/gpu/ops/AALinearizingConvexPathRenderer.h
@@ -8,11 +8,11 @@
#ifndef AALinearizingConvexPathRenderer_DEFINED
#define AALinearizingConvexPathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
namespace skgpu::v1 {
-class AALinearizingConvexPathRenderer final : public GrPathRenderer {
+class AALinearizingConvexPathRenderer final : public PathRenderer {
public:
AALinearizingConvexPathRenderer() = default;
@@ -22,8 +22,6 @@
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bool onDrawPath(const DrawPathArgs&) override;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/AtlasPathRenderer.cpp b/src/gpu/ops/AtlasPathRenderer.cpp
index a52db9a..88e5f85 100644
--- a/src/gpu/ops/AtlasPathRenderer.cpp
+++ b/src/gpu/ops/AtlasPathRenderer.cpp
@@ -254,7 +254,7 @@
return true;
}
-GrPathRenderer::CanDrawPath AtlasPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath AtlasPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
#ifdef SK_DEBUG
if (!fAtlasRenderTasks.empty()) {
// args.fPaint should NEVER reference our current atlas. If it does, it means somebody
diff --git a/src/gpu/ops/AtlasPathRenderer.h b/src/gpu/ops/AtlasPathRenderer.h
index b9a0cfe..026b7b1 100644
--- a/src/gpu/ops/AtlasPathRenderer.h
+++ b/src/gpu/ops/AtlasPathRenderer.h
@@ -14,7 +14,7 @@
#include "src/gpu/GrDynamicAtlas.h"
#include "src/gpu/GrFragmentProcessor.h"
#include "src/gpu/GrOnFlushResourceProvider.h"
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
class GrAtlasRenderTask;
class GrOp;
@@ -23,7 +23,7 @@
namespace skgpu::v1 {
// Draws paths by first rendering their coverage mask into an offscreen atlas.
-class AtlasPathRenderer final : public GrPathRenderer, public GrOnFlushCallbackObject {
+class AtlasPathRenderer final : public PathRenderer, public GrOnFlushCallbackObject {
public:
static bool IsSupported(GrRecordingContext*);
diff --git a/src/gpu/ops/DashLinePathRenderer.cpp b/src/gpu/ops/DashLinePathRenderer.cpp
index 27992aa..d9e51125 100644
--- a/src/gpu/ops/DashLinePathRenderer.cpp
+++ b/src/gpu/ops/DashLinePathRenderer.cpp
@@ -16,7 +16,7 @@
namespace skgpu::v1 {
-GrPathRenderer::CanDrawPath DashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath DashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
SkPoint pts[2];
bool inverted;
if (args.fShape->style().isDashed() && args.fShape->asLine(pts, &inverted)) {
diff --git a/src/gpu/ops/DashLinePathRenderer.h b/src/gpu/ops/DashLinePathRenderer.h
index ef4a885..fa1134b 100644
--- a/src/gpu/ops/DashLinePathRenderer.h
+++ b/src/gpu/ops/DashLinePathRenderer.h
@@ -8,13 +8,13 @@
#ifndef DashLinePathRenderer_DEFINED
#define DashLinePathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
class GrGpu;
namespace skgpu::v1 {
-class DashLinePathRenderer final : public GrPathRenderer {
+class DashLinePathRenderer final : public PathRenderer {
public:
DashLinePathRenderer() = default;
@@ -30,8 +30,6 @@
bool onDrawPath(const DrawPathArgs&) override;
sk_sp<GrGpu> fGpu;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/DefaultPathRenderer.cpp b/src/gpu/ops/DefaultPathRenderer.cpp
index 2f69421..dcb9112 100644
--- a/src/gpu/ops/DefaultPathRenderer.cpp
+++ b/src/gpu/ops/DefaultPathRenderer.cpp
@@ -27,6 +27,7 @@
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
+#include "src/gpu/ops/GrPathStencilSettings.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
#include "src/gpu/v1/SurfaceDrawContext_v1.h"
@@ -759,16 +760,16 @@
}
-GrPathRenderer::StencilSupport
+PathRenderer::StencilSupport
DefaultPathRenderer::onGetStencilSupport(const GrStyledShape& shape) const {
if (single_pass_shape(shape)) {
- return GrPathRenderer::kNoRestriction_StencilSupport;
+ return kNoRestriction_StencilSupport;
} else {
- return GrPathRenderer::kStencilOnly_StencilSupport;
+ return kStencilOnly_StencilSupport;
}
}
-GrPathRenderer::CanDrawPath DefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath DefaultPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
bool isHairline = GrIsStrokeHairlineOrEquivalent(
args.fShape->style(), *args.fViewMatrix, nullptr);
// If we aren't a single_pass_shape or hairline, we require stencil buffers.
diff --git a/src/gpu/ops/DefaultPathRenderer.h b/src/gpu/ops/DefaultPathRenderer.h
index 974c3dd..afbe17f 100644
--- a/src/gpu/ops/DefaultPathRenderer.h
+++ b/src/gpu/ops/DefaultPathRenderer.h
@@ -8,9 +8,7 @@
#ifndef DefaultPathRenderer_DEFINED
#define DefaultPathRenderer_DEFINED
-#include "include/core/SkTypes.h"
-#include "src/gpu/GrPathRenderer.h"
-#include "src/gpu/ops/GrPathStencilSettings.h"
+#include "src/gpu/v1/PathRenderer.h"
namespace skgpu::v1 {
@@ -18,7 +16,7 @@
* Subclass that renders the path using the stencil buffer to resolve fill rules
* (e.g. winding, even-odd)
*/
-class DefaultPathRenderer final : public GrPathRenderer {
+class DefaultPathRenderer final : public PathRenderer {
public:
DefaultPathRenderer() = default;
@@ -33,7 +31,7 @@
void onStencilPath(const StencilPathArgs&) override;
- bool internalDrawPath(skgpu::v1::SurfaceDrawContext*,
+ bool internalDrawPath(SurfaceDrawContext*,
GrPaint&&,
GrAAType,
const GrUserStencilSettings&,
@@ -41,8 +39,6 @@
const SkMatrix& viewMatrix,
const GrStyledShape&,
bool stencilOnly);
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/SmallPathRenderer.cpp b/src/gpu/ops/SmallPathRenderer.cpp
index a8b8f3b..bc3c8c7 100644
--- a/src/gpu/ops/SmallPathRenderer.cpp
+++ b/src/gpu/ops/SmallPathRenderer.cpp
@@ -668,7 +668,7 @@
namespace skgpu::v1 {
-GrPathRenderer::CanDrawPath SmallPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath SmallPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
if (!args.fCaps->shaderCaps()->shaderDerivativeSupport()) {
return CanDrawPath::kNo;
}
diff --git a/src/gpu/ops/SmallPathRenderer.h b/src/gpu/ops/SmallPathRenderer.h
index cb93b34..09a359f 100644
--- a/src/gpu/ops/SmallPathRenderer.h
+++ b/src/gpu/ops/SmallPathRenderer.h
@@ -8,15 +8,13 @@
#ifndef SmallPathRenderer_DEFINED
#define SmallPathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
-class GrDrawOp;
-class GrRecordingContext;
class GrStyledShape;
namespace skgpu::v1 {
-class SmallPathRenderer final : public GrPathRenderer {
+class SmallPathRenderer final : public PathRenderer {
public:
SmallPathRenderer() = default;
@@ -24,14 +22,12 @@
private:
StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
- return GrPathRenderer::kNoSupport_StencilSupport;
+ return PathRenderer::kNoSupport_StencilSupport;
}
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bool onDrawPath(const DrawPathArgs&) override;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/SoftwarePathRenderer.cpp b/src/gpu/ops/SoftwarePathRenderer.cpp
index 9c8b8a6..b2270c7 100644
--- a/src/gpu/ops/SoftwarePathRenderer.cpp
+++ b/src/gpu/ops/SoftwarePathRenderer.cpp
@@ -104,7 +104,7 @@
namespace skgpu::v1 {
////////////////////////////////////////////////////////////////////////////////
-GrPathRenderer::CanDrawPath SoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath SoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
// Pass on any style that applies. The caller will apply the style if a suitable renderer is
// not found and try again with the new GrStyledShape.
if (!args.fShape->style().applies() && SkToBool(fProxyProvider) &&
diff --git a/src/gpu/ops/SoftwarePathRenderer.h b/src/gpu/ops/SoftwarePathRenderer.h
index 169bcdd..de1dc8c 100644
--- a/src/gpu/ops/SoftwarePathRenderer.h
+++ b/src/gpu/ops/SoftwarePathRenderer.h
@@ -8,8 +8,8 @@
#ifndef SoftwarePathRenderer_DEFINED
#define SoftwarePathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
#include "src/gpu/GrSurfaceProxyView.h"
+#include "src/gpu/v1/PathRenderer.h"
class GrProxyProvider;
@@ -19,7 +19,7 @@
* This class uses the software side to render a path to an SkBitmap and
* then uploads the result to the gpu
*/
-class SoftwarePathRenderer final : public GrPathRenderer {
+class SoftwarePathRenderer final : public PathRenderer {
public:
const char* name() const override { return "SW"; }
@@ -65,7 +65,7 @@
const SkIRect& deviceSpaceRectToDraw);
StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
- return GrPathRenderer::kNoSupport_StencilSupport;
+ return PathRenderer::kNoSupport_StencilSupport;
}
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
@@ -75,8 +75,6 @@
private:
GrProxyProvider* fProxyProvider;
bool fAllowCaching;
-
- using INHERITED = GrPathRenderer;
};
} // namespace skgpu::v1
diff --git a/src/gpu/ops/TriangulatingPathRenderer.cpp b/src/gpu/ops/TriangulatingPathRenderer.cpp
index 15e450f..c958f00 100644
--- a/src/gpu/ops/TriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/TriangulatingPathRenderer.cpp
@@ -572,8 +572,9 @@
: fMaxVerbCount(GR_AA_TESSELLATOR_MAX_VERB_COUNT) {
}
-GrPathRenderer::CanDrawPath
-TriangulatingPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
+PathRenderer::CanDrawPath TriangulatingPathRenderer::onCanDrawPath(
+ const CanDrawPathArgs& args) const {
+
// Don't use this path renderer with dynamic MSAA. DMSAA tries to not rely on caching.
if (args.fSurfaceProps->flags() & SkSurfaceProps::kDynamicMSAA_Flag) {
return CanDrawPath::kNo;
diff --git a/src/gpu/ops/TriangulatingPathRenderer.h b/src/gpu/ops/TriangulatingPathRenderer.h
index db73792..93d3fce 100644
--- a/src/gpu/ops/TriangulatingPathRenderer.h
+++ b/src/gpu/ops/TriangulatingPathRenderer.h
@@ -8,7 +8,7 @@
#ifndef TriangulatingPathRenderer_DEFINED
#define TriangulatingPathRenderer_DEFINED
-#include "src/gpu/GrPathRenderer.h"
+#include "src/gpu/v1/PathRenderer.h"
namespace skgpu::v1 {
@@ -16,7 +16,7 @@
* Subclass that renders the path by converting to screen-space trapezoids plus
* extra 1-pixel geometry for AA.
*/
-class TriangulatingPathRenderer final : public GrPathRenderer {
+class TriangulatingPathRenderer final : public PathRenderer {
public:
TriangulatingPathRenderer();
#if GR_TEST_UTILS