| OLD | NEW |
| 1 #include "SkCanvas.h" | 1 #include "SkCanvas.h" |
| 2 #include "SkCommandLineFlags.h" | 2 #include "SkCommandLineFlags.h" |
| 3 #include "SkDevice.h" | 3 #include "SkDevice.h" |
| 4 #include "SkGraphics.h" | 4 #include "SkGraphics.h" |
| 5 #include "SkImageDecoder.h" | 5 #include "SkImageDecoder.h" |
| 6 #include "SkImageEncoder.h" | 6 #include "SkImageEncoder.h" |
| 7 #include "SkOSFile.h" | 7 #include "SkOSFile.h" |
| 8 #include "SkPicture.h" | 8 #include "SkPicture.h" |
| 9 #include "SkStream.h" | 9 #include "SkStream.h" |
| 10 #include "SkTypeface.h" | 10 #include "SkTypeface.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 if (page >= 0) { | 77 if (page >= 0) { |
| 78 path->appendf("%i.", page); | 78 path->appendf("%i.", page); |
| 79 } | 79 } |
| 80 path->append(new_extension); | 80 path->append(new_extension); |
| 81 return true; | 81 return true; |
| 82 } | 82 } |
| 83 return false; | 83 return false; |
| 84 } | 84 } |
| 85 | 85 |
| 86 void make_filepath(SkString* path, const SkString& dir, const SkString& name) { | 86 static void make_filepath(SkString* path, const SkString& dir, const SkString& n
ame) { |
| 87 size_t len = dir.size(); | 87 size_t len = dir.size(); |
| 88 path->set(dir); | 88 path->set(dir); |
| 89 if (0 < len && '/' != dir[len - 1]) { | 89 if (0 < len && '/' != dir[len - 1]) { |
| 90 path->append("/"); | 90 path->append("/"); |
| 91 } | 91 } |
| 92 path->append(name); | 92 path->append(name); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool is_path_seperator(const char chr) { | 95 static bool is_path_seperator(const char chr) { |
| 96 #if defined(SK_BUILD_FOR_WIN) | 96 #if defined(SK_BUILD_FOR_WIN) |
| 97 return chr == '\\' || chr == '/'; | 97 return chr == '\\' || chr == '/'; |
| 98 #else | 98 #else |
| 99 return chr == '/'; | 99 return chr == '/'; |
| 100 #endif | 100 #endif |
| 101 } | 101 } |
| 102 | 102 |
| 103 void get_basename(SkString* basename, const SkString& path) { | 103 static void get_basename(SkString* basename, const SkString& path) { |
| 104 if (path.size() == 0) { | 104 if (path.size() == 0) { |
| 105 basename->reset(); | 105 basename->reset(); |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 | 108 |
| 109 size_t end = path.size() - 1; | 109 size_t end = path.size() - 1; |
| 110 | 110 |
| 111 // Paths pointing to directories often have a trailing slash, | 111 // Paths pointing to directories often have a trailing slash, |
| 112 // we remove it so the name is not empty | 112 // we remove it so the name is not empty |
| 113 if (is_path_seperator(path[end])) { | 113 if (is_path_seperator(path[end])) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 372 } |
| 373 | 373 |
| 374 return 0; | 374 return 0; |
| 375 } | 375 } |
| 376 | 376 |
| 377 #if !defined SK_BUILD_FOR_IOS | 377 #if !defined SK_BUILD_FOR_IOS |
| 378 int main(int argc, char * const argv[]) { | 378 int main(int argc, char * const argv[]) { |
| 379 return tool_main(argc, (char**) argv); | 379 return tool_main(argc, (char**) argv); |
| 380 } | 380 } |
| 381 #endif | 381 #endif |
| OLD | NEW |