aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-04-15 07:32:19 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-15 07:32:20 -0700
commite16b04aa6041efb6507546547737e9603fa1606e (patch)
tree3bd78e41a9ff3df445c64d3c0429d83bb698570d /dm
parentf91e676f941c7e9ec91ac298eaa32e4bf8f52762 (diff)
SkJpegCodec
Enables basic decoding for jpegs Includes rewinding 565, YUV, and Jpeg encoding are not yet implemented BUG=skia:3257 Review URL: https://codereview.chromium.org/1076923002
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp4
-rw-r--r--dm/DMSrcSink.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index c6d633c001..ff9dc57264 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -223,8 +223,8 @@ static bool codec_supported(const char* ext) {
// FIXME: Once other versions of SkCodec are available, we can add them to this
// list (and eventually we can remove this check once they are all supported).
static const char* const exts[] = {
- "bmp", "gif", "png", "ico", "wbmp",
- "BMP", "GIF", "PNG", "ICO", "WBMP"
+ "bmp", "gif", "jpg", "jpeg", "png", "ico", "wbmp",
+ "BMP", "GIF", "JPG", "JPEG", "PNG", "ICO", "WBMP"
};
for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) {
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index e70dd3e2b0..6b3ec9749e 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -83,7 +83,13 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkColorType canvasColorType = canvasInfo.colorType();
switch (fDstColorType) {
case kIndex8_Always_DstColorType:
+ decodeInfo = codec->getInfo().makeColorType(kIndex_8_SkColorType);
+ if (kRGB_565_SkColorType == canvasColorType) {
+ return Error::Nonfatal("Testing non-565 to 565 is uninteresting.");
+ }
+ break;
case kGrayscale_Always_DstColorType:
+ decodeInfo = codec->getInfo().makeColorType(kGray_8_SkColorType);
if (kRGB_565_SkColorType == canvasColorType) {
return Error::Nonfatal("Testing non-565 to 565 is uninteresting.");
}