| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkStream.h" | 10 #include "SkStream.h" |
| 11 #include "SkData.h" | 11 #include "SkData.h" |
| 12 #include "SkFixed.h" | 12 #include "SkFixed.h" |
| 13 #include "SkString.h" | 13 #include "SkString.h" |
| 14 #include "SkOSFile.h" | 14 #include "SkOSFile.h" |
| 15 | 15 |
| 16 SK_DEFINE_INST_COUNT(SkStream) | |
| 17 SK_DEFINE_INST_COUNT(SkWStream) | |
| 18 SK_DEFINE_INST_COUNT(SkFILEStream) | |
| 19 SK_DEFINE_INST_COUNT(SkMemoryStream) | |
| 20 SK_DEFINE_INST_COUNT(SkFILEWStream) | |
| 21 SK_DEFINE_INST_COUNT(SkMemoryWStream) | |
| 22 SK_DEFINE_INST_COUNT(SkDynamicMemoryWStream) | |
| 23 SK_DEFINE_INST_COUNT(SkDebugWStream) | |
| 24 | |
| 25 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
| 26 | 17 |
| 27 | 18 |
| 28 int8_t SkStream::readS8() { | 19 int8_t SkStream::readS8() { |
| 29 int8_t value; | 20 int8_t value; |
| 30 SkDEBUGCODE(size_t len =) this->read(&value, 1); | 21 SkDEBUGCODE(size_t len =) this->read(&value, 1); |
| 31 SkASSERT(1 == len); | 22 SkASSERT(1 == len); |
| 32 return value; | 23 return value; |
| 33 } | 24 } |
| 34 | 25 |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 829 |
| 839 // If we get here, then our attempt at using mmap failed, so try normal | 830 // If we get here, then our attempt at using mmap failed, so try normal |
| 840 // file access. | 831 // file access. |
| 841 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); | 832 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); |
| 842 if (!stream->isValid()) { | 833 if (!stream->isValid()) { |
| 843 stream->unref(); | 834 stream->unref(); |
| 844 stream = NULL; | 835 stream = NULL; |
| 845 } | 836 } |
| 846 return stream; | 837 return stream; |
| 847 } | 838 } |
| OLD | NEW |