开发者

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开发者_JAVA技巧 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.


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.


Android canvas API did have two difference implementation, one is Skia and another is OpenGL ES. The later implementation is so-called HWUI.

Regardless of the implementation, understanding the pipeline underlying the draw process is critical to understand how to use the canvas API.

Below are the best doc available so far describing the pipeline. You will definitely find it useful.

http://www.xenomachina.com/2011/05/androids-2d-canvas-rendering-pipeline.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜