Add F16, SkColorSpaceXform support to SkBmpCodec
BUG=skia:4895
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4390
Change-Id: I9cb727e7f13816b0ac882f62ec635a4528c3a524
Reviewed-on: https://skia-review.googlesource.com/4390
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
diff --git a/src/codec/SkBmpCodec.h b/src/codec/SkBmpCodec.h
index 0ece7ad..a51bbce 100644
--- a/src/codec/SkBmpCodec.h
+++ b/src/codec/SkBmpCodec.h
@@ -99,9 +99,16 @@
* will be set to the number of colors in the
* color table.
*/
- virtual SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
+ virtual SkCodec::Result onPrepareToDecode(const SkImageInfo& dstInfo,
const SkCodec::Options& options, SkPMColor inputColorPtr[],
int* inputColorCount) = 0;
+ SkCodec::Result prepareToDecode(const SkImageInfo& dstInfo,
+ const SkCodec::Options& options, SkPMColor inputColorPtr[],
+ int* inputColorCount);
+
+ void applyColorXform(const SkImageInfo& dstInfo, void* dst, void* src) const;
+ uint32_t* xformBuffer() const { return fXformBuffer.get(); }
+ void resetXformBuffer(int count) { fXformBuffer.reset(new uint32_t[count]); }
private:
@@ -138,9 +145,10 @@
bool onSkipScanlines(int count) override;
- const uint16_t fBitsPerPixel;
- const SkScanlineOrder fRowOrder;
- const size_t fSrcRowBytes;
+ const uint16_t fBitsPerPixel;
+ const SkScanlineOrder fRowOrder;
+ const size_t fSrcRowBytes;
+ std::unique_ptr<uint32_t[]> fXformBuffer;
typedef SkCodec INHERITED;
};