OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
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 | 8 |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkDeflate.h" | 10 #include "SkDeflate.h" |
11 | 11 |
12 #ifdef ZLIB_INCLUDE | 12 #include "zlib.h" |
13 #include ZLIB_INCLUDE | |
14 #else | |
15 #include "zlib.h" | |
16 #endif | |
17 | 13 |
18 namespace { | 14 namespace { |
19 | 15 |
20 // Different zlib implementations use different T. | 16 // Different zlib implementations use different T. |
21 // We've seen size_t and unsigned. | 17 // We've seen size_t and unsigned. |
22 template <typename T> void* skia_alloc_func(void*, T items, T size) { | 18 template <typename T> void* skia_alloc_func(void*, T items, T size) { |
23 return sk_calloc_throw(SkToSizeT(items) * SkToSizeT(size)); | 19 return sk_calloc_throw(SkToSizeT(items) * SkToSizeT(size)); |
24 } | 20 } |
25 | 21 |
26 void skia_free_func(void*, void* address) { sk_free(address); } | 22 void skia_free_func(void*, void* address) { sk_free(address); } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 fImpl->fInBuffer, fImpl->fInBufferIndex); | 111 fImpl->fInBuffer, fImpl->fInBufferIndex); |
116 fImpl->fInBufferIndex = 0; | 112 fImpl->fInBufferIndex = 0; |
117 } | 113 } |
118 } | 114 } |
119 return true; | 115 return true; |
120 } | 116 } |
121 | 117 |
122 size_t SkDeflateWStream::bytesWritten() const { | 118 size_t SkDeflateWStream::bytesWritten() const { |
123 return fImpl->fZStream.total_in + fImpl->fInBufferIndex; | 119 return fImpl->fZStream.total_in + fImpl->fInBufferIndex; |
124 } | 120 } |
OLD | NEW |