diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkStream.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp index 3350f82fc1..8b4b82af9a 100644 --- a/src/core/SkStream.cpp +++ b/src/core/SkStream.cpp @@ -433,14 +433,20 @@ SkFILEWStream::SkFILEWStream(const char path[]) SkFILEWStream::~SkFILEWStream() { - if (fFILE) + if (fFILE) { sk_fclose(fFILE); + } +} + +size_t SkFILEWStream::bytesWritten() const { + return sk_ftell(fFILE); } bool SkFILEWStream::write(const void* buffer, size_t size) { - if (fFILE == NULL) + if (fFILE == NULL) { return false; + } if (sk_fwrite(buffer, size, fFILE) != size) { @@ -454,8 +460,9 @@ bool SkFILEWStream::write(const void* buffer, size_t size) void SkFILEWStream::flush() { - if (fFILE) + if (fFILE) { sk_fflush(fFILE); + } } //////////////////////////////////////////////////////////////////////// |