| 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 "SkPictureData.h" | 10 #include "SkPictureData.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 SkPictInfo info; | 53 SkPictInfo info; |
| 54 if (!SkPicture::InternalOnly_StreamIsSKP(&stream, &info)) { | 54 if (!SkPicture::InternalOnly_StreamIsSKP(&stream, &info)) { |
| 55 return kNotAnSKP; | 55 return kNotAnSKP; |
| 56 } | 56 } |
| 57 | 57 |
| 58 if (FLAGS_version && !FLAGS_quiet) { | 58 if (FLAGS_version && !FLAGS_quiet) { |
| 59 SkDebugf("Version: %d\n", info.fVersion); | 59 SkDebugf("Version: %d\n", info.fVersion); |
| 60 } | 60 } |
| 61 if (FLAGS_cullRect && !FLAGS_quiet) { | 61 if (FLAGS_cullRect && !FLAGS_quiet) { |
| 62 SkDebugf("Cull Rect: %f,%f,%f,%f\n", | 62 SkDebugf("Cull Rect: %f,%f,%f,%f\n", |
| 63 info.fCullRect.fLeft, info.fCullRect.fTop, | 63 info.fCullRect.fLeft, info.fCullRect.fTop, |
| 64 info.fCullRect.fRight, info.fCullRect.fBottom); | 64 info.fCullRect.fRight, info.fCullRect.fBottom); |
| 65 } | 65 } |
| 66 if (FLAGS_flags && !FLAGS_quiet) { | 66 if (FLAGS_flags && !FLAGS_quiet) { |
| 67 SkDebugf("Flags: 0x%x\n", info.fFlags); | 67 SkDebugf("Flags: 0x%x\n", info.fFlags); |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (!stream.readBool()) { | 70 if (!stream.readBool()) { |
| 71 // If we read true there's a picture playback object flattened | 71 // If we read true there's a picture playback object flattened |
| 72 // in the file; if false, there isn't a playback, so we're done | 72 // in the file; if false, there isn't a playback, so we're done |
| 73 // reading the file. | 73 // reading the file. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 99 switch (tag) { | 99 switch (tag) { |
| 100 case SK_PICT_READER_TAG: | 100 case SK_PICT_READER_TAG: |
| 101 if (FLAGS_tags && !FLAGS_quiet) { | 101 if (FLAGS_tags && !FLAGS_quiet) { |
| 102 SkDebugf("SK_PICT_READER_TAG %d\n", chunkSize); | 102 SkDebugf("SK_PICT_READER_TAG %d\n", chunkSize); |
| 103 } | 103 } |
| 104 break; | 104 break; |
| 105 case SK_PICT_FACTORY_TAG: | 105 case SK_PICT_FACTORY_TAG: |
| 106 if (FLAGS_tags && !FLAGS_quiet) { | 106 if (FLAGS_tags && !FLAGS_quiet) { |
| 107 SkDebugf("SK_PICT_FACTORY_TAG %d\n", chunkSize); | 107 SkDebugf("SK_PICT_FACTORY_TAG %d\n", chunkSize); |
| 108 } | 108 } |
| 109 // Remove this code when v21 and below are no longer supported | |
| 110 #ifndef DISABLE_V21_COMPATIBILITY_CODE | |
| 111 if (info.fVersion < 22) { | |
| 112 if (!FLAGS_quiet) { | |
| 113 SkDebugf("Exiting early due to format limitations\n"); | |
| 114 } | |
| 115 return kSuccess; // TODO: need to store size in bytes | |
| 116 } | |
| 117 #endif | |
| 118 break; | 109 break; |
| 119 case SK_PICT_TYPEFACE_TAG: | 110 case SK_PICT_TYPEFACE_TAG: |
| 120 if (FLAGS_tags && !FLAGS_quiet) { | 111 if (FLAGS_tags && !FLAGS_quiet) { |
| 121 SkDebugf("SK_PICT_TYPEFACE_TAG %d\n", chunkSize); | 112 SkDebugf("SK_PICT_TYPEFACE_TAG %d\n", chunkSize); |
| 122 SkDebugf("Exiting early due to format limitations\n"); | 113 SkDebugf("Exiting early due to format limitations\n"); |
| 123 } | 114 } |
| 124 return kSuccess; // TODO: need to store size in bytes | 115 return kSuccess; // TODO: need to store size in bytes |
| 125 break; | 116 break; |
| 126 case SK_PICT_PICTURE_TAG: | 117 case SK_PICT_PICTURE_TAG: |
| 127 if (FLAGS_tags && !FLAGS_quiet) { | 118 if (FLAGS_tags && !FLAGS_quiet) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 151 } | 142 } |
| 152 | 143 |
| 153 return kSuccess; | 144 return kSuccess; |
| 154 } | 145 } |
| 155 | 146 |
| 156 #if !defined SK_BUILD_FOR_IOS | 147 #if !defined SK_BUILD_FOR_IOS |
| 157 int main(int argc, char * const argv[]) { | 148 int main(int argc, char * const argv[]) { |
| 158 return tool_main(argc, (char**) argv); | 149 return tool_main(argc, (char**) argv); |
| 159 } | 150 } |
| 160 #endif | 151 #endif |
| OLD | NEW |