Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: src/core/SkFlate.h

Issue 1285913002: SkPDF: Move SkFlate into src/pdf (part 1/3) [reland] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-12 (Wednesday) 13:09:57 EDT Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/skflate.gyp ('k') | src/core/SkFlate.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
9
10 #ifndef SkFlate_DEFINED
11 #define SkFlate_DEFINED
12
13 #include "SkTypes.h"
14
15 #include "SkStream.h"
16 class SkData;
17
18 /** \class SkFlate
19 A class to provide access to the flate compression algorithm.
20 */
21 class SkFlate {
22 public:
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
47 /**
48 * Wrap a stream in this class to compress the information written to
49 * this stream using the Deflate algorithm. Uses Zlib's
50 * Z_DEFAULT_COMPRESSION level.
51 *
52 * See http://en.wikipedia.org/wiki/DEFLATE
53 */
54 class SkDeflateWStream : public SkWStream {
55 public:
56 /** Does not take ownership of the stream. */
57 SkDeflateWStream(SkWStream*);
58
59 /** The destructor calls finalize(). */
60 ~SkDeflateWStream();
61
62 /** Write the end of the compressed stream. All subsequent calls to
63 write() will fail. Subsequent calls to finalize() do nothing. */
64 void finalize();
65
66 // The SkWStream interface:
67 bool write(const void*, size_t) override;
68 size_t bytesWritten() const override;
69
70 private:
71 struct Impl;
72 SkAutoTDelete<Impl> fImpl;
73 };
74
75 #endif // SkFlate_DEFINED
OLDNEW
« no previous file with comments | « gyp/skflate.gyp ('k') | src/core/SkFlate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698