OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return stream ? new SkDocument_XPS(stream, nullptr, dpi) : nullptr; | 69 return stream ? new SkDocument_XPS(stream, nullptr, dpi) : nullptr; |
70 } | 70 } |
71 | 71 |
72 static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; } | 72 static void delete_wstream(SkWStream* stream, bool aborted) { delete stream; } |
73 | 73 |
74 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) { | 74 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) { |
75 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); | 75 SkAutoTDelete<SkFILEWStream> stream(new SkFILEWStream(path)); |
76 if (!stream->isValid()) { | 76 if (!stream->isValid()) { |
77 return nullptr; | 77 return nullptr; |
78 } | 78 } |
79 return new SkDocument_XPS(stream.detach(), delete_wstream, dpi); | 79 return new SkDocument_XPS(stream.release(), delete_wstream, dpi); |
80 } | 80 } |
81 | 81 |
82 #endif//defined(SK_BUILD_FOR_WIN32) | 82 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |