OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
9 #include "SkPicture.h" | 9 #include "SkPicture.h" |
10 #include "SkPicturePlayback.h" | 10 #include "SkPicturePlayback.h" |
11 #include "SkStream.h" | 11 #include "SkStream.h" |
12 | 12 |
13 DEFINE_string2(input, i, "", "skp on which to report"); | 13 DEFINE_string2(input, i, "", "skp on which to report"); |
14 DEFINE_bool2(version, v, true, "version"); | 14 DEFINE_bool2(version, v, true, "version"); |
15 DEFINE_bool2(width, w, true, "width"); | 15 DEFINE_bool2(width, w, true, "width"); |
16 DEFINE_bool2(height, h, true, "height"); | 16 DEFINE_bool2(height, h, true, "height"); |
| 17 DEFINE_bool2(flags, f, true, "flags"); |
17 DEFINE_bool2(tags, t, true, "tags"); | 18 DEFINE_bool2(tags, t, true, "tags"); |
18 DEFINE_bool2(quiet, q, false, "quiet"); | 19 DEFINE_bool2(quiet, q, false, "quiet"); |
19 | 20 |
20 // This tool can print simple information about an SKP but its main use | 21 // This tool can print simple information about an SKP but its main use |
21 // is just to check if an SKP has been truncated during the recording | 22 // is just to check if an SKP has been truncated during the recording |
22 // process. | 23 // process. |
23 // return codes: | 24 // return codes: |
24 static const int kSuccess = 0; | 25 static const int kSuccess = 0; |
25 static const int kTruncatedFile = 1; | 26 static const int kTruncatedFile = 1; |
26 static const int kNotAnSKP = 2; | 27 static const int kNotAnSKP = 2; |
(...skipping 30 matching lines...) Expand all Loading... |
57 | 58 |
58 if (FLAGS_version && !FLAGS_quiet) { | 59 if (FLAGS_version && !FLAGS_quiet) { |
59 SkDebugf("Version: %d\n", info.fVersion); | 60 SkDebugf("Version: %d\n", info.fVersion); |
60 } | 61 } |
61 if (FLAGS_width && !FLAGS_quiet) { | 62 if (FLAGS_width && !FLAGS_quiet) { |
62 SkDebugf("Width: %d\n", info.fWidth); | 63 SkDebugf("Width: %d\n", info.fWidth); |
63 } | 64 } |
64 if (FLAGS_height && !FLAGS_quiet) { | 65 if (FLAGS_height && !FLAGS_quiet) { |
65 SkDebugf("Height: %d\n", info.fHeight); | 66 SkDebugf("Height: %d\n", info.fHeight); |
66 } | 67 } |
| 68 if (FLAGS_flags && !FLAGS_quiet) { |
| 69 SkDebugf("Flags: 0x%x\n", info.fFlags); |
| 70 } |
67 | 71 |
68 if (!stream.readBool()) { | 72 if (!stream.readBool()) { |
69 // If we read true there's a picture playback object flattened | 73 // If we read true there's a picture playback object flattened |
70 // in the file; if false, there isn't a playback, so we're done | 74 // in the file; if false, there isn't a playback, so we're done |
71 // reading the file. | 75 // reading the file. |
72 return kSuccess; | 76 return kSuccess; |
73 } | 77 } |
74 | 78 |
75 for (;;) { | 79 for (;;) { |
76 uint32_t tag = stream.readU32(); | 80 uint32_t tag = stream.readU32(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 153 } |
150 | 154 |
151 return kSuccess; | 155 return kSuccess; |
152 } | 156 } |
153 | 157 |
154 #if !defined SK_BUILD_FOR_IOS | 158 #if !defined SK_BUILD_FOR_IOS |
155 int main(int argc, char * const argv[]) { | 159 int main(int argc, char * const argv[]) { |
156 return tool_main(argc, (char**) argv); | 160 return tool_main(argc, (char**) argv); |
157 } | 161 } |
158 #endif | 162 #endif |
OLD | NEW |