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

Side by Side Diff: dm/DM.cpp

Issue 1472933002: Make SkAndroidCodec support ico (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/codec/SkCodec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 for (uint32_t i = 0; i < numColorTypes; i++) { 338 for (uint32_t i = 0; i < numColorTypes; i++) {
339 push_codec_src(path, mode, colorTypes[i], scale); 339 push_codec_src(path, mode, colorTypes[i], scale);
340 } 340 }
341 } 341 }
342 } 342 }
343 343
344 // https://bug.skia.org/4428 344 // https://bug.skia.org/4428
345 bool subset = false; 345 bool subset = false;
346 // The following image types are supported by BitmapRegionDecoder, 346 // The following image types are supported by BitmapRegionDecoder,
347 // so we will test full image decodes and subset decodes. 347 // so we will test full image decodes and subset decodes.
348 static const char* const subsetExts[] = { 348 static const char* const exts[] = {
349 "jpg", "jpeg", "png", "webp", 349 "jpg", "jpeg", "png", "webp",
350 "JPG", "JPEG", "PNG", "WEBP", 350 "JPG", "JPEG", "PNG", "WEBP",
351 }; 351 };
352 for (const char* ext : subsetExts) { 352 for (const char* ext : exts) {
353 if (path.endsWith(ext)) { 353 if (path.endsWith(ext)) {
354 subset = true; 354 subset = true;
355 break; 355 break;
356 } 356 }
357 } 357 }
358 358
359 bool full = false;
360 // The following image types are only supported by BitmapFactory,
361 // so we only need to test full image decodes.
362 static const char* fullExts[] = {
363 "wbmp", "bmp", "gif",
364 "WBMP", "BMP", "GIF",
365 };
366 for (const char* ext : fullExts) {
367 if (path.endsWith(ext)) {
368 full = true;
369 break;
370 }
371 }
372
373 if (!full && !subset) {
374 return;
375 }
376
377 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; 359 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
378 360
379 for (int sampleSize : sampleSizes) { 361 for (int sampleSize : sampleSizes) {
380 for (uint32_t i = 0; i < numColorTypes; i++) { 362 for (uint32_t i = 0; i < numColorTypes; i++) {
381 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, color Types[i], 363 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, color Types[i],
382 sampleSize); 364 sampleSize);
383 if (subset) { 365 if (subset) {
384 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, col orTypes[i], 366 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, col orTypes[i],
385 sampleSize); 367 sampleSize);
386 } 368 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 Reporter* reporter, 1186 Reporter* reporter,
1205 GrContextFactory* fac tory); 1187 GrContextFactory* fac tory);
1206 } // namespace skiatest 1188 } // namespace skiatest
1207 1189
1208 #if !defined(SK_BUILD_FOR_IOS) 1190 #if !defined(SK_BUILD_FOR_IOS)
1209 int main(int argc, char** argv) { 1191 int main(int argc, char** argv) {
1210 SkCommandLineFlags::Parse(argc, argv); 1192 SkCommandLineFlags::Parse(argc, argv);
1211 return dm_main(); 1193 return dm_main();
1212 } 1194 }
1213 #endif 1195 #endif
OLDNEW
« no previous file with comments | « no previous file | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698