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

Unified Diff: src/codec/SkJpegCodec.h

Issue 2174493002: Add color space xform support to SkJpegCodec (includes F16!) (Closed) Base URL: https://skia.googlesource.com/skia.git@drop
Patch Set: Fix MSAN suppression Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.h
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h
index 7aa275ce4efd6028b69eb48d10de69e8a03a6f9b..7eb5100a8fadcfbd811aad5386c13426b56f20cf 100644
--- a/src/codec/SkJpegCodec.h
+++ b/src/codec/SkJpegCodec.h
@@ -10,6 +10,7 @@
#include "SkCodec.h"
#include "SkColorSpace.h"
+#include "SkColorSpaceXform.h"
#include "SkImageInfo.h"
#include "SkSwizzler.h"
#include "SkStream.h"
@@ -99,34 +100,46 @@ private:
/*
* Checks if the conversion between the input image and the requested output
- * image has been implemented
- * Sets the output color space
+ * image has been implemented.
+ *
+ * Sets the output color space.
*/
- bool setOutputColorSpace(const SkImageInfo& dst);
+ bool setOutputColorSpace(const SkImageInfo& dst, bool needsColorXform);
- // scanline decoding
void initializeSwizzler(const SkImageInfo& dstInfo, const Options& options);
+ bool initializeColorXform(const SkImageInfo& dstInfo, bool needsColorXform);
+ void allocateStorage(const SkImageInfo& dstInfo);
+ int readRows(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, int count);
+
+ /*
+ * Scanline decoding.
+ */
SkSampler* getSampler(bool createIfNecessary) override;
Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
SkPMColor ctable[], int* ctableCount) override;
int onGetScanlines(void* dst, int count, size_t rowBytes) override;
bool onSkipScanlines(int count) override;
- SkAutoTDelete<JpegDecoderMgr> fDecoderMgr;
+ SkAutoTDelete<JpegDecoderMgr> fDecoderMgr;
+
// We will save the state of the decompress struct after reading the header.
// This allows us to safely call onGetScaledDimensions() at any time.
- const int fReadyState;
+ const int fReadyState;
+
+
+ SkAutoTMalloc<uint8_t> fStorage;
+ uint8_t* fSwizzleSrcRow;
+ uint32_t* fColorXformSrcRow;
- // scanline decoding
- SkAutoTMalloc<uint8_t> fStorage; // Only used if sampling is needed
- uint8_t* fSrcRow; // Only used if sampling is needed
// libjpeg-turbo provides some subsetting. In the case that libjpeg-turbo
// cannot take the exact the subset that we need, we will use the swizzler
// to further subset the output from libjpeg-turbo.
- SkIRect fSwizzlerSubset;
- SkAutoTDelete<SkSwizzler> fSwizzler;
+ SkIRect fSwizzlerSubset;
+
+ SkAutoTDelete<SkSwizzler> fSwizzler;
+ std::unique_ptr<SkColorSpaceXform> fColorXform;
- sk_sp<SkData> fICCData;
+ sk_sp<SkData> fICCData;
typedef SkCodec INHERITED;
};
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698