| Index: src/core/SkStream.cpp
|
| diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
|
| index e7b3a7a7e5777ff40de437a8628a441921b1b259..48eb92cae5c5631c1e4546f95e471040fa2297e9 100644
|
| --- a/src/core/SkStream.cpp
|
| +++ b/src/core/SkStream.cpp
|
| @@ -10,7 +10,6 @@
|
| #include "SkStreamPriv.h"
|
| #include "SkData.h"
|
| #include "SkFixed.h"
|
| -#include "SkMakeUnique.h"
|
| #include "SkString.h"
|
| #include "SkOSFile.h"
|
| #include "SkTypes.h"
|
| @@ -855,18 +854,20 @@
|
| return data;
|
| }
|
|
|
| -std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char path[]) {
|
| +SkStreamAsset* SkStream::NewFromFile(const char path[]) {
|
| auto data(mmap_filename(path));
|
| if (data) {
|
| - return skstd::make_unique<SkMemoryStream>(std::move(data));
|
| - }
|
| -
|
| - // If we get here, then our attempt at using mmap failed, so try normal file access.
|
| - auto stream = skstd::make_unique<SkFILEStream>(path);
|
| + return new SkMemoryStream(std::move(data));
|
| + }
|
| +
|
| + // If we get here, then our attempt at using mmap failed, so try normal
|
| + // file access.
|
| + SkFILEStream* stream = new SkFILEStream(path);
|
| if (!stream->isValid()) {
|
| - return nullptr;
|
| - }
|
| - return std::move(stream);
|
| + delete stream;
|
| + stream = nullptr;
|
| + }
|
| + return stream;
|
| }
|
|
|
| // Declared in SkStreamPriv.h:
|
|
|