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

Unified Diff: src/codec/SkPngCodec.h

Issue 2279313003: Make swizzler optional for SkPngCodec, refactor xforms (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Less spacing Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkPngCodec.h
diff --git a/src/codec/SkPngCodec.h b/src/codec/SkPngCodec.h
index e4df8230766a53f6928a3f750fb6044e28674f14..fba29a9b37efc7b690a1c469dd5ecf7152305167 100644
--- a/src/codec/SkPngCodec.h
+++ b/src/codec/SkPngCodec.h
@@ -46,13 +46,12 @@ protected:
uint32_t onGetFillValue(SkColorType) const override;
// Helper to set up swizzler, color xforms, and color table. Also calls png_read_update_info.
- bool initializeXforms(const SkImageInfo& requestedInfo, const Options&, SkPMColor* colorPtr,
+ bool initializeXforms(const SkImageInfo& dstInfo, const Options&, SkPMColor* colorPtr,
int* colorCount);
- SkSampler* getSampler(bool createIfNecessary) override {
- SkASSERT(fSwizzler);
- return fSwizzler;
- }
- void allocateStorage();
+ void initializeSwizzler(const SkImageInfo& dstInfo, const Options&);
+ SkSampler* getSampler(bool createIfNecessary) override;
+ void allocateStorage(const SkImageInfo& dstInfo);
+ void applyXformRow(void* dst, const void* src, SkColorType, SkAlphaType, int width);
virtual int readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, int count,
int startRow) = 0;
@@ -77,8 +76,22 @@ protected:
int fBitDepth;
private:
+
+ enum XformMode {
+ // Requires only a swizzle pass.
+ kSwizzleOnly_XformMode,
+
+ // Requires only a color xform pass.
+ kColorOnly_XformMode,
+
+ // Requires a swizzle and a color xform.
+ kSwizzleColor_XformMode,
+ };
+
bool createColorTable(const SkImageInfo& dstInfo, int* ctableCount);
void destroyReadStruct();
+ XformMode fXformMode;
+
typedef SkCodec INHERITED;
};
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698