aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-12-04 07:09:57 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-04 07:09:57 -0800
commit97ff7f56620a50e83e433b158a86ff082935ed47 (patch)
tree375c0c60b9bc2e19195c75d25c08be487904c42d /dm
parent41cbf3f807d619861365112513655f5f00e16005 (diff)
Revert of Make SkAndroidCodec support ico (patchset #7 id:130002 of https://codereview.chromium.org/1472933002/ )
Diffstat (limited to 'dm')
-rw-r--r--dm/DM.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 41e4c8dc3e..c28f688697 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -345,17 +345,35 @@ static void push_codec_srcs(Path path) {
bool subset = false;
// The following image types are supported by BitmapRegionDecoder,
// so we will test full image decodes and subset decodes.
- static const char* const exts[] = {
+ static const char* const subsetExts[] = {
"jpg", "jpeg", "png", "webp",
"JPG", "JPEG", "PNG", "WEBP",
};
- for (const char* ext : exts) {
+ for (const char* ext : subsetExts) {
if (path.endsWith(ext)) {
subset = true;
break;
}
}
+ bool full = false;
+ // The following image types are only supported by BitmapFactory,
+ // so we only need to test full image decodes.
+ static const char* fullExts[] = {
+ "wbmp", "bmp", "gif",
+ "WBMP", "BMP", "GIF",
+ };
+ for (const char* ext : fullExts) {
+ if (path.endsWith(ext)) {
+ full = true;
+ break;
+ }
+ }
+
+ if (!full && !subset) {
+ return;
+ }
+
const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
for (int sampleSize : sampleSizes) {