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" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 break; | 304 break; |
305 } | 305 } |
306 | 306 |
307 switch (dstAlphaType) { | 307 switch (dstAlphaType) { |
308 case kOpaque_SkAlphaType: | 308 case kOpaque_SkAlphaType: |
309 folder.append("_opaque"); | 309 folder.append("_opaque"); |
310 break; | 310 break; |
311 case kPremul_SkAlphaType: | 311 case kPremul_SkAlphaType: |
312 folder.append("_premul"); | 312 folder.append("_premul"); |
313 break; | 313 break; |
314 case kUnpremul_SkAlphaType: | |
315 folder.append("_unpremul"); | |
316 break; | |
314 default: | 317 default: |
315 break; | 318 break; |
316 } | 319 } |
317 | 320 |
318 if (1 != sampleSize) { | 321 if (1 != sampleSize) { |
319 folder.appendf("_%.3f", 1.0f / (float) sampleSize); | 322 folder.appendf("_%.3f", 1.0f / (float) sampleSize); |
320 } | 323 } |
321 | 324 |
322 AndroidCodecSrc* src = new AndroidCodecSrc(path, mode, dstColorType, dstAlph aType, sampleSize); | 325 AndroidCodecSrc* src = new AndroidCodecSrc(path, mode, dstColorType, dstAlph aType, sampleSize); |
323 push_src("image", folder, src); | 326 push_src("image", folder, src); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 numColorTypes = 2; | 367 numColorTypes = 2; |
365 break; | 368 break; |
366 default: | 369 default: |
367 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; | 370 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; |
368 numColorTypes = 1; | 371 numColorTypes = 1; |
369 break; | 372 break; |
370 } | 373 } |
371 | 374 |
372 SkTArray<SkAlphaType> alphaModes; | 375 SkTArray<SkAlphaType> alphaModes; |
373 alphaModes.push_back(kPremul_SkAlphaType); | 376 alphaModes.push_back(kPremul_SkAlphaType); |
374 // FIXME: Currently we cannot draw unpremultiplied sources. skbug.com/3338 a nd skbug.com/3339 | 377 alphaModes.push_back(kUnpremul_SkAlphaType); |
msarett
2016/02/03 20:06:36
If we feel that this is too much, I'd be fine with
| |
375 // alphaModes.push_back(kUnpremul_SkAlphaType); | |
376 if (codec->getInfo().alphaType() == kOpaque_SkAlphaType) { | 378 if (codec->getInfo().alphaType() == kOpaque_SkAlphaType) { |
377 alphaModes.push_back(kOpaque_SkAlphaType); | 379 alphaModes.push_back(kOpaque_SkAlphaType); |
378 } | 380 } |
379 | 381 |
380 for (CodecSrc::Mode mode : nativeModes) { | 382 for (CodecSrc::Mode mode : nativeModes) { |
381 // SkCodecImageGenerator only runs for the default colorType | 383 // SkCodecImageGenerator only runs for the default colorType |
382 // recommended by SkCodec. There is no need to generate multiple | 384 // recommended by SkCodec. There is no need to generate multiple |
383 // tests for different colorTypes. | 385 // tests for different colorTypes. |
384 // TODO (msarett): Add scaling support to SkCodecImageGenerator. | 386 // TODO (msarett): Add scaling support to SkCodecImageGenerator. |
385 if (CodecSrc::kGen_Mode == mode) { | 387 if (CodecSrc::kGen_Mode == mode) { |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1301 Reporter* reporter, | 1303 Reporter* reporter, |
1302 GrContextFactory* fac tory); | 1304 GrContextFactory* fac tory); |
1303 } // namespace skiatest | 1305 } // namespace skiatest |
1304 | 1306 |
1305 #if !defined(SK_BUILD_FOR_IOS) | 1307 #if !defined(SK_BUILD_FOR_IOS) |
1306 int main(int argc, char** argv) { | 1308 int main(int argc, char** argv) { |
1307 SkCommandLineFlags::Parse(argc, argv); | 1309 SkCommandLineFlags::Parse(argc, argv); |
1308 return dm_main(); | 1310 return dm_main(); |
1309 } | 1311 } |
1310 #endif | 1312 #endif |
OLD | NEW |