Index: include/codec/SkEncodedInfo.h |
diff --git a/include/codec/SkEncodedInfo.h b/include/codec/SkEncodedInfo.h |
index eb8c147a3b7037ab16a675197bdf9ec7a51ef096..8052244ae3bd37000de071940b14d2841a61f245 100644 |
--- a/include/codec/SkEncodedInfo.h |
+++ b/include/codec/SkEncodedInfo.h |
@@ -65,6 +65,13 @@ public: |
// be treated as inverted CMYK. |
kInvertedCMYK_Color, |
kYCCK_Color, |
+ |
+ // PNG |
+ // 565 images may be encoded to PNG by specifying the number of |
+ // significant bits for each channel. This is a strange 565 |
+ // representation because the image is still encoded with 8 bits per |
+ // component. |
+ k565_Color, |
}; |
static SkEncodedInfo Make(Color color, Alpha alpha, int bitsPerComponent) { |
@@ -105,8 +112,8 @@ public: |
SkASSERT(kOpaque_Alpha != alpha); |
SkASSERT(8 == bitsPerComponent); |
break; |
- default: |
- SkASSERT(false); |
+ case k565_Color: |
+ SkASSERT(kOpaque_Alpha == alpha); |
break; |
} |
@@ -148,6 +155,10 @@ public: |
SkASSERT(kOpaque_Alpha != fAlpha); |
return SkImageInfo::Make(width, height, kN32_SkColorType, |
kUnpremul_SkAlphaType, std::move(colorSpace)); |
+ case k565_Color: |
+ SkASSERT(kOpaque_Alpha == fAlpha); |
+ return SkImageInfo::Make(width, height, kRGB_565_SkColorType, |
+ kOpaque_SkAlphaType, std::move(colorSpace)); |
default: |
SkASSERT(false); |
return SkImageInfo::MakeUnknown(); |
@@ -169,6 +180,7 @@ public: |
case kRGB_Color: |
case kBGR_Color: |
case kYUV_Color: |
+ case k565_Color: |
reed1
2016/08/17 13:13:06
What is the interpretation of bytsPerPixel() in th
msarett
2016/08/17 13:17:35
Encoded size.
In this case, even though we recogn
|
return 3 * fBitsPerComponent; |
case kRGBA_Color: |
case kBGRA_Color: |