1cb93a386Sopenharmony_ci--- 2cb93a386Sopenharmony_cititle: 'API Reference and Overview' 3cb93a386Sopenharmony_cilinkTitle: 'API Reference and Overview' 4cb93a386Sopenharmony_ci 5cb93a386Sopenharmony_ciweight: 5 6cb93a386Sopenharmony_ci--- 7cb93a386Sopenharmony_ci 8cb93a386Sopenharmony_ciSkia documentation is actively under development. 9cb93a386Sopenharmony_ci 10cb93a386Sopenharmony_ciSome key classes are: 11cb93a386Sopenharmony_ci 12cb93a386Sopenharmony_ci- [SkAutoCanvasRestore](https://api.skia.org/classSkAutoCanvasRestore.html#details) - 13cb93a386Sopenharmony_ci Canvas save stack manager 14cb93a386Sopenharmony_ci- [SkBitmap](https://api.skia.org/classSkBitmap.html#details) - two-dimensional 15cb93a386Sopenharmony_ci raster pixel array 16cb93a386Sopenharmony_ci- [SkBlendMode](https://api.skia.org/SkBlendMode_8h.html) - pixel color 17cb93a386Sopenharmony_ci arithmetic 18cb93a386Sopenharmony_ci- [SkCanvas](https://api.skia.org/classSkCanvas.html#details) - drawing context 19cb93a386Sopenharmony_ci- [SkColor](https://api.skia.org/SkColor_8h.html) - color encoding using integer 20cb93a386Sopenharmony_ci numbers 21cb93a386Sopenharmony_ci- [SkFont](https://api.skia.org/classSkFont.html#details) - text style and 22cb93a386Sopenharmony_ci typeface 23cb93a386Sopenharmony_ci- [SkImage](https://api.skia.org/classSkImage.html#details) - two dimensional 24cb93a386Sopenharmony_ci array of pixels to draw 25cb93a386Sopenharmony_ci- [SkImageInfo](https://api.skia.org/structSkImageInfo.html#details) - pixel 26cb93a386Sopenharmony_ci dimensions and characteristics 27cb93a386Sopenharmony_ci- [SkIPoint](https://api.skia.org/structSkIPoint.html#details) - two integer 28cb93a386Sopenharmony_ci coordinates 29cb93a386Sopenharmony_ci- [SkIRect](https://api.skia.org/structSkIRect.html#details) - integer rectangle 30cb93a386Sopenharmony_ci- [SkMatrix](https://api.skia.org/classSkMatrix.html#details) - 3x3 31cb93a386Sopenharmony_ci transformation matrix 32cb93a386Sopenharmony_ci- [SkPaint](https://api.skia.org/classSkPaint.html#details) - color, stroke, 33cb93a386Sopenharmony_ci font, effects 34cb93a386Sopenharmony_ci- [SkPath](https://api.skia.org/classSkPath.html#details) - sequence of 35cb93a386Sopenharmony_ci connected lines and curves 36cb93a386Sopenharmony_ci- [SkPicture](https://api.skia.org/classSkPicture.html#details) - sequence of 37cb93a386Sopenharmony_ci drawing commands 38cb93a386Sopenharmony_ci- [SkPixmap](https://api.skia.org/classSkPixmap.html#details) - pixel map: image 39cb93a386Sopenharmony_ci info and pixel address 40cb93a386Sopenharmony_ci- [SkPoint](https://api.skia.org/structSkPoint.html#details) - two floating 41cb93a386Sopenharmony_ci point coordinates 42cb93a386Sopenharmony_ci- [SkRRect](https://api.skia.org/classSkRRect.html#details) - floating point 43cb93a386Sopenharmony_ci rounded rectangle 44cb93a386Sopenharmony_ci- [SkRect](https://api.skia.org/structSkRect.html#details) - floating point 45cb93a386Sopenharmony_ci rectangle 46cb93a386Sopenharmony_ci- [SkRegion](https://api.skia.org/classSkRegion.html#details) - compressed 47cb93a386Sopenharmony_ci clipping mask 48cb93a386Sopenharmony_ci- [SkSurface](https://api.skia.org/classSkSurface.html#details) - drawing 49cb93a386Sopenharmony_ci destination 50cb93a386Sopenharmony_ci- [SkTextBlob](https://api.skia.org/classSkTextBlob.html#details) - runs of 51cb93a386Sopenharmony_ci glyphs 52cb93a386Sopenharmony_ci- [SkTextBlobBuilder](https://api.skia.org/classSkTextBlobBuilder.html#details) - 53cb93a386Sopenharmony_ci constructor for runs of glyphs 54cb93a386Sopenharmony_ci 55cb93a386Sopenharmony_ciAll public APIs are indexed by Doxygen. 56cb93a386Sopenharmony_ci 57cb93a386Sopenharmony_ci- [Skia Doxygen](https://api.skia.org) 58cb93a386Sopenharmony_ci 59cb93a386Sopenharmony_ci## Overview 60cb93a386Sopenharmony_ci 61cb93a386Sopenharmony_ciSkia is organized around the `SkCanvas` object. It is the host for the "draw" 62cb93a386Sopenharmony_cicalls: `drawRect`, `drawPath`, `drawText`, etc. Each of these has two 63cb93a386Sopenharmony_cicomponents: the primitive being drawn (`SkRect`, `SkPath`, etc.) and color/style 64cb93a386Sopenharmony_ciattributes (`SkPaint`). 65cb93a386Sopenharmony_ci 66cb93a386Sopenharmony_ci<!--?prettify lang=cc?--> 67cb93a386Sopenharmony_ci 68cb93a386Sopenharmony_ci canvas->drawRect(rect, paint); 69cb93a386Sopenharmony_ci 70cb93a386Sopenharmony_ciThe paint holds much of the state describing how the rectangle (in this case) is 71cb93a386Sopenharmony_cidrawn: what color it is, if it is filled or stroked, how it should blend with 72cb93a386Sopenharmony_ciwhat was previously drawn. 73cb93a386Sopenharmony_ci 74cb93a386Sopenharmony_ciThe canvas holds relatively little state. It points to the actual pixels being 75cb93a386Sopenharmony_cidrawn, and it maintains a stack of matrices and clips. Thus in the above call, 76cb93a386Sopenharmony_cithe canvas' current matrix may transform the coordinates of the rectangle 77cb93a386Sopenharmony_ci(translation, rotation, skewing, perspective), and the canvas' current clip may 78cb93a386Sopenharmony_cirestrict where on the canvas the rectangle will be drawn, but all other 79cb93a386Sopenharmony_cistylistic attributes of the drawing are controlled by the paint. 80cb93a386Sopenharmony_ci 81cb93a386Sopenharmony_ciUsing the SkCanvas API: 82cb93a386Sopenharmony_ci 83cb93a386Sopenharmony_ci1. [SkCanvas Overview](/docs/user/api/skcanvas_overview) - the drawing context 84cb93a386Sopenharmony_ci2. [SkPaint Overview](/docs/user/api/skpaint_overview) - color, stroke, font, 85cb93a386Sopenharmony_ci effects 86cb93a386Sopenharmony_ci3. [SkCanvas Creation](/docs/user/api/skcanvas_creation) 87