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

Side by Side Diff: tools/skdiff_image.cpp

Issue 1788643003: Remove uses of SkImageDecoder from skdiff (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | tools/skdiff_main.cpp » ('j') | tools/skdiff_main.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 #include "skdiff.h" 7 #include "skdiff.h"
8 #include "skdiff_utils.h" 8 #include "skdiff_utils.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkImageDecoder.h"
12 #include "SkImageEncoder.h" 11 #include "SkImageEncoder.h"
13 #include "SkOSFile.h" 12 #include "SkOSFile.h"
14 #include "SkTDArray.h" 13 #include "SkTDArray.h"
15 #include "SkTemplates.h" 14 #include "SkTemplates.h"
16 #include "SkTypes.h" 15 #include "SkTypes.h"
17 16
18 #include <stdio.h> 17 #include <stdio.h>
19 18
20 /// If outputDir.isEmpty(), don't write out diff files. 19 /// If outputDir.isEmpty(), don't write out diff files.
21 static void create_diff_images (DiffMetricProc dmp, 20 static void create_diff_images (DiffMetricProc dmp,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 52 }
54 drp->fResult = DiffRecord::kCouldNotCompare_Result; 53 drp->fResult = DiffRecord::kCouldNotCompare_Result;
55 return; 54 return;
56 } 55 }
57 56
58 if (are_buffers_equal(baseFileBits, comparisonFileBits)) { 57 if (are_buffers_equal(baseFileBits, comparisonFileBits)) {
59 drp->fResult = DiffRecord::kEqualBits_Result; 58 drp->fResult = DiffRecord::kEqualBits_Result;
60 return; 59 return;
61 } 60 }
62 61
63 get_bitmap(baseFileBits, drp->fBase, SkImageDecoder::kDecodePixels_Mode); 62 get_bitmap(baseFileBits, drp->fBase, false);
64 get_bitmap(comparisonFileBits, drp->fComparison, SkImageDecoder::kDecodePixe ls_Mode); 63 get_bitmap(comparisonFileBits, drp->fComparison, false);
65 if (DiffResource::kDecoded_Status != drp->fBase.fStatus || 64 if (DiffResource::kDecoded_Status != drp->fBase.fStatus ||
66 DiffResource::kDecoded_Status != drp->fComparison.fStatus) 65 DiffResource::kDecoded_Status != drp->fComparison.fStatus)
67 { 66 {
68 drp->fResult = DiffRecord::kCouldNotCompare_Result; 67 drp->fResult = DiffRecord::kCouldNotCompare_Result;
69 return; 68 return;
70 } 69 }
71 70
72 create_and_write_diff_image(drp, dmp, colorThreshold, outputDir, outputFilen ame); 71 create_and_write_diff_image(drp, dmp, colorThreshold, outputDir, outputFilen ame);
73 //TODO: copy fBase.fFilename and fComparison.fFilename to outputDir 72 //TODO: copy fBase.fFilename and fComparison.fFilename to outputDir
74 // svn and git often present tmp files to diff tools which are promptly deleted 73 // svn and git often present tmp files to diff tools which are promptly deleted
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 367 }
369 368
370 return num_failing_results; 369 return num_failing_results;
371 } 370 }
372 371
373 #if !defined SK_BUILD_FOR_IOS 372 #if !defined SK_BUILD_FOR_IOS
374 int main(int argc, char * const argv[]) { 373 int main(int argc, char * const argv[]) {
375 return tool_main(argc, (char**) argv); 374 return tool_main(argc, (char**) argv);
376 } 375 }
377 #endif 376 #endif
OLDNEW
« no previous file with comments | « no previous file | tools/skdiff_main.cpp » ('j') | tools/skdiff_main.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698