34 {
37
38 if (FLAGS_input.size() != 1) {
39 if (!FLAGS_quiet) {
41 }
43 }
44
47 if (!FLAGS_quiet) {
49 }
51 }
52
53 size_t totStreamSize =
stream.getLength();
54
59 }
60
61 if (FLAGS_version && !FLAGS_quiet) {
63 }
64 if (FLAGS_cullRect && !FLAGS_quiet) {
66 info.fCullRect.fLeft,
info.fCullRect.fTop,
67 info.fCullRect.fRight,
info.fCullRect.fBottom);
68 }
69
70 bool hasData;
72 if (!hasData) {
73
74
75
77 }
78
79 for (;;) {
80 uint32_t tag;
83 break;
84 }
85
86 uint32_t chunkSize;
88 size_t curPos =
stream.getPosition();
89
90
91
92 if (curPos+chunkSize > totStreamSize) {
93 if (!FLAGS_quiet) {
95 }
97 }
98
99
100
101
102
103 switch (tag) {
105 if (FLAGS_tags && !FLAGS_quiet) {
106 SkDebugf(
"SK_PICT_READER_TAG %u\n", chunkSize);
107 }
108 break;
110 if (FLAGS_tags && !FLAGS_quiet) {
111 SkDebugf(
"SK_PICT_FACTORY_TAG %u\n", chunkSize);
112 }
113 break;
115 if (FLAGS_tags && !FLAGS_quiet) {
116 SkDebugf(
"SK_PICT_TYPEFACE_TAG %u\n", chunkSize);
117 }
118
123 if (!FLAGS_quiet) {
124 SkDebugf(
"File corruption in SkFontDescriptor\n");
125 }
127 }
128 }
129
130
131 chunkSize = 0;
132 break;
133 }
135 if (FLAGS_tags && !FLAGS_quiet) {
136 SkDebugf(
"SK_PICT_PICTURE_TAG %u\n", chunkSize);
137 SkDebugf(
"Exiting early due to format limitations\n");
138 }
141 if (FLAGS_tags && !FLAGS_quiet) {
142 SkDebugf(
"SK_PICT_BUFFER_SIZE_TAG %u\n", chunkSize);
143 }
144 break;
145 default:
146 if (!FLAGS_quiet) {
147 SkDebugf(
"Unknown tag %u\n", chunkSize);
148 }
150 }
151
152 if (!
stream.move(chunkSize)) {
153 if (!FLAGS_quiet) {
155 }
157 }
158 }
159
161}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define SK_PICT_PICTURE_TAG
#define SK_PICT_FACTORY_TAG
#define SK_PICT_BUFFER_SIZE_TAG
#define SK_PICT_READER_TAG
#define SK_PICT_TYPEFACE_TAG
bool SkPicture_StreamIsSKP(SkStream *stream, SkPictInfo *pInfo)
constexpr int SkToInt(S x)
static void Parse(int argc, const char *const *argv)
static void SetUsage(const char *usage)
static bool Deserialize(SkStream *, SkFontDescriptor *result)
static const int kMissingInput
static const int kNotAnSKP
static const int kIOError
static const int kSuccess
static const int kInvalidTag
static const int kTruncatedFile