Android skia graphics engine Library

Source: Internet
Author: User
Tags skia

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
    1. Copy-on-write for images and certain other data types;
    2. Extensive use of the stack, both internally and for API consumers to avoid needless allocations and memory fragmentation;
    3. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.