Index: include/core/SkStream.h |
diff --git a/include/core/SkStream.h b/include/core/SkStream.h |
index 4502416fd964e5c24134d6a721df393ee08c3efe..e311a4ac4991d8b511b8b43f2a39ff8079ac05ec 100644 |
--- a/include/core/SkStream.h |
+++ b/include/core/SkStream.h |
@@ -8,11 +8,10 @@ |
#ifndef SkStream_DEFINED |
#define SkStream_DEFINED |
+#include "SkData.h" |
#include "SkRefCnt.h" |
#include "SkScalar.h" |
-class SkData; |
- |
class SkStream; |
class SkStreamRewindable; |
class SkStreamSeekable; |
@@ -270,11 +269,11 @@ public: |
const void* getMemoryBase() override; |
private: |
- FILE* fFILE; |
+ FILE* fFILE; |
SkString fName; |
Ownership fOwnership; |
// fData is lazilly initialized when needed. |
- mutable SkAutoTUnref<SkData> fData; |
+ mutable sk_sp<SkData> fData; |
typedef SkStreamAsset INHERITED; |
}; |
@@ -291,10 +290,12 @@ public: |
/** Use the specified data as the memory for this stream. |
* The stream will call ref() on the data (assuming it is not NULL). |
+ * DEPRECATED |
*/ |
SkMemoryStream(SkData*); |
- virtual ~SkMemoryStream(); |
+ /** Creates the stream to read from the specified data */ |
+ SkMemoryStream(sk_sp<SkData>); |
/** Resets the stream to the specified data and length, |
just like the constructor. |
@@ -341,8 +342,8 @@ public: |
const void* getMemoryBase() override; |
private: |
- SkData* fData; |
- size_t fOffset; |
+ sk_sp<SkData> fData; |
+ size_t fOffset; |
typedef SkStreamMemory INHERITED; |
}; |
@@ -417,7 +418,7 @@ private: |
Block* fHead; |
Block* fTail; |
size_t fBytesWritten; |
- mutable SkData* fCopy; // is invalidated if we write after it is created |
+ mutable sk_sp<SkData> fCopy; // is invalidated if we write after it is created |
void invalidateCopy(); |