aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkStream.h
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-03-14 15:52:12 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-15 12:54:49 +0000
commitdabe8acb7f89806dc6808d3ce913dc3d190c7e81 (patch)
treecfee448aacc53c700eede1d39c664614d3f5a19e /include/core/SkStream.h
parent63954c9944a5eed4527e0ed368f4e501faf2c625 (diff)
SkDynamicMemoryWStream::detachAsData more memory efficent
I did some testing with very large datasets, and the difference in max RSS is measurable and significant. Change-Id: I6bb2f795d5b4f6ebdba42c3089dc85a278355d48 Reviewed-on: https://skia-review.googlesource.com/9686 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include/core/SkStream.h')
-rw-r--r--include/core/SkStream.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 10929a8343..8df59afaf3 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -376,6 +376,9 @@ public:
void copyTo(void* dst) const;
void writeToStream(SkWStream* dst) const;
+ /** Equivalent to copyTo() followed by reset(), but may save memory use. */
+ void copyToAndReset(void* dst);
+
/** Return the contents as SkData, and then reset the stream. */
sk_sp<SkData> detachAsData();