aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skp_parser.cpp
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-10-25 13:02:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-25 19:27:13 +0000
commit291af4f17e0630f78a8c4d22f304243fb28ae42b (patch)
treee9982c0e3b97fafe2e161b9be2b3095eaa0e219b /tools/skp_parser.cpp
parente8d55d5ab0df2732e506b654e9254a001df197a9 (diff)
tools/skp_parser: add some explanitory comments
Change-Id: I38e9a392214394ac3552b05dcc6b27a1ae937e57 Reviewed-on: https://skia-review.googlesource.com/63820 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'tools/skp_parser.cpp')
-rw-r--r--tools/skp_parser.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/skp_parser.cpp b/tools/skp_parser.cpp
index 887c50d182..92e1369483 100644
--- a/tools/skp_parser.cpp
+++ b/tools/skp_parser.cpp
@@ -16,6 +16,24 @@
#include <io.h>
#endif
+/*
+If you execute skp_parser with one argument, it spits out a json representation
+of the skp, but that's incomplete since it's missing many binary blobs (these
+could represent images or typefaces or just anything that doesn't currently
+have a json representation). Each unique blob is labeled with a string in the
+form "data/%d". So for example:
+
+ tools/git-sync-deps
+ bin/gn gen out/debug
+ ninja -C out/debug dm skp_parser
+ out/debug/dm -m grayscale -w /tmp/dm --config skp
+ out/debug/skp_parser /tmp/dm/skp/gm/grayscalejpg.skp | less
+ out/debug/skp_parser /tmp/dm/skp/gm/grayscalejpg.skp | grep data
+ out/debug/skp_parser /tmp/dm/skp/gm/grayscalejpg.skp data/0 | file -
+ out/debug/skp_parser /tmp/dm/skp/gm/grayscalejpg.skp data/0 > /tmp/data0.png
+
+"data/0" is an image that the SKP serializer has encoded as PNG.
+*/
int main(int argc, char** argv) {
if (argc < 2) {
SkDebugf("Usage:\n %s SKP_FILE [DATA_URL]\n", argv[0]);