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

Side by Side Diff: dm/DM.cpp

Issue 1530933003: Use possible read_partial_scanlines() API in SkJpegCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments and further testing 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 | 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp e dstColorType, 227 static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp e dstColorType,
228 float scale) { 228 float scale) {
229 SkString folder; 229 SkString folder;
230 switch (mode) { 230 switch (mode) {
231 case CodecSrc::kCodec_Mode: 231 case CodecSrc::kCodec_Mode:
232 folder.append("codec"); 232 folder.append("codec");
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::kTile_Mode:
238 folder.append("stripe"); 238 folder.append("tile");
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 } 243 }
244 244
245 switch (dstColorType) { 245 switch (dstColorType) {
246 case CodecSrc::kGrayscale_Always_DstColorType: 246 case CodecSrc::kGrayscale_Always_DstColorType:
247 folder.append("_kGray8"); 247 folder.append("_kGray8");
248 break; 248 break;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 return; 304 return;
305 } 305 }
306 306
307 // Native Scales 307 // Native Scales
308 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these 308 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co mpare with these
309 // tests. SkImageDecoder supports downscales by integer fac tors. 309 // 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 310 // 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 }; 311 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f, 1.0f };
312 312
313 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kSca nline_Mode, 313 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kSca nline_Mode,
314 CodecSrc::kStripe_Mode, CodecSrc::kSubset_Mode }; 314 CodecSrc::kTile_Mode, CodecSrc::kSubset_Mode };
315 315
316 CodecSrc::DstColorType colorTypes[3]; 316 CodecSrc::DstColorType colorTypes[3];
317 uint32_t numColorTypes; 317 uint32_t numColorTypes;
318 switch (codec->getInfo().colorType()) { 318 switch (codec->getInfo().colorType()) {
319 case kGray_8_SkColorType: 319 case kGray_8_SkColorType:
320 // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8? 320 // 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 . 321 // 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 322 // This causes us to try to convert grayscale jpegs to kIndex8. We currently
323 // fail non-fatally in this case. 323 // fail non-fatally in this case.
324 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; 324 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType;
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 Reporter* reporter, 1218 Reporter* reporter,
1219 GrContextFactory* fac tory); 1219 GrContextFactory* fac tory);
1220 } // namespace skiatest 1220 } // namespace skiatest
1221 1221
1222 #if !defined(SK_BUILD_FOR_IOS) 1222 #if !defined(SK_BUILD_FOR_IOS)
1223 int main(int argc, char** argv) { 1223 int main(int argc, char** argv) {
1224 SkCommandLineFlags::Parse(argc, argv); 1224 SkCommandLineFlags::Parse(argc, argv);
1225 return dm_main(); 1225 return dm_main();
1226 } 1226 }
1227 #endif 1227 #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