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

Side by Side Diff: dm/DM.cpp

Issue 1581653003: DM test for YUV (Closed) Base URL: https://skia.googlesource.com/skia.git@yuv
Patch Set: Created 4 years, 11 months 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 | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 break; 233 break;
234 case CodecSrc::kScanline_Mode: 234 case CodecSrc::kScanline_Mode:
235 folder.append("scanline"); 235 folder.append("scanline");
236 break; 236 break;
237 case CodecSrc::kStripe_Mode: 237 case CodecSrc::kStripe_Mode:
238 folder.append("stripe"); 238 folder.append("stripe");
239 break; 239 break;
240 case CodecSrc::kSubset_Mode: 240 case CodecSrc::kSubset_Mode:
241 folder.append("codec_subset"); 241 folder.append("codec_subset");
242 break; 242 break;
243 case CodecSrc::kYUV_Mode:
244 folder.append("yuv");
245 break;
243 } 246 }
244 247
245 switch (dstColorType) { 248 switch (dstColorType) {
246 case CodecSrc::kGrayscale_Always_DstColorType: 249 case CodecSrc::kGrayscale_Always_DstColorType:
247 folder.append("_kGray8"); 250 folder.append("_kGray8");
248 break; 251 break;
249 case CodecSrc::kIndex8_Always_DstColorType: 252 case CodecSrc::kIndex8_Always_DstColorType:
250 folder.append("_kIndex8"); 253 folder.append("_kIndex8");
251 break; 254 break;
252 default: 255 default:
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 return; 307 return;
305 } 308 }
306 309
307 // Native Scales 310 // Native Scales
308 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these 311 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these
309 // tests. SkImageDecoder supports downscales by integer fac tors. 312 // tests. SkImageDecoder supports downscales by integer fac tors.
310 // SkJpegCodec natively supports scaling to: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875 313 // SkJpegCodec natively supports scaling to: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875
311 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f, 1.0f }; 314 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f, 1.0f };
312 315
313 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kSca nline_Mode, 316 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kSca nline_Mode,
314 CodecSrc::kStripe_Mode, CodecSrc::kSubset_Mode }; 317 CodecSrc::kStripe_Mode, CodecSrc::kSubset_Mode, CodecSrc::kYUV_Mode };
315 318
316 CodecSrc::DstColorType colorTypes[3]; 319 CodecSrc::DstColorType colorTypes[3];
317 uint32_t numColorTypes; 320 uint32_t numColorTypes;
318 switch (codec->getInfo().colorType()) { 321 switch (codec->getInfo().colorType()) {
319 case kGray_8_SkColorType: 322 case kGray_8_SkColorType:
320 // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8? 323 // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8?
321 // Further discussion on this topic is at https://bug.skia.org/3683 . 324 // Further discussion on this topic is at https://bug.skia.org/3683 .
322 // This causes us to try to convert grayscale jpegs to kIndex8. We currently 325 // This causes us to try to convert grayscale jpegs to kIndex8. We currently
323 // fail non-fatally in this case. 326 // fail non-fatally in this case.
324 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; 327 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType;
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 Reporter* reporter, 1221 Reporter* reporter,
1219 GrContextFactory* fac tory); 1222 GrContextFactory* fac tory);
1220 } // namespace skiatest 1223 } // namespace skiatest
1221 1224
1222 #if !defined(SK_BUILD_FOR_IOS) 1225 #if !defined(SK_BUILD_FOR_IOS)
1223 int main(int argc, char** argv) { 1226 int main(int argc, char** argv) {
1224 SkCommandLineFlags::Parse(argc, argv); 1227 SkCommandLineFlags::Parse(argc, argv);
1225 return dm_main(); 1228 return dm_main();
1226 } 1229 }
1227 #endif 1230 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | dm/DMSrcSink.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698