OLD | NEW |
1 // Main binary for DM. | 1 // Main binary for DM. |
2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
3 | 3 |
4 #include "CrashHandler.h" | 4 #include "CrashHandler.h" |
| 5 #include "LazyDecodeBitmap.h" |
5 #include "SkCommonFlags.h" | 6 #include "SkCommonFlags.h" |
6 #include "SkForceLinking.h" | 7 #include "SkForceLinking.h" |
7 #include "SkGraphics.h" | 8 #include "SkGraphics.h" |
8 #include "SkPicture.h" | 9 #include "SkPicture.h" |
9 #include "SkString.h" | 10 #include "SkString.h" |
10 #include "Test.h" | 11 #include "Test.h" |
11 #include "gm.h" | 12 #include "gm.h" |
12 #include "sk_tool_utils.h" | 13 #include "sk_tool_utils.h" |
13 #include "sk_tool_utils_flags.h" | 14 #include "sk_tool_utils_flags.h" |
14 | 15 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 137 } |
137 | 138 |
138 static void kick_off_skps(const SkTArray<SkString>& skps, | 139 static void kick_off_skps(const SkTArray<SkString>& skps, |
139 DM::Reporter* reporter, DM::TaskRunner* tasks) { | 140 DM::Reporter* reporter, DM::TaskRunner* tasks) { |
140 for (int i = 0; i < skps.count(); ++i) { | 141 for (int i = 0; i < skps.count(); ++i) { |
141 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str())); | 142 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str())); |
142 if (stream.get() == NULL) { | 143 if (stream.get() == NULL) { |
143 SkDebugf("Could not read %s.\n", skps[i].c_str()); | 144 SkDebugf("Could not read %s.\n", skps[i].c_str()); |
144 exit(1); | 145 exit(1); |
145 } | 146 } |
146 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get())); | 147 SkAutoTUnref<SkPicture> pic( |
| 148 SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeB
itmap)); |
147 if (pic.get() == NULL) { | 149 if (pic.get() == NULL) { |
148 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str()); | 150 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str()); |
149 exit(1); | 151 exit(1); |
150 } | 152 } |
151 | 153 |
152 SkString filename = SkOSPath::Basename(skps[i].c_str()); | 154 SkString filename = SkOSPath::Basename(skps[i].c_str()); |
153 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename))); | 155 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename))); |
154 tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename, | 156 tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename, |
155 RASTERIZE_PDF_PROC))); | 157 RASTERIZE_PDF_PROC))); |
156 } | 158 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 report_failures(failures); | 253 report_failures(failures); |
252 return failures.count() > 0; | 254 return failures.count() > 0; |
253 } | 255 } |
254 | 256 |
255 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 257 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
256 int main(int argc, char** argv) { | 258 int main(int argc, char** argv) { |
257 SkCommandLineFlags::Parse(argc, argv); | 259 SkCommandLineFlags::Parse(argc, argv); |
258 return dm_main(); | 260 return dm_main(); |
259 } | 261 } |
260 #endif | 262 #endif |
OLD | NEW |