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" |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 } | 774 } |
775 | 775 |
776 private: | 776 private: |
777 SkAutoTUnref<SkBlockMemoryRefCnt> const fBlockMemory; | 777 SkAutoTUnref<SkBlockMemoryRefCnt> const fBlockMemory; |
778 SkDynamicMemoryWStream::Block const * fCurrent; | 778 SkDynamicMemoryWStream::Block const * fCurrent; |
779 size_t const fSize; | 779 size_t const fSize; |
780 size_t fOffset; | 780 size_t fOffset; |
781 size_t fCurrentOffset; | 781 size_t fCurrentOffset; |
782 }; | 782 }; |
783 | 783 |
784 SkStreamAsset* SkDynamicMemoryWStream::detatchAsStream() { | 784 SkStreamAsset* SkDynamicMemoryWStream::detachAsStream() { |
785 if (fCopy) { | 785 if (fCopy) { |
786 SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (fCopy)); | 786 SkMemoryStream* stream = SkNEW_ARGS(SkMemoryStream, (fCopy)); |
787 this->reset(); | 787 this->reset(); |
788 return stream; | 788 return stream; |
789 } | 789 } |
790 SkBlockMemoryStream* stream = SkNEW_ARGS(SkBlockMemoryStream, (fHead, fBytes
Written)); | 790 SkBlockMemoryStream* stream = SkNEW_ARGS(SkBlockMemoryStream, (fHead, fBytes
Written)); |
791 fHead = 0; | 791 fHead = 0; |
792 this->reset(); | 792 this->reset(); |
793 return stream; | 793 return stream; |
794 } | 794 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 837 |
838 // If we get here, then our attempt at using mmap failed, so try normal | 838 // If we get here, then our attempt at using mmap failed, so try normal |
839 // file access. | 839 // file access. |
840 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); | 840 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); |
841 if (!stream->isValid()) { | 841 if (!stream->isValid()) { |
842 stream->unref(); | 842 stream->unref(); |
843 stream = NULL; | 843 stream = NULL; |
844 } | 844 } |
845 return stream; | 845 return stream; |
846 } | 846 } |
OLD | NEW |