Index: include/core/SkWriter32.h |
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h |
index df1275f7b656829ad132f7b481508e42b53d99e7..861f41840a309ece96fa275eec5e8d560640e58c 100644 |
--- a/include/core/SkWriter32.h |
+++ b/include/core/SkWriter32.h |
@@ -21,6 +21,8 @@ |
#include "SkTDArray.h" |
#include "SkTypes.h" |
+class SkData; |
+ |
class SkWriter32 : SkNoncopyable { |
public: |
/** |
@@ -31,10 +33,10 @@ public: |
* This used to be optional behavior, but pipe now relies on it. |
*/ |
SkWriter32(void* external = NULL, size_t externalBytes = 0) |
- : fData(0) |
+ : fData(NULL) |
, fCapacity(0) |
, fUsed(0) |
- , fExternal(0) |
+ , fExternal(NULL) |
{ |
this->reset(external, externalBytes); |
} |
@@ -229,6 +231,13 @@ public: |
return stream->read(this->reservePad(length), length); |
} |
+ /** |
+ * Release the internal buffer to the caller in an SkData. |
+ * The caller must call unref() when it is finished using the data. |
+ * This also clears the writer to empty as if you had called reset(). |
+ */ |
+ SkData* detatchAsData(); |
+ |
private: |
void growToAtLeast(size_t size); |