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

Side by Side Diff: dm/DM.cpp

Issue 1577853004: Add CodecZeroInit test to DMSrcSink (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix comment 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') | 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 } 226 }
227 227
228 static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp e dstColorType, 228 static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp e dstColorType,
229 float scale) { 229 float scale) {
230 SkString folder; 230 SkString folder;
231 switch (mode) { 231 switch (mode) {
232 case CodecSrc::kCodec_Mode: 232 case CodecSrc::kCodec_Mode:
233 folder.append("codec"); 233 folder.append("codec");
234 break; 234 break;
235 case CodecSrc::kCodecZeroInit_Mode:
236 folder.append("codec_zero_init");
237 break;
235 case CodecSrc::kScanline_Mode: 238 case CodecSrc::kScanline_Mode:
236 folder.append("scanline"); 239 folder.append("scanline");
237 break; 240 break;
238 case CodecSrc::kStripe_Mode: 241 case CodecSrc::kStripe_Mode:
239 folder.append("stripe"); 242 folder.append("stripe");
240 break; 243 break;
241 case CodecSrc::kSubset_Mode: 244 case CodecSrc::kSubset_Mode:
242 folder.append("codec_subset"); 245 folder.append("codec_subset");
243 break; 246 break;
244 } 247 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 SkDebugf("Couldn't create codec for %s.", path.c_str()); 307 SkDebugf("Couldn't create codec for %s.", path.c_str());
305 return; 308 return;
306 } 309 }
307 310
308 // Native Scales 311 // Native Scales
309 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these 312 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these
310 // tests. SkImageDecoder supports downscales by integer fac tors. 313 // tests. SkImageDecoder supports downscales by integer fac tors.
311 // SkJpegCodec natively supports scaling to: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875 314 // SkJpegCodec natively supports scaling to: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875
312 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f, 1.0f }; 315 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f, 1.0f };
313 316
314 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kSca nline_Mode, 317 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kCod ecZeroInit_Mode,
315 CodecSrc::kStripe_Mode, CodecSrc::kSubset_Mode }; 318 CodecSrc::kScanline_Mode, CodecSrc::kStripe_Mode, CodecSrc::kSubset_ Mode };
316 319
317 CodecSrc::DstColorType colorTypes[3]; 320 CodecSrc::DstColorType colorTypes[3];
318 uint32_t numColorTypes; 321 uint32_t numColorTypes;
319 switch (codec->getInfo().colorType()) { 322 switch (codec->getInfo().colorType()) {
320 case kGray_8_SkColorType: 323 case kGray_8_SkColorType:
321 // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8? 324 // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8?
322 // Further discussion on this topic is at https://bug.skia.org/3683 . 325 // Further discussion on this topic is at https://bug.skia.org/3683 .
323 // This causes us to try to convert grayscale jpegs to kIndex8. We currently 326 // This causes us to try to convert grayscale jpegs to kIndex8. We currently
324 // fail non-fatally in this case. 327 // fail non-fatally in this case.
325 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; 328 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType;
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 Reporter* reporter, 1243 Reporter* reporter,
1241 GrContextFactory* fac tory); 1244 GrContextFactory* fac tory);
1242 } // namespace skiatest 1245 } // namespace skiatest
1243 1246
1244 #if !defined(SK_BUILD_FOR_IOS) 1247 #if !defined(SK_BUILD_FOR_IOS)
1245 int main(int argc, char** argv) { 1248 int main(int argc, char** argv) {
1246 SkCommandLineFlags::Parse(argc, argv); 1249 SkCommandLineFlags::Parse(argc, argv);
1247 return dm_main(); 1250 return dm_main();
1248 } 1251 }
1249 #endif 1252 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698