| 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 #define __NO_STD_VECTOR // Uses cl::vectpr instead of std::vectpr | 8 #define __NO_STD_VECTOR // Uses cl::vectpr instead of std::vectpr |
| 9 #define __NO_STD_STRING // Uses cl::STRING_CLASS instead of std::string | 9 #define __NO_STD_STRING // Uses cl::STRING_CLASS instead of std::string |
| 10 #include <CL/cl.hpp> | 10 #include <CL/cl.hpp> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 #include "SkForceLinking.h" | 23 #include "SkForceLinking.h" |
| 24 __SK_FORCE_IMAGE_DECODER_LINKING; | 24 __SK_FORCE_IMAGE_DECODER_LINKING; |
| 25 | 25 |
| 26 // Command line argument definitions go here | 26 // Command line argument definitions go here |
| 27 DEFINE_bool2(list, l, false, "List out available differs"); | 27 DEFINE_bool2(list, l, false, "List out available differs"); |
| 28 DEFINE_string2(differs, d, "", "The names of the differs to use or all of them b
y default"); | 28 DEFINE_string2(differs, d, "", "The names of the differs to use or all of them b
y default"); |
| 29 DEFINE_string2(folders, f, "", "Compare two folders with identical subfile names
: <baseline folder> <test folder>"); | 29 DEFINE_string2(folders, f, "", "Compare two folders with identical subfile names
: <baseline folder> <test folder>"); |
| 30 DEFINE_string2(patterns, p, "", "Use two patterns to compare images: <baseline>
<test>"); | 30 DEFINE_string2(patterns, p, "", "Use two patterns to compare images: <baseline>
<test>"); |
| 31 DEFINE_string2(output, o, "skpdiff_output.json", "Writes the output of these dif
fs to output: <output>"); | 31 DEFINE_string2(output, o, "skpdiff_output.json", "Writes the output of these dif
fs to output: <output>"); |
| 32 DEFINE_bool(jsonp, true, "Output JSON with padding"); |
| 32 | 33 |
| 33 /// A callback for any OpenCL errors | 34 /// A callback for any OpenCL errors |
| 34 CL_CALLBACK void error_notify(const char* errorInfo, const void* privateInfoSize
, ::size_t cb, void* userData) { | 35 CL_CALLBACK void error_notify(const char* errorInfo, const void* privateInfoSize
, ::size_t cb, void* userData) { |
| 35 SkDebugf("OpenCL error notify: %s\n", errorInfo); | 36 SkDebugf("OpenCL error notify: %s\n", errorInfo); |
| 36 exit(1); | 37 exit(1); |
| 37 } | 38 } |
| 38 | 39 |
| 39 /// Creates a device and context with OpenCL | 40 /// Creates a device and context with OpenCL |
| 40 static bool init_device_and_context(cl::Device* device, cl::Context* context) { | 41 static bool init_device_and_context(cl::Device* device, cl::Context* context) { |
| 41 // Query for a platform | 42 // Query for a platform |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 175 } |
| 175 | 176 |
| 176 // Perform a pattern diff if one is requested | 177 // Perform a pattern diff if one is requested |
| 177 if (!FLAGS_patterns.isEmpty()) { | 178 if (!FLAGS_patterns.isEmpty()) { |
| 178 ctx.diffPatterns(FLAGS_patterns[0], FLAGS_patterns[1]); | 179 ctx.diffPatterns(FLAGS_patterns[0], FLAGS_patterns[1]); |
| 179 } | 180 } |
| 180 | 181 |
| 181 // Output to the file specified | 182 // Output to the file specified |
| 182 if (!FLAGS_output.isEmpty()) { | 183 if (!FLAGS_output.isEmpty()) { |
| 183 SkFILEWStream outputStream(FLAGS_output[0]); | 184 SkFILEWStream outputStream(FLAGS_output[0]); |
| 184 ctx.outputRecords(outputStream); | 185 ctx.outputRecords(outputStream, FLAGS_jsonp); |
| 185 } | 186 } |
| 186 | 187 |
| 187 return 0; | 188 return 0; |
| 188 } | 189 } |
| OLD | NEW |