Reland "Rename GrStencilAttachment class to generic GrAttachment"

This is a reland of 6113d50ec48be049c13a6e4bbea191df93e68674

Original change's description:
> Rename GrStencilAttachment class to generic GrAttachment
>
> Additional this adds a UsageFlags member to the new GrAttachment
> class.
>
> Bug: skia:10727
> Change-Id: Ifc0bfffd959f5fbc46bfcdf269e1b2a933929753
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323107
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:10727
Change-Id: Ie0ff0885e01c9f0666fb0cfaa765e463dcc6d0a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324277
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index ca62d97..b6aa43c 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -36,7 +36,7 @@
 class GrRingBuffer;
 class GrSemaphore;
 class GrStagingBufferManager;
-class GrStencilAttachment;
+class GrAttachment;
 class GrStencilSettings;
 class GrSurface;
 class GrTexture;
@@ -352,15 +352,14 @@
     // If a 'stencil' is provided it will be the one bound to 'renderTarget'. If one is not
     // provided but 'renderTarget' has a stencil buffer then that is a signal that the
     // render target's stencil buffer should be ignored.
-    virtual GrOpsRenderPass* getOpsRenderPass(
-            GrRenderTarget* renderTarget,
-            GrStencilAttachment* stencil,
-            GrSurfaceOrigin,
-            const SkIRect& bounds,
-            const GrOpsRenderPass::LoadAndStoreInfo&,
-            const GrOpsRenderPass::StencilLoadAndStoreInfo&,
-            const SkTArray<GrSurfaceProxy*, true>& sampledProxies,
-            GrXferBarrierFlags renderPassXferBarriers) = 0;
+    virtual GrOpsRenderPass* getOpsRenderPass(GrRenderTarget* renderTarget,
+                                              GrAttachment* stencil,
+                                              GrSurfaceOrigin,
+                                              const SkIRect& bounds,
+                                              const GrOpsRenderPass::LoadAndStoreInfo&,
+                                              const GrOpsRenderPass::StencilLoadAndStoreInfo&,
+                                              const SkTArray<GrSurfaceProxy*, true>& sampledProxies,
+                                              GrXferBarrierFlags renderPassXferBarriers) = 0;
 
     // Called by GrDrawingManager when flushing.
     // Provides a hook for post-flush actions (e.g. Vulkan command buffer submits). This will also
@@ -708,9 +707,10 @@
 
     // width and height may be larger than rt (if underlying API allows it).
     // Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on
-    // the GrStencilAttachment.
-    virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(
-            const GrRenderTarget*, SkISize dimensions, int numStencilSamples) = 0;
+    // the GrAttachment.
+    virtual sk_sp<GrAttachment> makeStencilAttachmentForRenderTarget(const GrRenderTarget*,
+                                                                     SkISize dimensions,
+                                                                     int numStencilSamples) = 0;
 
     void handleDirtyContext() {
         if (fResetBits) {