Hi everyone,
I've been trying to use Skia on iOS lately, and it seems like it is somewhat unmaintained. Either that or the documentation isn't so great. Anyway, there's an issue, and I'd be very happy to help fix it :-)
Here's my experience with Skia (commit d39c191) so far. I'm going to address different topics in this message, just tell me if that isn't appropriate and I'll repost as different messages.
Building for iOS
Building the library was ok. The library builds fine using gyp, and I could get Skia to draw to a PDF and PNG file without too much trouble.
Fat binaries on iOS / OS X
I would like to point out a few things regarding the build process though. On iOS you're supposed to be building fat binaries. Mach-O has support for multiple binaries in the same object file, and using this feature makes the build process a lot easier. For example, this lets you you add a "single" static library to your project and have it work on the iPhone Simulator and each iPhone CPU (ARMv7, v7s, ARM64, etc…). Skia doesn't seem use that feature right now. Would you think this would be a nice addition?
Building optimizations
Also, you guys decided to split arch-specific optimization in different files. This obviously makes a lot of sense, but also somehow complexifies the build process. Indeed, you need to have different targets depending on your architecture. But thing is, we already pass a lot of information regarding the architecture to the compiler (e.g. SK_ARM_NEON_IS_NONE). So it would be possible to use an umbrella C file that would dynamically include this or that assembly-optimized file based on said flags. This would tremendously simplify the build process: just build that one "umbrella.c" file, and let the pre-processor use whatever optimization makes sense based on the provided C flags.
Why didn't you guys pick that option? I'm sure you guys thought of this before, and I'm curious about why you didn't use such a solution.
OS X / iOS naming
Parts of the code for iOS lives in a "mac" folder. Namely things in src/utils/mac. It think it would make sense to rename that folder it to "apple" or to the specific frameworks that are needed (CoreGraphics).
NEON on iOS
The website says to build with arm_neon=0. Why is that so? Again, if I can help, I'd be glad :)
Displaying stuff on iOS
Like I said, rendering to a file seems to be OK. Now I've been trying to display stuff using Skia. And so far, it's been a failure.
I've been trying to figure out how SkUIView and SkOSWindow_iOS are supposed to work together, but I couldn't make sense out of the code. Also it seems like this code doesn't live in the proper place, and isn't built by the right targets. (Namely I would expect SkUIView t it in src/views/ios since its OS X counterpart lives in src/views/mac).
Am I doing thins wrong, or is that part of the code unmaintained? I'd be very happy to help update that code if some help is needed. Just let me know.
Thanks a lot,
- Romain