Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skia and Android Paint drawing objects and their use or documentation

Does anyone know of good documentation for the Skia drawing library used by Android?

The main Canvas object has hardly any state, so I'm thinking especially of the objects you can embed into the Paint object. I've worked out by trial and error how to use some ColorFilters and made a cool effect with ColorMatrixColorFilter. Now I have the drop shadows I want from the LinearGradient shader also. I think I understand PathEffects and have some ideas about XferModes. MaskFilters and Rasterizers are still utterly opaque to me. But trial and error is not a good way to understand a complicated library.

Mostly I'm concerned that the Android docs don't discuss 2d graphics and the means of using them at all. Even the class javadocs often don't explain what the class is doing. The actual function is all in Skia C code, which I can get, but it also lacks documentation. I've seen some cool demos but Google explained little about how they were done.

Is the only way to understand these things experimentation and reading the C code? What about efficiency and best practices? The Davlik/Android VM is sensitive to memory allocations and sometimes slow and I'm concerned that I'm not doing things the best way.

like image 487
Brian Avatar asked Feb 08 '10 18:02

Brian


1 Answers

Skia has its own google code project site where you could find some high level overview.

Inline documents could be browse by this link in the project site

http://skia.googlecode.com/svn/trunk/docs/html/hierarchy.html

And you could join the discussion mail list. Designers and community will answer questions.

Another good reference is surprising from Apple. Apple QuickDraw GX documentations explained a lot of 2D vector graphics concepts and could apply to Skia well enough.

like image 175
tomyjwu Avatar answered Oct 11 '22 18:10

tomyjwu