| 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 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 // #include "OverwriteLine.h" | 9 // #include "OverwriteLine.h" |
| 10 #include "Resources.h" | 10 #include "Resources.h" |
| 11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
| 12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
| 13 #include "SkColor.h" | 13 #include "SkColor.h" |
| 14 #include "SkColorPriv.h" | 14 #include "SkColorPriv.h" |
| 15 #include "SkCommandLineFlags.h" | 15 #include "SkCommandLineFlags.h" |
| 16 #include "SkDevice.h" | 16 #include "SkDevice.h" |
| 17 #include "SkForceLinking.h" | 17 #include "SkForceLinking.h" |
| 18 #include "SkGraphics.h" | 18 #include "SkGraphics.h" |
| 19 #include "SkImageDecoder.h" | |
| 20 #include "SkImageEncoder.h" | 19 #include "SkImageEncoder.h" |
| 21 #include "SkOSFile.h" | 20 #include "SkOSFile.h" |
| 22 #include "SkPathOpsDebug.h" | 21 #include "SkPathOpsDebug.h" |
| 23 #include "SkPicture.h" | 22 #include "SkPicture.h" |
| 24 #include "SkRTConf.h" | 23 #include "SkRTConf.h" |
| 25 #include "SkTSort.h" | 24 #include "SkTSort.h" |
| 26 #include "SkStream.h" | 25 #include "SkStream.h" |
| 27 #include "SkString.h" | 26 #include "SkString.h" |
| 28 #include "SkTArray.h" | 27 #include "SkTArray.h" |
| 29 #include "SkTDArray.h" | 28 #include "SkTDArray.h" |
| 30 #include "SkTaskGroup.h" | 29 #include "SkTaskGroup.h" |
| 31 #include "SkTemplates.h" | 30 #include "SkTemplates.h" |
| 32 #include "SkTime.h" | 31 #include "SkTime.h" |
| 33 | 32 |
| 34 #include <stdlib.h> | 33 #include <stdlib.h> |
| 35 | 34 |
| 36 __SK_FORCE_IMAGE_DECODER_LINKING; | |
| 37 | |
| 38 /* add local exceptions here */ | 35 /* add local exceptions here */ |
| 39 /* TODO : add command flag interface */ | 36 /* TODO : add command flag interface */ |
| 40 const struct SkipOverTest { | 37 const struct SkipOverTest { |
| 41 int directory; | 38 int directory; |
| 42 const char* filename; | 39 const char* filename; |
| 43 bool blamePathOps; | 40 bool blamePathOps; |
| 44 } skipOver[] = { | 41 } skipOver[] = { |
| 45 { 2, "http___www_groupon_sg_.skp", false}, // SkAAClip::Builder::addRun SkA
SSERT(fBounds.contains(x, y)); | 42 { 2, "http___www_groupon_sg_.skp", false}, // SkAAClip::Builder::addRun SkA
SSERT(fBounds.contains(x, y)); |
| 46 { 6, "http___www_googleventures_com_.skp", true}, // addTCoincident SkASSER
T(test->fT < 1); | 43 { 6, "http___www_googleventures_com_.skp", true}, // addTCoincident SkASSER
T(test->fT < 1); |
| 47 { 7, "http___www_foxsports_nl_.skp", true}, // (no repro on mac) addT SkASS
ERT(this != other || fVerb == SkPath::kCubic_Verb) | 44 { 7, "http___www_foxsports_nl_.skp", true}, // (no repro on mac) addT SkASS
ERT(this != other || fVerb == SkPath::kCubic_Verb) |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 } else if (fTestStep == kEncodeFiles) { | 460 } else if (fTestStep == kEncodeFiles) { |
| 464 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); | 461 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); |
| 465 } | 462 } |
| 466 #endif | 463 #endif |
| 467 SkString path = get_in_path(fDirNo, fFilename); | 464 SkString path = get_in_path(fDirNo, fFilename); |
| 468 SkFILEStream stream(path.c_str()); | 465 SkFILEStream stream(path.c_str()); |
| 469 if (!stream.isValid()) { | 466 if (!stream.isValid()) { |
| 470 SkDebugf("invalid stream %s\n", path.c_str()); | 467 SkDebugf("invalid stream %s\n", path.c_str()); |
| 471 goto finish; | 468 goto finish; |
| 472 } | 469 } |
| 473 pic = SkPicture::CreateFromStream(&stream, &SkImageDecoder::DecodeMemory
); | 470 pic = SkPicture::CreateFromStream(&stream); |
| 474 if (!pic) { | 471 if (!pic) { |
| 475 SkDebugf("unable to decode %s\n", fFilename); | 472 SkDebugf("unable to decode %s\n", fFilename); |
| 476 goto finish; | 473 goto finish; |
| 477 } | 474 } |
| 478 SkScalar width = pic->cullRect().width(); | 475 SkScalar width = pic->cullRect().width(); |
| 479 SkScalar height = pic->cullRect().height(); | 476 SkScalar height = pic->cullRect().height(); |
| 480 SkBitmap oldBitmap, opBitmap; | 477 SkBitmap oldBitmap, opBitmap; |
| 481 fScale = 1; | 478 fScale = 1; |
| 482 while (width / fScale > 32767 || height / fScale > 32767) { | 479 while (width / fScale > 32767 || height / fScale > 32767) { |
| 483 ++fScale; | 480 ++fScale; |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 } | 1097 } |
| 1101 } | 1098 } |
| 1102 return 0; | 1099 return 0; |
| 1103 } | 1100 } |
| 1104 | 1101 |
| 1105 #if !defined(SK_BUILD_FOR_IOS) | 1102 #if !defined(SK_BUILD_FOR_IOS) |
| 1106 int main(int argc, char * const argv[]) { | 1103 int main(int argc, char * const argv[]) { |
| 1107 return tool_main(argc, (char**) argv); | 1104 return tool_main(argc, (char**) argv); |
| 1108 } | 1105 } |
| 1109 #endif | 1106 #endif |
| OLD | NEW |