Index: src/core/SkStream.cpp |
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp |
index 3350f82fc18c1e26f0e6797145054e9b3f0e2c48..8b4b82af9a6a7cdd55343d969e66382bee0fb75f 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); |
+ } |
} |
//////////////////////////////////////////////////////////////////////// |