Manage buffers at the list level only

Now that the painter has moved from a GlyphRun to a GlyphRunList,
handle the buffers at the GlyphRunList level only.

Change-Id: I37416c8b2164bbde207ecab0a77b419775d58e66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538659
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index af3b1aa..500af9a 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -293,9 +293,8 @@
                     positionMatrix[0], positionMatrix[1], positionMatrix[2],
                     positionMatrix[3], positionMatrix[4], positionMatrix[5]);
     #endif
-
+    ScopedBuffers _ = this->ensureBuffers(glyphRunList);
     for (auto& glyphRun : glyphRunList) {
-        ScopedBuffers _ = this->ensureBuffers(glyphRun);
         fRejected.setSource(glyphRun.source());
         const SkFont& runFont = glyphRun.font();
 
@@ -482,10 +481,6 @@
     return ScopedBuffers(this, size);
 }
 
-auto SkGlyphRunListPainter::ensureBuffers(const SkGlyphRun& glyphRun) -> ScopedBuffers {
-    return ScopedBuffers(this, glyphRun.runSize());
-}
-
 SkGlyphRunListPainter::ScopedBuffers::ScopedBuffers(SkGlyphRunListPainter* painter, size_t size)
         : fPainter{painter} {
     fPainter->fAccepted.ensureSize(size);
diff --git a/src/core/SkGlyphRunPainter.h b/src/core/SkGlyphRunPainter.h
index 30307fe..8c7dce9 100644
--- a/src/core/SkGlyphRunPainter.h
+++ b/src/core/SkGlyphRunPainter.h
@@ -104,7 +104,6 @@
     };
 
     ScopedBuffers SK_WARN_UNUSED_RESULT ensureBuffers(const SkGlyphRunList& glyphRunList);
-    ScopedBuffers SK_WARN_UNUSED_RESULT ensureBuffers(const SkGlyphRun& glyphRun);
 
     // The props as on the actual device.
     const SkSurfaceProps fDeviceProps;