SkStream: DynamicMemoryWStream gets writeToAndReset
authorHal Canary <halcanary@google.com>
Tue, 23 May 2017 15:47:05 +0000 (11:47 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 24 May 2017 19:49:35 +0000 (19:49 +0000)
commit6fee59b514c5f7b7ff34d63b294759dd0c1d4858
tree6bcfede9aabf632d1f3f7fc0cb1f414240645c96
parent14a6430b7bcf92bcabf4aef18805969d1335aab1
SkStream: DynamicMemoryWStream gets writeToAndReset

This is similar to copyToAndReset().

Also use this in SkPDF, for minor memory savings:
Single-threaded DM's peak RSS drops from 239MB
to 228MB.

Change-Id: I352a980e6dd54eb05d74cd057bd50e02312753b0
Reviewed-on: https://skia-review.googlesource.com/17714
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
include/core/SkStream.h
src/core/SkStream.cpp
src/pdf/SkPDFBitmap.cpp
src/pdf/SkPDFTypes.cpp