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

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

Issue 1472933002: Make SkAndroidCodec support ico (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 29 matching lines...) Expand all
40 /* 40 /*
41 * Initiates the Ico decode 41 * Initiates the Ico decode
42 */ 42 */
43 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes , const Options&, 43 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes , const Options&,
44 SkPMColor*, int*, int*) override; 44 SkPMColor*, int*, int*) override;
45 45
46 SkEncodedFormat onGetEncodedFormat() const override { 46 SkEncodedFormat onGetEncodedFormat() const override {
47 return kICO_SkEncodedFormat; 47 return kICO_SkEncodedFormat;
48 } 48 }
49 49
50 SkScanlineOrder onGetScanlineOrder() const override;
51
50 private: 52 private:
51 53
54 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti ons& options,
55 SkPMColor inputColorPtr[], int* inputColorCount) override;
56
57 int onGetScanlines(void* dst, int count, size_t rowBytes) override;
58
59 SkSampler* getSampler(bool createIfNecessary) override;
60
61 /*
62 * Searches fEmbeddedCodecs for a codec that matches requestedSize.
63 * The search starts at startIndex and ends when an appropriate codec
64 * is found, or we have reached the end of the SkTArray.
65 *
66 * @return the index of the matching codec or -1 if there is no
67 * matching codec between startIndex and the end of
68 * the SkTArray.
69 */
70 int chooseCodec(const SkISize& requestedSize, int startIndex);
71
52 /* 72 /*
53 * Constructor called by NewFromStream 73 * Constructor called by NewFromStream
54 * @param embeddedCodecs codecs for the embedded images, takes ownership 74 * @param embeddedCodecs codecs for the embedded images, takes ownership
55 */ 75 */
56 SkIcoCodec(const SkImageInfo& srcInfo, 76 SkIcoCodec(const SkImageInfo& srcInfo, SkTArray<SkAutoTDelete<SkCodec>, true >* embeddedCodecs);
57 SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs);
58 77
59 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> 78 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // ow ned
60 fEmbeddedCodecs; // owned 79
80 // Only used by the scanline decoder. onStartScanlineDecode() will set
81 // fCodec to one of the fEmbeddedCodecs, if it can find a codec of the
82 // appropriate size. We will use fCodec for subsequent calls to
83 // onGetScanlines() or onSkipScanlines().
84 // fCodec is owned by this class, but should not be an SkAutoTDelete.
85 // It will be deleted by the destructor of fEmbeddedCodecs.
86 SkCodec* fCodec;
61 87
62 typedef SkCodec INHERITED; 88 typedef SkCodec INHERITED;
63 }; 89 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698