aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkWriter32.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/SkWriter32.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/SkWriter32.h')
-rw-r--r--src/core/SkWriter32.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkWriter32.h b/src/core/SkWriter32.h
index e81178d47e..1e004a8b1d 100644
--- a/src/core/SkWriter32.h
+++ b/src/core/SkWriter32.h
@@ -39,6 +39,10 @@ public:
// return the current offset (will always be a multiple of 4)
size_t bytesWritten() const { return fUsed; }
+ // 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 { return fData == fExternal; }
+
SK_ATTR_DEPRECATED("use bytesWritten")
size_t size() const { return this->bytesWritten(); }