add explicit API to know if the writebuffer is using its external storage

To help with https://skia-review.googlesource.com/c/skia/+/114262

Bug: skia:
Change-Id: I83fcccdec0dbaef28d0e557ea6fb9bd0ed59ed44
Reviewed-on: https://skia-review.googlesource.com/114284
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/src/core/SkWriteBuffer.h b/src/core/SkWriteBuffer.h
index 82691b3..c3d6f57 100644
--- a/src/core/SkWriteBuffer.h
+++ b/src/core/SkWriteBuffer.h
@@ -92,6 +92,10 @@
 
     size_t bytesWritten() const { return fWriter.bytesWritten(); }
 
+    // Returns true iff all of the bytes written so far are stored in the initial storage
+    // buffer provided in the constructor or the most recent call to reset.
+    bool usingInitialStorage() const;
+
     void writeByteArray(const void* data, size_t size) override;
     void writeBool(bool value) override;
     void writeScalar(SkScalar value) override;