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

Side by Side Diff: include/codec/SkScanlineDecoder.h

Issue 1230033004: Allow creating multiple scanline decoders. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Progressive scanline decoder needs to handle rewind on first call. Created 5 years, 5 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 | « include/codec/SkCodec.h ('k') | src/codec/SkCodec.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 #ifndef SkScanlineDecoder_DEFINED 8 #ifndef SkScanlineDecoder_DEFINED
9 #define SkScanlineDecoder_DEFINED 9 #define SkScanlineDecoder_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 #include "SkCodec.h" 12 #include "SkCodec.h"
13 #include "SkTemplates.h" 13 #include "SkTemplates.h"
14 #include "SkImageInfo.h" 14 #include "SkImageInfo.h"
15 15
16 class SkScanlineDecoder : public SkNoncopyable { 16 class SkScanlineDecoder : public SkNoncopyable {
17 public: 17 public:
18 /** 18 /**
19 * Clean up after reading/skipping scanlines. 19 * Clean up after reading/skipping scanlines.
20 * 20 *
21 * It is possible that not all scanlines will have been read/skipped. In 21 * It is possible that not all scanlines will have been read/skipped. In
22 * fact, in the case of subset decodes, it is likely that there will be 22 * fact, in the case of subset decodes, it is likely that there will be
23 * scanlines at the bottom of the image that have been ignored. 23 * scanlines at the bottom of the image that have been ignored.
24 *
25 * Note for implementations: An SkScanlineDecoder will be deleted by (and
26 * therefore *before*) its associated SkCodec, in case the order matters.
27 * However, while the SkCodec base class maintains ownership of the
28 * SkScanlineDecoder, the subclass will be deleted before the scanline
29 * decoder. If this is an issue, detachScanlineDecoder() provides
30 * a means for the subclass to take ownership of the SkScanlineDecoder.
31 */ 24 */
32 virtual ~SkScanlineDecoder() {} 25 virtual ~SkScanlineDecoder() {}
33 26
34 /** 27 /**
35 * Write the next countLines scanlines into dst. 28 * Write the next countLines scanlines into dst.
36 * 29 *
37 * @param dst Must be non-null, and large enough to hold countLines 30 * @param dst Must be non-null, and large enough to hold countLines
38 * scanlines of size rowBytes. 31 * scanlines of size rowBytes.
39 * @param countLines Number of lines to write. 32 * @param countLines Number of lines to write.
40 * @param rowBytes Number of bytes per row. Must be large enough to hold 33 * @param rowBytes Number of bytes per row. Must be large enough to hold
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Calling the virtual method also means we do not double count 97 // Calling the virtual method also means we do not double count
105 // countLines. 98 // countLines.
106 return this->onGetScanlines(storage.get(), countLines, 0); 99 return this->onGetScanlines(storage.get(), countLines, 0);
107 } 100 }
108 101
109 virtual SkCodec::Result onGetScanlines(void* dst, int countLines, 102 virtual SkCodec::Result onGetScanlines(void* dst, int countLines,
110 size_t rowBytes) = 0; 103 size_t rowBytes) = 0;
111 104
112 }; 105 };
113 #endif // SkScanlineDecoder_DEFINED 106 #endif // SkScanlineDecoder_DEFINED
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698