Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: src/codec/SkAndroidCodec.cpp

Issue 2288163003: Add Alpha8 support to SkPNGImageEncoder Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | src/codec/SkPngCodec.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkAndroidCodec.cpp
diff --git a/src/codec/SkAndroidCodec.cpp b/src/codec/SkAndroidCodec.cpp
index db365642327cc1041f1dbda911ed2d87c9c57da1..fe96c5a65ff90a8aa8273001f17558a19038de42 100644
--- a/src/codec/SkAndroidCodec.cpp
+++ b/src/codec/SkAndroidCodec.cpp
@@ -86,7 +86,9 @@ SkColorType SkAndroidCodec::computeOutputColorType(SkColorType requestedColorTyp
// we allowed clients to request kAlpha_8 when they wanted a
// grayscale decode.
case kGray_8_SkColorType:
- if (kGray_8_SkColorType == suggestedColorType) {
+ if (kGray_8_SkColorType == suggestedColorType ||
+ kAlpha_8_SkColorType == suggestedColorType)
+ {
return kGray_8_SkColorType;
}
break;
@@ -99,9 +101,9 @@ SkColorType SkAndroidCodec::computeOutputColorType(SkColorType requestedColorTyp
break;
}
- // Android has limited support for kGray_8 (using kAlpha_8). We will not
- // use kGray_8 for Android unless they specifically ask for it.
- if (kGray_8_SkColorType == suggestedColorType) {
+ // Android has limited support for kGray_8 and kAlpha_8. We will not use these types for
+ // Android unless they specifically ask for it.
+ if (kGray_8_SkColorType == suggestedColorType || kAlpha_8_SkColorType == suggestedColorType) {
return kN32_SkColorType;
}
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | src/codec/SkPngCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698