Chromium Code Reviews| Index: dm/DM.cpp |
| diff --git a/dm/DM.cpp b/dm/DM.cpp |
| index 403252b03d7e3d205d086df4dc5839dc6dd99fbc..5fd03174787e3d676f54d7fbb54599c7438cf212 100644 |
| --- a/dm/DM.cpp |
| +++ b/dm/DM.cpp |
| @@ -344,20 +344,29 @@ static void push_codec_srcs(Path path) { |
| } |
| } |
| + uint32_t numAndroidModes = 0; |
| // https://bug.skia.org/4428 |
| + // Only test subsets for these selected image types. |
|
scroggo
2015/11/16 15:19:58
nit: This sentence is ambiguous - I read it as mea
|
| static const char* const exts[] = { |
| "jpg", "jpeg", "png", "webp", |
| "JPG", "JPEG", "PNG", "WEBP", |
| }; |
| - bool supported = false; |
| for (const char* ext : exts) { |
| if (path.endsWith(ext)) { |
| - supported = true; |
| + numAndroidModes = 2; |
| break; |
| } |
| } |
| - if (!supported) { |
| - return; |
| + |
| + static const char* onlyFullImageExts[] = { |
| + "wbmp", |
| + "WBMP", |
| + }; |
| + for (const char* ext : onlyFullImageExts) { |
| + if (path.endsWith(ext)) { |
| + numAndroidModes = 1; |
| + break; |
| + } |
| } |
| const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
| @@ -368,9 +377,9 @@ static void push_codec_srcs(Path path) { |
| }; |
| for (int sampleSize : sampleSizes) { |
| - for (AndroidCodecSrc::Mode mode : androidModes) { |
| + for (uint32_t m = 0; m < numAndroidModes; m++) { |
|
scroggo
2015/11/16 15:19:58
Now I think I see why you were tempted to go all t
msarett
2015/11/16 15:40:57
I think you could make a good argument for this.
|
| for (uint32_t i = 0; i < numColorTypes; i++) { |
| - push_android_codec_src(path, mode, colorTypes[i], sampleSize); |
| + push_android_codec_src(path, androidModes[m], colorTypes[i], sampleSize); |
| } |
| } |
| } |