OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkData.h" | 8 #include "SkData.h" |
9 #include "SkOSFile.h" | 9 #include "SkOSFile.h" |
10 #include "SkOncePtr.h" | 10 #include "SkOncePtr.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 /////////////////////////////////////////////////////////////////////////////// | 186 /////////////////////////////////////////////////////////////////////////////// |
187 | 187 |
188 sk_sp<SkData> SkData::MakeFromStream(SkStream* stream, size_t size) { | 188 sk_sp<SkData> SkData::MakeFromStream(SkStream* stream, size_t size) { |
189 sk_sp<SkData> data(SkData::MakeUninitialized(size)); | 189 sk_sp<SkData> data(SkData::MakeUninitialized(size)); |
190 if (stream->read(data->writable_data(), size) != size) { | 190 if (stream->read(data->writable_data(), size) != size) { |
191 return nullptr; | 191 return nullptr; |
192 } | 192 } |
193 return data; | 193 return data; |
194 } | 194 } |
195 | |
OLD | NEW |