| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2011 Google Inc. | 2  * Copyright 2011 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 /* | 8 /* | 
| 9  * Code for the "gm" (Golden Master) rendering comparison tool. | 9  * Code for the "gm" (Golden Master) rendering comparison tool. | 
| 10  * | 10  * | 
| 11  * If you make changes to this, re-run the self-tests at gm/tests/run.sh | 11  * If you make changes to this, re-run the self-tests at gm/tests/run.sh | 
| 12  * to make sure they still pass... you may need to change the expected | 12  * to make sure they still pass... you may need to change the expected | 
| 13  * results of the self-test. | 13  * results of the self-test. | 
| 14  */ | 14  */ | 
| 15 | 15 | 
| 16 #include "gm.h" | 16 #include "gm.h" | 
| 17 #include "gm_error.h" | 17 #include "gm_error.h" | 
| 18 #include "gm_expectations.h" | 18 #include "gm_expectations.h" | 
| 19 #include "system_preferences.h" | 19 #include "system_preferences.h" | 
|  | 20 #include "CrashHandler.h" | 
| 20 #include "SkBitmap.h" | 21 #include "SkBitmap.h" | 
| 21 #include "SkColorPriv.h" | 22 #include "SkColorPriv.h" | 
| 22 #include "SkCommandLineFlags.h" | 23 #include "SkCommandLineFlags.h" | 
| 23 #include "SkData.h" | 24 #include "SkData.h" | 
| 24 #include "SkDeferredCanvas.h" | 25 #include "SkDeferredCanvas.h" | 
| 25 #include "SkDevice.h" | 26 #include "SkDevice.h" | 
| 26 #include "SkDocument.h" | 27 #include "SkDocument.h" | 
| 27 #include "SkDrawFilter.h" | 28 #include "SkDrawFilter.h" | 
| 28 #include "SkForceLinking.h" | 29 #include "SkForceLinking.h" | 
| 29 #include "SkGPipe.h" | 30 #include "SkGPipe.h" | 
| (...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2222 static bool parse_flags_jpeg_quality() { | 2223 static bool parse_flags_jpeg_quality() { | 
| 2223     if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) { | 2224     if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) { | 
| 2224         SkDebugf("%s\n", "pdfJpegQuality must be in [-1 .. 100] range."); | 2225         SkDebugf("%s\n", "pdfJpegQuality must be in [-1 .. 100] range."); | 
| 2225         return false; | 2226         return false; | 
| 2226     } | 2227     } | 
| 2227     return true; | 2228     return true; | 
| 2228 } | 2229 } | 
| 2229 | 2230 | 
| 2230 int tool_main(int argc, char** argv); | 2231 int tool_main(int argc, char** argv); | 
| 2231 int tool_main(int argc, char** argv) { | 2232 int tool_main(int argc, char** argv) { | 
|  | 2233     SetupCrashHandler(); | 
| 2232 | 2234 | 
| 2233     SkString usage; | 2235     SkString usage; | 
| 2234     usage.printf("Run the golden master tests.\n"); | 2236     usage.printf("Run the golden master tests.\n"); | 
| 2235     SkCommandLineFlags::SetUsage(usage.c_str()); | 2237     SkCommandLineFlags::SetUsage(usage.c_str()); | 
| 2236     SkCommandLineFlags::Parse(argc, argv); | 2238     SkCommandLineFlags::Parse(argc, argv); | 
| 2237 | 2239 | 
| 2238 #if SK_ENABLE_INST_COUNT | 2240 #if SK_ENABLE_INST_COUNT | 
| 2239     if (FLAGS_leaks) { | 2241     if (FLAGS_leaks) { | 
| 2240         gPrintInstCount = true; | 2242         gPrintInstCount = true; | 
| 2241     } | 2243     } | 
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2463     if (FLAGS_forceBWtext) { | 2465     if (FLAGS_forceBWtext) { | 
| 2464         canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2466         canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 
| 2465     } | 2467     } | 
| 2466 } | 2468 } | 
| 2467 | 2469 | 
| 2468 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2470 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 
| 2469 int main(int argc, char * const argv[]) { | 2471 int main(int argc, char * const argv[]) { | 
| 2470     return tool_main(argc, (char**) argv); | 2472     return tool_main(argc, (char**) argv); | 
| 2471 } | 2473 } | 
| 2472 #endif | 2474 #endif | 
| OLD | NEW | 
|---|