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 "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 !SkCommandLineFlags::ShouldSkip(FLAGS_match, src->name().c_str())) { | 146 !SkCommandLineFlags::ShouldSkip(FLAGS_match, src->name().c_str())) { |
147 Tagged<Src>& s = gSrcs.push_back(); | 147 Tagged<Src>& s = gSrcs.push_back(); |
148 s.reset(src.detach()); | 148 s.reset(src.detach()); |
149 s.tag = tag; | 149 s.tag = tag; |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 static bool codec_supported(const char* ext) { | 153 static bool codec_supported(const char* ext) { |
154 // FIXME: Once other versions of SkCodec are available, we can add them to t his | 154 // FIXME: Once other versions of SkCodec are available, we can add them to t his |
155 // list (and eventually we can remove this check once they are all supported ). | 155 // list (and eventually we can remove this check once they are all supported ). |
156 return strcmp(ext, "png") == 0 || strcmp(ext, "PNG") == 0 || | 156 static const char* const exts[] = { |
157 strcmp(ext, "bmp") == 0 || strcmp(ext, "BMP") == 0 || | 157 "bmp", "gif", "png", "webp", "ico", |
scroggo
2015/03/25 19:44:48
We don't support webp yet.
msarett
2015/03/26 19:15:55
Yeah you're right. Copy paste error.
| |
158 strcmp(ext, "ico") == 0 || strcmp(ext, "ICO") == 0; | 158 "BMP", "GIF", "PNG", "WEBP", "ICO", |
159 }; | |
160 | |
161 for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { | |
162 if (0 == strcmp(exts[i], ext)) { | |
163 return true; | |
164 } | |
165 } | |
166 return false; | |
159 } | 167 } |
160 | 168 |
161 static void gather_srcs() { | 169 static void gather_srcs() { |
162 for (const skiagm::GMRegistry* r = skiagm::GMRegistry::Head(); r; r = r->nex t()) { | 170 for (const skiagm::GMRegistry* r = skiagm::GMRegistry::Head(); r; r = r->nex t()) { |
163 push_src("gm", new GMSrc(r->factory())); | 171 push_src("gm", new GMSrc(r->factory())); |
164 } | 172 } |
165 for (int i = 0; i < FLAGS_skps.count(); i++) { | 173 for (int i = 0; i < FLAGS_skps.count(); i++) { |
166 const char* path = FLAGS_skps[i]; | 174 const char* path = FLAGS_skps[i]; |
167 if (sk_isdir(path)) { | 175 if (sk_isdir(path)) { |
168 SkOSFile::Iter it(path, "skp"); | 176 SkOSFile::Iter it(path, "skp"); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 } | 654 } |
647 return 0; | 655 return 0; |
648 } | 656 } |
649 | 657 |
650 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 658 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
651 int main(int argc, char** argv) { | 659 int main(int argc, char** argv) { |
652 SkCommandLineFlags::Parse(argc, argv); | 660 SkCommandLineFlags::Parse(argc, argv); |
653 return dm_main(); | 661 return dm_main(); |
654 } | 662 } |
655 #endif | 663 #endif |
OLD | NEW |