29static DEFINE_string2(skps,
s,
"skps",
"A path to a directory of skps or a single skp.");
32 "Indicates if we want to test that the images decode successfully.");
34 "Indicates if we want to write out supported/decoded images.");
36 "Indicates if we want to write out unsupported/failed to decode images.");
38 "Dump SKP and count of unknown images to the specified JSON file. Will not be "
39 "written anywhere if empty.");
61 if (
gSeen.contains(digest)) {
76 switch (codec->getEncodedFormat()) {
91 auto writeImage = [&] (
const char*
name,
int num) {
101 if (FLAGS_testDecode) {
114 if (FLAGS_writeFailedImages) {
122 if (FLAGS_writeImages) {
145 "Usage: get_images_from_skps -s <dir of skps> -o <dir for output images> --testDecode "
146 "-j <output JSON path> --writeImages, --writeFailedImages\n");
149 const char*
inputs = FLAGS_skps[0];
188 unsigned int totalFailures = 0,
189 totalUnsupported = 0;
197 SkDebugf(
"%s %u\n", failure.first.c_str(), failure.second);
198 totalFailures += failure.second;
199 writer.
appendU32(failure.first.c_str(), failure.second);
203 writer.
appendU32(
"totalFailures", totalFailures);
215 writer.
appendU32(
"totalUnsupported", totalUnsupported);
219 SkDebugf(
"%d known, %u failures, %u unsupported\n",
220 gKnown, totalFailures, totalUnsupported);
225 if (totalFailures > 0 || totalUnsupported > 0) {
226 if (!FLAGS_failuresJsonPath.isEmpty()) {
227 SkDebugf(
"Writing failures to %s\n", FLAGS_failuresJsonPath[0]);
230 stream.writeStream(jsonStream.get(), jsonStream->getLength());
static SkMD5::Digest md5(const SkBitmap &bm)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
bool sk_isdir(const char *path)
static void Parse(int argc, const char *const *argv)
static void SetUsage(const char *usage)
static std::unique_ptr< SkCodec > MakeFromData(sk_sp< SkData >, SkSpan< const SkCodecs::Decoder > decoders, SkPngChunkReader *=nullptr)
static sk_sp< SkData > MakeWithoutCopy(const void *data, size_t length)
std::unique_ptr< SkStreamAsset > detachAsStream()
void appendS32(int32_t value)
void appendU32(uint32_t value)
void beginObject(const char *name=nullptr, bool multiline=true)
void appendHexU32(uint32_t value)
SK_SPI bool next(SkString *name, bool getDir=false)
static SkString Join(const char *rootPath, const char *relativePath)
static sk_sp< SkPicture > MakeFromStream(SkStream *stream, const SkDeserialProcs *procs=nullptr)
static std::unique_ptr< SkStreamAsset > MakeFromFile(const char path[])
static bool get_images_from_file(const SkString &file)
int main(int argc, char **argv)
static std::map< std::string, unsigned int > gSkpToUnsupportedCount
static DEFINE_string2(skps, s, "skps", "A path to a directory of skps or a single skp.")
static DEFINE_bool(testDecode, false, "Indicates if we want to test that the images decode successfully.")
static std::map< std::string, unsigned int > gSkpToUnknownCount
static THashSet< SkMD5::Digest > gSeen
static const char * gOutputDir
static bool unsupported()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkDeserialImageProc fImageProc
Sniffer(std::string name)
void sniff(const void *ptr, size_t len)
std::shared_ptr< const fml::Mapping > data