From: http://www.cnblogs.com/Caiqinghua/archive/2010/08/04/1791752.html
I. Introduction:
Skia has around 80,000 lines of code and is developed based on C ++. Its main features include:
- Highly optimized software-> optimised software-based rasteriser (module SGL /);
- Accelerate specific operations through OpenGL/es, such as shader and textures-> optional Gl-based acceleration of certain graphics operations including shader support and textures (module Gl /);
- Animation processing capabilities-> animation capabilities (module animator /);
- Built-in SVG support-> some built-in SVG support (module (SVG /)
- Image codec, such as PNG, JPEG, GIF, BMP (modules images/)-> built-in image decoders: PNG, JPEG, GIF, BMP, wbmp, ICO (modules images /);
- Text-based processing, but lack of complex text processing capabilities such as Thai and Tibetan-> text capabilities (no built-in support for complex scripts );
- Some awareness of higher-level UI toolkit constructs (platform windows, platform events): Mac, Unix (sic. X11, incomplete), Windows, wxWidgets
- Features
- Copy-on-write for images and certain other data types;
- Extensive use of the stack, both internally and for API consumers to avoid needless allocations and memory fragmentation;
- Thread-safety to enable parallelisation.
The library is portable and has (optional) platform-specific backends:
- Fonts: Android/ascender, FreeType, Windows (GDI );
- Threading: pthread, windows;
- XML: expat, tinyxml;
- Android shared memory (ashmem) for inter-process image data references;
Ii. Call the skia from the application layer to the underlying layer
Android calls skia in a classic call process. Several packages of the application are provided in the SDK; JNI is placed in the graphic directory under the JNI directory of the Framework; skia is placed under the external directory as a third-party component. Skia structure:
In fact, it mainly involves three databases:
Libcorecg. So contains part of/skia/src/core, such as region. rect is the basic unit for calculating the region in surfaceflinger;
Libsgl. So contains the/skia/src/Core | EFFECTS | images | ports | utils part and all content. This achieves most of skia's graphic effects and codec of the graphic format;
Libskiagl. So contains the content in/skia/src/Gl. It is mainly used to call OpenGL to implement partial effects.