aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-09-15 21:39:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-16 02:04:23 +0000
commit98c5d92ee60f6d395f9591891922aa9852a497ee (patch)
tree239001c6ffe06559fd7425ba1549f30d9cbc1c37 /include/utils
parent7e4e99386fe6e7bf131ba8461dcb1990bf15e346 (diff)
Revert "Revert "use unique_ptr for stream api""
This reverts commit 7031b247c9fe0cb8fa32129f9bc24fea2043cee2. Bug: skia: Change-Id: I24c34bbee703f02994be8e206bcb9c10b5427d84 Reviewed-on: https://skia-review.googlesource.com/47541 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/SkFrontBufferedStream.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/utils/SkFrontBufferedStream.h b/include/utils/SkFrontBufferedStream.h
index 3532fc5259..a47acf8a06 100644
--- a/include/utils/SkFrontBufferedStream.h
+++ b/include/utils/SkFrontBufferedStream.h
@@ -8,10 +8,7 @@
#ifndef SkFrontBufferedStream_DEFINED
#define SkFrontBufferedStream_DEFINED
-#include "SkTypes.h"
-
-class SkStream;
-class SkStreamRewindable;
+#include "SkStream.h"
/**
* Specialized stream that buffers the first X bytes of a stream,
@@ -36,6 +33,13 @@ public:
* NULL on failure. The caller is required to delete when finished with
* this object.
*/
- static SkStreamRewindable* Create(SkStream* stream, size_t minBufferSize);
+ static std::unique_ptr<SkStreamRewindable> Make(std::unique_ptr<SkStream> stream,
+ size_t minBufferSize);
+
+#ifdef SK_SUPPORT_LEGACY_STREAM_API
+ static SkStreamRewindable* Create(SkStream* stream, size_t minBufferSize) {
+ return Make(std::unique_ptr<SkStream>(stream), minBufferSize).release();
+ }
+#endif
};
#endif // SkFrontBufferedStream_DEFINED