| 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_expectations.h" | 18 #include "gm_expectations.h" |
| 18 #include "system_preferences.h" | 19 #include "system_preferences.h" |
| 19 #include "SkBitmap.h" | 20 #include "SkBitmap.h" |
| 20 #include "SkBitmapChecksummer.h" | 21 #include "SkBitmapChecksummer.h" |
| 21 #include "SkColorPriv.h" | 22 #include "SkColorPriv.h" |
| 22 #include "SkData.h" | 23 #include "SkData.h" |
| 23 #include "SkDeferredCanvas.h" | 24 #include "SkDeferredCanvas.h" |
| 24 #include "SkDevice.h" | 25 #include "SkDevice.h" |
| 25 #include "SkDrawFilter.h" | 26 #include "SkDrawFilter.h" |
| 26 #include "SkFlags.h" | 27 #include "SkFlags.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #include "SkXPSDevice.h" | 74 #include "SkXPSDevice.h" |
| 74 #endif | 75 #endif |
| 75 | 76 |
| 76 #ifdef SK_BUILD_FOR_MAC | 77 #ifdef SK_BUILD_FOR_MAC |
| 77 #include "SkCGUtils.h" | 78 #include "SkCGUtils.h" |
| 78 #define CAN_IMAGE_PDF 1 | 79 #define CAN_IMAGE_PDF 1 |
| 79 #else | 80 #else |
| 80 #define CAN_IMAGE_PDF 0 | 81 #define CAN_IMAGE_PDF 0 |
| 81 #endif | 82 #endif |
| 82 | 83 |
| 83 typedef int ErrorBitfield; | |
| 84 // an empty bitfield means no errors: | |
| 85 const static ErrorBitfield kEmptyErrorBitfield = 0x00; | |
| 86 // individual error types: | |
| 87 const static ErrorBitfield kNoGpuContext_ErrorBitmask = 0x01; | |
| 88 const static ErrorBitfield kImageMismatch_ErrorBitmask = 0x02; | |
| 89 const static ErrorBitfield kMissingExpectations_ErrorBitmask = 0x04; | |
| 90 const static ErrorBitfield kWritingReferenceImage_ErrorBitmask = 0x08; | |
| 91 // we typically ignore any errors matching this bitmask: | |
| 92 const static ErrorBitfield kIgnorable_ErrorBitmask = kMissingExpectations_ErrorB
itmask; | |
| 93 | |
| 94 using namespace skiagm; | 84 using namespace skiagm; |
| 95 | 85 |
| 96 struct FailRec { | 86 struct FailRec { |
| 97 SkString fName; | 87 SkString fName; |
| 98 bool fIsPixelError; | 88 bool fIsPixelError; |
| 99 | 89 |
| 100 FailRec() : fIsPixelError(false) {} | 90 FailRec() : fIsPixelError(false) {} |
| 101 FailRec(const SkString& name) : fName(name), fIsPixelError(false) {} | 91 FailRec(const SkString& name) : fName(name), fIsPixelError(false) {} |
| 102 }; | 92 }; |
| 103 | 93 |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 if (FLAGS_forceBWtext) { | 1651 if (FLAGS_forceBWtext) { |
| 1662 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 1652 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 1663 } | 1653 } |
| 1664 } | 1654 } |
| 1665 | 1655 |
| 1666 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 1656 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 1667 int main(int argc, char * const argv[]) { | 1657 int main(int argc, char * const argv[]) { |
| 1668 return tool_main(argc, (char**) argv); | 1658 return tool_main(argc, (char**) argv); |
| 1669 } | 1659 } |
| 1670 #endif | 1660 #endif |
| OLD | NEW |