From f682d9ad70d690a343bc15e26ef321d86770be41 Mon Sep 17 00:00:00 2001 From: msarett Date: Mon, 18 Apr 2016 16:20:00 -0700 Subject: Add SkEncodedInfo to report properties of encoded image data All this does is build an SkEncodedInfo for each codec, and then convert it to an SkImageInfo. In future steps I intend to: (1) Use SkEncodedInfo in place of SrcConfig in SkSwizzler. (2) Support more conversions in SkSwizzler (non-native BGRA/RGBA, 16-bit components, float, fixed point) (3) Investigate optimizing conversions from encoded data to linear color spaces. BUG=skia:4133 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1820073002 Review URL: https://codereview.chromium.org/1820073002 --- include/codec/SkCodec.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/codec/SkCodec.h') diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h index 629274d21c..50875e46c4 100644 --- a/include/codec/SkCodec.h +++ b/include/codec/SkCodec.h @@ -11,6 +11,7 @@ #include "../private/SkTemplates.h" #include "SkColor.h" #include "SkEncodedFormat.h" +#include "SkEncodedInfo.h" #include "SkImageInfo.h" #include "SkSize.h" #include "SkStream.h" @@ -100,6 +101,8 @@ public: */ const SkImageInfo& getInfo() const { return fSrcInfo; } + const SkEncodedInfo& getEncodedInfo() const { return fEncodedInfo; } + /** * Returns the color space associated with the codec. * Does not affect ownership. @@ -511,7 +514,9 @@ protected: /** * Takes ownership of SkStream* */ - SkCodec(const SkImageInfo&, + SkCodec(int width, + int height, + const SkEncodedInfo&, SkStream*, sk_sp = nullptr, Origin = kTopLeft_Origin); @@ -642,6 +647,7 @@ protected: virtual int onOutputScanline(int inputScanline) const; private: + const SkEncodedInfo fEncodedInfo; const SkImageInfo fSrcInfo; SkAutoTDelete fStream; bool fNeedsRewind; -- cgit v1.2.3