Add helper to determine the index buffer that will be used

This CL doesn't use the new VertexSpec member variable but should clarify the path forward (i.e., we will determine the index buffer option at characterize time and enforce that decision at onPrepare time for all the meshes).

This also refactors the GrTextureOp::characterize call.

Change-Id: I7010385abf5a462c12fd47e314aad893bca85fb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251002
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp
index 560adc0..3cba262 100644
--- a/src/gpu/ops/GrFillRectOp.cpp
+++ b/src/gpu/ops/GrFillRectOp.cpp
@@ -192,9 +192,12 @@
         using Domain = GrQuadPerEdgeAA::Domain;
         static constexpr SkRect kEmptyDomain = SkRect::MakeEmpty();
 
+        auto indexBufferOption = GrQuadPerEdgeAA::CalcIndexBufferOption(fHelper.aaType(),
+                                                                        fQuads.count());
+
         VertexSpec vertexSpec(fQuads.deviceQuadType(), fColorType, fQuads.localQuadType(),
                               fHelper.usesLocalCoords(), Domain::kNo, fHelper.aaType(),
-                              fHelper.compatibleWithCoverageAsAlpha());
+                              fHelper.compatibleWithCoverageAsAlpha(), indexBufferOption);
         // Make sure that if the op thought it was a solid color, the vertex spec does not use
         // local coords.
         SkASSERT(!fHelper.isTrivial() || !fHelper.usesLocalCoords());