aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkWriteBuffer.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-03-14 09:52:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-14 14:20:42 +0000
commit253258419b01675a43a80f5f04eb1013d9f2b6d5 (patch)
tree91aa67afc11651dc2b8a2bb4f09518e61c4edd88 /src/core/SkWriteBuffer.h
parent7d2b16ad13fd3262c776ae75ae35da4ad69df690 (diff)
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>
Diffstat (limited to 'src/core/SkWriteBuffer.h')
-rw-r--r--src/core/SkWriteBuffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkWriteBuffer.h b/src/core/SkWriteBuffer.h
index 82691b3c49..c3d6f570bf 100644
--- a/src/core/SkWriteBuffer.h
+++ b/src/core/SkWriteBuffer.h
@@ -92,6 +92,10 @@ public:
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;