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

Unified Diff: src/codec/SkCodec_libico.h

Issue 1472933002: Make SkAndroidCodec support ico (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase: Make this CL depend on previous CL 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 side-by-side diff with in-line comments
Download patch
Index: src/codec/SkCodec_libico.h
diff --git a/src/codec/SkCodec_libico.h b/src/codec/SkCodec_libico.h
index 92675f4d740ea241de38d00ddbf4a768040c8b47..97c22be78a9db46f5be34c248206ae82b34f5f1d 100644
--- a/src/codec/SkCodec_libico.h
+++ b/src/codec/SkCodec_libico.h
@@ -47,17 +47,45 @@ protected:
return kICO_SkEncodedFormat;
}
+ SkScanlineOrder onGetScanlineOrder() const override;
+
private:
+ Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Options& options,
+ SkPMColor inputColorPtr[], int* inputColorCount) override;
+
+ int onGetScanlines(void* dst, int count, size_t rowBytes) override;
+
+ bool onSkipScanlines(int count) override;
+
+ SkSampler* getSampler(bool createIfNecessary) override;
+
+ /*
+ * Searches fEmbeddedCodecs for a codec that matches requestedSize.
+ * The search starts at startIndex and ends when an appropriate codec
+ * is found, or we have reached the end of the SkTArray.
scroggo 2015/12/02 16:27:03 SkTArray is an implementation detail that isn't ne
msarett 2015/12/03 19:19:16 Done.
+ *
+ * @return the index of the matching codec or -1 if there is no
+ * matching codec between startIndex and the end of
+ * the SkTArray.
+ */
+ int chooseCodec(const SkISize& requestedSize, int startIndex);
+
/*
* Constructor called by NewFromStream
* @param embeddedCodecs codecs for the embedded images, takes ownership
*/
- SkIcoCodec(const SkImageInfo& srcInfo,
- SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs);
+ SkIcoCodec(const SkImageInfo& srcInfo, SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs);
+
+ SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> fEmbeddedCodecs; // owned
- SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>>
- fEmbeddedCodecs; // owned
+ // Only used by the scanline decoder. onStartScanlineDecode() will set
+ // fCodec to one of the fEmbeddedCodecs, if it can find a codec of the
+ // appropriate size. We will use fCodec for subsequent calls to
+ // onGetScanlines() or onSkipScanlines().
+ // fCodec is owned by this class, but should not be an SkAutoTDelete.
+ // It will be deleted by the destructor of fEmbeddedCodecs.
+ SkCodec* fCodec;
scroggo 2015/12/02 16:27:03 I think this should have a name that indicates tha
msarett 2015/12/03 19:19:16 Agreed. fCurrScanlineCodec it is...I can't think
typedef SkCodec INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698