Skip to content
Snippets Groups Projects
Commit db9532ae authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Force compressing ALPHA_8 to fail"

parents b1d7167b 9f49a7cd
No related branches found
No related tags found
No related merge requests found
......@@ -479,6 +479,14 @@ bool Bitmap::compress(JavaCompressFormat format, int32_t quality, SkWStream* str
bool Bitmap::compress(const SkBitmap& bitmap, JavaCompressFormat format,
int32_t quality, SkWStream* stream) {
if (bitmap.colorType() == kAlpha_8_SkColorType) {
// None of the JavaCompressFormats have a sensible way to compress an
// ALPHA_8 Bitmap. SkPngEncoder will compress one, but it uses a non-
// standard format that most decoders do not understand, so this is
// likely not useful.
return false;
}
SkEncodedImageFormat fm;
switch (format) {
case JavaCompressFormat::Jpeg:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment