Allow path renderers to self-identify

This is intended to help debug path renderer chain/selection behavior.

Change-Id: I581c4428c2f0cc586504f904255f88d0d4d5eb53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283220
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index ab61a3a..e29a42c 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -34,6 +34,8 @@
 public:
     GrPathRenderer();
 
+    virtual const char* name() const = 0;
+
     /**
      * A caller may wish to use a path renderer to draw a path into the stencil buffer. However,
      * the path renderer itself may require use of the stencil buffer. Also a path renderer may
diff --git a/src/gpu/GrSoftwarePathRenderer.h b/src/gpu/GrSoftwarePathRenderer.h
index b08c5ed..9337d22 100644
--- a/src/gpu/GrSoftwarePathRenderer.h
+++ b/src/gpu/GrSoftwarePathRenderer.h
@@ -19,6 +19,8 @@
  */
 class GrSoftwarePathRenderer : public GrPathRenderer {
 public:
+    const char* name() const final { return "SW"; }
+
     GrSoftwarePathRenderer(GrProxyProvider* proxyProvider, bool allowCaching)
             : fProxyProvider(proxyProvider)
             , fAllowCaching(allowCaching) {
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index e70a15a..1b86ad0 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -29,6 +29,8 @@
 public:
     using CoverageType = GrCCAtlas::CoverageType;
 
+    const char* name() const final { return "CCPR"; }
+
     static bool IsSupported(const GrCaps&, CoverageType* = nullptr);
 
     enum class AllowCaching : bool {
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.h b/src/gpu/ops/GrAAConvexPathRenderer.h
index b6b01dc..bb69745 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.h
+++ b/src/gpu/ops/GrAAConvexPathRenderer.h
@@ -12,6 +12,8 @@
 
 class GrAAConvexPathRenderer : public GrPathRenderer {
 public:
+    const char* name() const final { return "AAConvex"; }
+
     GrAAConvexPathRenderer();
 
 private:
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.h b/src/gpu/ops/GrAAHairLinePathRenderer.h
index af78faa..c697435 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.h
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.h
@@ -14,6 +14,8 @@
 public:
     GrAAHairLinePathRenderer() {}
 
+    const char* name() const final { return "AAHairline"; }
+
     typedef SkTArray<SkPoint, true> PtArray;
     typedef SkTArray<int, true> IntArray;
     typedef SkTArray<float, true> FloatArray;
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.h b/src/gpu/ops/GrAALinearizingConvexPathRenderer.h
index b86f6fc..c9c895d 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.h
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.h
@@ -12,6 +12,8 @@
 
 class GrAALinearizingConvexPathRenderer : public GrPathRenderer {
 public:
+    const char* name() const final { return "AALinear"; }
+
     GrAALinearizingConvexPathRenderer();
 
 private:
diff --git a/src/gpu/ops/GrDashLinePathRenderer.h b/src/gpu/ops/GrDashLinePathRenderer.h
index 4434242..267eaf8 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.h
+++ b/src/gpu/ops/GrDashLinePathRenderer.h
@@ -14,6 +14,8 @@
 
 class GrDashLinePathRenderer : public GrPathRenderer {
 private:
+    const char* name() const final { return "DashLine"; }
+
     CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
 
     StencilSupport onGetStencilSupport(const GrShape&) const override {
diff --git a/src/gpu/ops/GrDefaultPathRenderer.h b/src/gpu/ops/GrDefaultPathRenderer.h
index 871a8c6..a42061c 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.h
+++ b/src/gpu/ops/GrDefaultPathRenderer.h
@@ -20,6 +20,8 @@
 public:
     GrDefaultPathRenderer();
 
+    const char* name() const final { return "Default"; }
+
 private:
     StencilSupport onGetStencilSupport(const GrShape&) const override;
 
diff --git a/src/gpu/ops/GrSmallPathRenderer.h b/src/gpu/ops/GrSmallPathRenderer.h
index 067e036..a823286 100644
--- a/src/gpu/ops/GrSmallPathRenderer.h
+++ b/src/gpu/ops/GrSmallPathRenderer.h
@@ -30,6 +30,8 @@
     GrSmallPathRenderer();
     ~GrSmallPathRenderer() override;
 
+    const char* name() const final { return "Small"; }
+
     // GrOnFlushCallbackObject overrides
     //
     // Note: because this class is associated with a path renderer we want it to be removed from
diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.h b/src/gpu/ops/GrStencilAndCoverPathRenderer.h
index 755a1b6..74dd490 100644
--- a/src/gpu/ops/GrStencilAndCoverPathRenderer.h
+++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.h
@@ -19,6 +19,7 @@
  */
 class GrStencilAndCoverPathRenderer : public GrPathRenderer {
 public:
+    const char* name() const final { return "NVPR"; }
 
     static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&);
 
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.h b/src/gpu/ops/GrTriangulatingPathRenderer.h
index 7425933..175325b 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.h
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.h
@@ -21,6 +21,8 @@
     void setMaxVerbCount(int maxVerbCount) { fMaxVerbCount = maxVerbCount; }
 #endif
 
+    const char* name() const final { return "Triangulating"; }
+
 private:
     CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
 
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.h b/src/gpu/tessellate/GrTessellationPathRenderer.h
index 41cbe4b..f09aa71 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.h
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.h
@@ -19,6 +19,8 @@
 // target that supports either MSAA or mixed samples if AA is desired.
 class GrTessellationPathRenderer : public GrPathRenderer, public GrOnFlushCallbackObject {
 public:
+    const char* name() const final { return "Tess"; }
+
     GrTessellationPathRenderer(const GrCaps&);
     StencilSupport onGetStencilSupport(const GrShape& shape) const override {
         // TODO: Single-pass (e.g., convex) paths can have full support.