aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkWbmpCodec.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-04-18 16:20:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-18 16:20:00 -0700
commitf682d9ad70d690a343bc15e26ef321d86770be41 (patch)
treed060890436619e2f3a03789400ed8276f421e5ce /src/codec/SkWbmpCodec.cpp
parentbde57ed11b8a6bd6da6043189e000c58bf146422 (diff)
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
Diffstat (limited to 'src/codec/SkWbmpCodec.cpp')
-rw-r--r--src/codec/SkWbmpCodec.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/codec/SkWbmpCodec.cpp b/src/codec/SkWbmpCodec.cpp
index 90ee322b1f..9a842ac91f 100644
--- a/src/codec/SkWbmpCodec.cpp
+++ b/src/codec/SkWbmpCodec.cpp
@@ -104,8 +104,8 @@ bool SkWbmpCodec::readRow(uint8_t* row) {
return this->stream()->read(row, fSrcRowBytes) == fSrcRowBytes;
}
-SkWbmpCodec::SkWbmpCodec(const SkImageInfo& info, SkStream* stream)
- : INHERITED(info, stream)
+SkWbmpCodec::SkWbmpCodec(int width, int height, const SkEncodedInfo& info, SkStream* stream)
+ : INHERITED(width, height, info, stream)
, fSrcRowBytes(get_src_row_bytes(this->getInfo().width()))
, fSwizzler(nullptr)
, fColorTable(nullptr)
@@ -166,9 +166,9 @@ SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) {
if (!read_header(stream, &size)) {
return nullptr;
}
- SkImageInfo info = SkImageInfo::Make(size.width(), size.height(),
- kGray_8_SkColorType, kOpaque_SkAlphaType);
- return new SkWbmpCodec(info, streamDeleter.release());
+ SkEncodedInfo info = SkEncodedInfo::Make(SkEncodedInfo::kGray_Color,
+ SkEncodedInfo::kOpaque_Alpha, 1);
+ return new SkWbmpCodec(size.width(), size.height(), info, streamDeleter.release());
}
int SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) {