OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 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 #ifndef SkFlate_DEFINED | 10 #ifndef SkFlate_DEFINED |
11 #define SkFlate_DEFINED | 11 #define SkFlate_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 | 14 |
15 #include "SkStream.h" | 15 #include "SkStream.h" |
16 class SkData; | |
17 | 16 |
18 /** \class SkFlate | 17 /** |
19 A class to provide access to the flate compression algorithm. | 18 * Use the un-deflate compression algorithm to decompress the data in src, |
20 */ | 19 * returning the result. Returns NULL if an error occurs. |
21 class SkFlate { | 20 */ |
22 public: | 21 SkStreamAsset* SkInflate(SkStream* src); |
mtklein_C
2015/08/18 19:33:09
If only used for testing, let's move it out of src
hal.canary
2015/08/18 20:06:23
Done.
Moved to tests/PDFDeflateWStreamTest.cpp
| |
23 /** | |
24 * Use the flate compression algorithm to compress the data in src, | |
25 * putting the result into dst. Returns false if an error occurs. | |
26 */ | |
27 static bool Deflate(SkStream* src, SkWStream* dst); | |
28 | |
29 /** | |
30 * Use the flate compression algorithm to compress the data in src, | |
31 * putting the result into dst. Returns false if an error occurs. | |
32 */ | |
33 static bool Deflate(const void* src, size_t len, SkWStream* dst); | |
34 | |
35 /** | |
36 * Use the flate compression algorithm to compress the data, | |
37 * putting the result into dst. Returns false if an error occurs. | |
38 */ | |
39 static bool Deflate(const SkData*, SkWStream* dst); | |
40 | |
41 /** Use the flate compression algorithm to decompress the data in src, | |
42 putting the result into dst. Returns false if an error occurs. | |
43 */ | |
44 static bool Inflate(SkStream* src, SkWStream* dst); | |
45 }; | |
46 | 22 |
47 /** | 23 /** |
48 * Wrap a stream in this class to compress the information written to | 24 * Wrap a stream in this class to compress the information written to |
49 * this stream using the Deflate algorithm. Uses Zlib's | 25 * this stream using the Deflate algorithm. Uses Zlib's |
50 * Z_DEFAULT_COMPRESSION level. | 26 * Z_DEFAULT_COMPRESSION level. |
51 * | 27 * |
52 * See http://en.wikipedia.org/wiki/DEFLATE | 28 * See http://en.wikipedia.org/wiki/DEFLATE |
53 */ | 29 */ |
54 class SkDeflateWStream : public SkWStream { | 30 class SkDeflateWStream : public SkWStream { |
55 public: | 31 public: |
(...skipping 10 matching lines...) Expand all Loading... | |
66 // The SkWStream interface: | 42 // The SkWStream interface: |
67 bool write(const void*, size_t) override; | 43 bool write(const void*, size_t) override; |
68 size_t bytesWritten() const override; | 44 size_t bytesWritten() const override; |
69 | 45 |
70 private: | 46 private: |
71 struct Impl; | 47 struct Impl; |
72 SkAutoTDelete<Impl> fImpl; | 48 SkAutoTDelete<Impl> fImpl; |
73 }; | 49 }; |
74 | 50 |
75 #endif // SkFlate_DEFINED | 51 #endif // SkFlate_DEFINED |
OLD | NEW |