Index: src/codec/SkWebpCodec.cpp |
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp |
index fea557d21ed9ddb8e9a86ff475a2c996a8fa749d..041bfb6b63aa191443805a702adc8263ec2e1b3a 100644 |
--- a/src/codec/SkWebpCodec.cpp |
+++ b/src/codec/SkWebpCodec.cpp |
@@ -82,17 +82,23 @@ SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) { |
} |
static bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) { |
+ if (dst.profileType() != src.profileType()) { |
+ return false; |
+ } |
switch (dst.colorType()) { |
// Both byte orders are supported. |
case kBGRA_8888_SkColorType: |
case kRGBA_8888_SkColorType: |
break; |
+ case kRGB_565_SkColorType: |
+ if (src.alphaType() == kOpaque_SkAlphaType |
+ && dst.alphaType() == kOpaque_SkAlphaType) |
+ { |
msarett
2015/08/06 19:30:03
nit: I think the bracket should go on the previous
scroggo
2015/08/06 20:42:44
Maybe? In general the { does not get its own line,
|
+ return true; |
+ } |
default: |
return false; |
} |
- if (dst.profileType() != src.profileType()) { |
- return false; |
- } |
if (dst.alphaType() == src.alphaType()) { |
return true; |
} |
@@ -115,6 +121,8 @@ static WEBP_CSP_MODE webp_decode_mode(SkColorType ct, bool premultiply) { |
return premultiply ? MODE_bgrA : MODE_BGRA; |
case kRGBA_8888_SkColorType: |
return premultiply ? MODE_rgbA : MODE_RGBA; |
+ case kRGB_565_SkColorType: |
+ return MODE_RGB_565; |
default: |
return MODE_LAST; |
} |