Hi, I'm trying to get a PDF screenshot of an Android app, with all the elements still intact as far as possible (i.e. so it isn't just one bit bitmap). Ideally it will still have vector fonts and everything. I have some questions about the best way to do this.
My first thought was to gather all the drawing commands by intercepting all the calls to android's Canvas, but it turns out that is impossible because some of the data is private. Most notably Path, which is write-only.
So the only option is to interpret the output of Picture.writeToStream(). This is the serialised SkPicture data, but it is only meant for internal use and the corresponding deserialization methods only work with the latest version of the format (they won't load and convert old versions).
In Android, the PICTURE_VERSION is set to 1 in ICS and below, and 2 in Jellybean. In Skia trunk it is currently at 9! So here are my questions:
1. Do the PICTURE_VERSION 1 and 2 in Android correspond to the same versions in Skia trunk? I assume they do, but if so the literally begs the question:
2. Why is Android so far behind Skia trunk in terms of picture versions?
3. I started off trying to modify the skia debugger & library to read SKPs with PICTURE_VERSION = 1, but... well, I hate XCode, so instead I think I will try to make an SKP updater, which reads a version 1 (or 2 in a parallel universe where the Update Alliance exists) SKP and outputs version 9. So! Are there any significant issues I will have? I've already found that SkShape was removed (whatever that is). Will that be a problem?
4. In Android's SkUserConfig.h it says:
#define PICTURE_VERSION_ICS 1 // r1562 of Skia
But none of the commits of that file are for r1562 or anything close.
5. Does the SKP data include fonts? After I (eventually!) managed to get the debugger to compile on my mac I tried opening theverge.skp, and the text was totally messed up, so I am not sure about this.
Cheers,
Tim