aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpStandardCodec.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-03 16:01:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-04 15:22:04 +0000
commit19aff5dd5cd83141f12c234c4255a35f63e564cd (patch)
treecde4a5f4723319325bff3491368e408232b26e0b /src/codec/SkBmpStandardCodec.cpp
parent114e6b33d67537f034b749e77f68d168ef9bfbc6 (diff)
565 codec color xform support: fix colortable / incomplete image behavior
This fixes a bug that was exposed when I added color space support for 565 decodes. Before this CL, we would sometimes fill incomplete images with R and B swapped. This fixes that issue. Part of the fix is the decision to do 565 xforms when building the color table (then just swizzle to 565), rather than do them per pixel after swizzling. Bug: skia: Change-Id: I09e1ec75aba09a4e288015ea746465d0c3f7d59f Reviewed-on: https://skia-review.googlesource.com/11137 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/codec/SkBmpStandardCodec.cpp')
-rw-r--r--src/codec/SkBmpStandardCodec.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codec/SkBmpStandardCodec.cpp b/src/codec/SkBmpStandardCodec.cpp
index 7e39d610c4..a0ad7875eb 100644
--- a/src/codec/SkBmpStandardCodec.cpp
+++ b/src/codec/SkBmpStandardCodec.cpp
@@ -125,7 +125,7 @@ SkCodec::Result SkBmpStandardCodec::onGetPixels(const SkImageInfo& dstInfo,
}
if (this->colorXform() && !fXformOnDecode) {
- SkColorSpaceXform::ColorFormat dstFormat = select_xform_format(dstColorType);
+ SkColorSpaceXform::ColorFormat dstFormat = select_xform_format_ct(dstColorType);
SkColorSpaceXform::ColorFormat srcFormat = SkColorSpaceXform::kBGRA_8888_ColorFormat;
SkAlphaType xformAlphaType = select_xform_alpha(dstAlphaType,
this->getInfo().alphaType());
@@ -357,7 +357,7 @@ uint64_t SkBmpStandardCodec::onGetFillValue(const SkImageInfo& dstInfo) const {
const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
if (colorPtr) {
return get_color_table_fill_value(dstInfo.colorType(), dstInfo.alphaType(), colorPtr, 0,
- this->colorXform());
+ this->colorXform(), false);
}
return INHERITED::onGetFillValue(dstInfo);
}