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

Side by Side Diff: src/codec/SkIcoCodec.h

Issue 1997703003: Make SkPngCodec decode progressively. (Closed) Base URL: https://skia.googlesource.com/skia.git@foil
Patch Set: Fixes for ICO, Incomplete, comments Created 4 years, 7 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
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 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkImageInfo.h" 9 #include "SkImageInfo.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 private: 48 private:
49 49
50 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti ons& options, 50 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti ons& options,
51 SkPMColor inputColorPtr[], int* inputColorCount) override; 51 SkPMColor inputColorPtr[], int* inputColorCount) override;
52 52
53 int onGetScanlines(void* dst, int count, size_t rowBytes) override; 53 int onGetScanlines(void* dst, int count, size_t rowBytes) override;
54 54
55 bool onSkipScanlines(int count) override; 55 bool onSkipScanlines(int count) override;
56 56
57 Result onStartIncrementalDecode(const SkImageInfo& dstInfo,
58 const SkCodec::Options&, SkPMColor*, int*) override;
59
60 Result onIncrementalDecode(std::function<void*(int)> callback,
61 int* rowsDecoded) override;
62
57 SkSampler* getSampler(bool createIfNecessary) override; 63 SkSampler* getSampler(bool createIfNecessary) override;
58 64
59 /* 65 /*
60 * Searches fEmbeddedCodecs for a codec that matches requestedSize. 66 * Searches fEmbeddedCodecs for a codec that matches requestedSize.
61 * The search starts at startIndex and ends when an appropriate codec 67 * The search starts at startIndex and ends when an appropriate codec
62 * is found, or we have reached the end of the array. 68 * is found, or we have reached the end of the array.
63 * 69 *
64 * @return the index of the matching codec or -1 if there is no 70 * @return the index of the matching codec or -1 if there is no
65 * matching codec between startIndex and the end of 71 * matching codec between startIndex and the end of
66 * the array. 72 * the array.
(...skipping 10 matching lines...) Expand all
77 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow ned 83 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow ned
78 84
79 // Only used by the scanline decoder. onStartScanlineDecode() will set 85 // Only used by the scanline decoder. onStartScanlineDecode() will set
80 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a 86 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a
81 // codec of the appropriate size. We will use fCurrScanlineCodec for 87 // codec of the appropriate size. We will use fCurrScanlineCodec for
82 // subsequent calls to onGetScanlines() or onSkipScanlines(). 88 // subsequent calls to onGetScanlines() or onSkipScanlines().
83 // fCurrScanlineCodec is owned by this class, but should not be an 89 // fCurrScanlineCodec is owned by this class, but should not be an
84 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. 90 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs.
85 SkCodec* fCurrScanlineCodec; 91 SkCodec* fCurrScanlineCodec;
86 92
93 // Only used by incremental decoder. onStartIncrementalDecode() will set
94 // fCurrIncrementalCodec to one of the fEmbeddedCodecs, if it can find a
95 // codec of the appropriate size. We will use fCurrIncrementalCodec for
96 // subsequent calls to incrementalDecode().
97 // fCurrIncrementalCodec is owned by this class, but should not be an
98 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs.
99 SkCodec* fCurrIncrementalCodec;
100
87 typedef SkCodec INHERITED; 101 typedef SkCodec INHERITED;
88 }; 102 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698