OLD | NEW |
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" |
11 #include "DMSrcSinkAndroid.h" | 11 #include "DMSrcSinkAndroid.h" |
12 #include "OverwriteLine.h" | 12 #include "OverwriteLine.h" |
13 #include "ProcStats.h" | 13 #include "ProcStats.h" |
14 #include "SkBBHFactory.h" | 14 #include "SkBBHFactory.h" |
15 #include "SkBitmapRegionDecoderPriv.h" | |
16 #include "SkChecksum.h" | 15 #include "SkChecksum.h" |
17 #include "SkCodec.h" | 16 #include "SkCodec.h" |
18 #include "SkCommonFlags.h" | 17 #include "SkCommonFlags.h" |
19 #include "SkFontMgr.h" | 18 #include "SkFontMgr.h" |
20 #include "SkForceLinking.h" | 19 #include "SkForceLinking.h" |
21 #include "SkGraphics.h" | 20 #include "SkGraphics.h" |
22 #include "SkMD5.h" | 21 #include "SkMD5.h" |
23 #include "SkMutex.h" | 22 #include "SkMutex.h" |
24 #include "SkOSFile.h" | 23 #include "SkOSFile.h" |
25 #include "SkTHash.h" | 24 #include "SkTHash.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 folder.append("_kGray8"); | 277 folder.append("_kGray8"); |
279 break; | 278 break; |
280 case CodecSrc::kIndex8_Always_DstColorType: | 279 case CodecSrc::kIndex8_Always_DstColorType: |
281 folder.append("_kIndex8"); | 280 folder.append("_kIndex8"); |
282 break; | 281 break; |
283 default: | 282 default: |
284 break; | 283 break; |
285 } | 284 } |
286 | 285 |
287 if (1 != sampleSize) { | 286 if (1 != sampleSize) { |
288 folder.appendf("_%.3f", get_scale_from_sample_size(sampleSize)); | 287 folder.appendf("_%.3f", 1.0f / (float) sampleSize); |
289 } | 288 } |
290 | 289 |
291 AndroidCodecSrc* src = new AndroidCodecSrc(path, mode, dstColorType, sampleS
ize); | 290 AndroidCodecSrc* src = new AndroidCodecSrc(path, mode, dstColorType, sampleS
ize); |
292 push_src("image", folder, src); | 291 push_src("image", folder, src); |
293 } | 292 } |
294 | 293 |
295 static void push_codec_srcs(Path path) { | 294 static void push_codec_srcs(Path path) { |
296 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); | 295 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); |
297 if (!encoded) { | 296 if (!encoded) { |
298 SkDebugf("Couldn't read %s.", path.c_str()); | 297 SkDebugf("Couldn't read %s.", path.c_str()); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 break; | 433 break; |
435 case CodecSrc::kGrayscale_Always_DstColorType: | 434 case CodecSrc::kGrayscale_Always_DstColorType: |
436 folder.append("_kGray"); | 435 folder.append("_kGray"); |
437 break; | 436 break; |
438 default: | 437 default: |
439 SkASSERT(false); | 438 SkASSERT(false); |
440 return; | 439 return; |
441 } | 440 } |
442 | 441 |
443 if (1 != sampleSize) { | 442 if (1 != sampleSize) { |
444 folder.appendf("_%.3f", get_scale_from_sample_size(sampleSize)); | 443 folder.appendf("_%.3f", 1.0f / (float) sampleSize); |
445 } | 444 } |
446 | 445 |
447 BRDSrc* src = new BRDSrc(path, strategy, mode, dstColorType, sampleSize); | 446 BRDSrc* src = new BRDSrc(path, strategy, mode, dstColorType, sampleSize); |
448 push_src("image", folder, src); | 447 push_src("image", folder, src); |
449 } | 448 } |
450 | 449 |
451 static void push_brd_srcs(Path path) { | 450 static void push_brd_srcs(Path path) { |
452 | 451 |
453 const SkBitmapRegionDecoder::Strategy strategies[] = { | 452 const SkBitmapRegionDecoder::Strategy strategies[] = { |
454 SkBitmapRegionDecoder::kCanvas_Strategy, | 453 SkBitmapRegionDecoder::kCanvas_Strategy, |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 #endif // SK_PDF_IMAGE_STATS | 1131 #endif // SK_PDF_IMAGE_STATS |
1133 return 0; | 1132 return 0; |
1134 } | 1133 } |
1135 | 1134 |
1136 #if !defined(SK_BUILD_FOR_IOS) | 1135 #if !defined(SK_BUILD_FOR_IOS) |
1137 int main(int argc, char** argv) { | 1136 int main(int argc, char** argv) { |
1138 SkCommandLineFlags::Parse(argc, argv); | 1137 SkCommandLineFlags::Parse(argc, argv); |
1139 return dm_main(); | 1138 return dm_main(); |
1140 } | 1139 } |
1141 #endif | 1140 #endif |
OLD | NEW |