How google/skia works
Skia is a 2D graphics library for drawing text, geometry, and images. A user-facing workflow is to create a drawing surface, issue drawing operations through the core APIs, and work with the resulting image; the tree also shows distinct codec, encoding, effects, and GPU-rendering capabilities. Internal sampled code includes raster execution and shader-to-raster-pipeline generation. The README is brief, and most implementation files were not sampled, so links between these subsystems are omitted where their callers are not evidenced.
Main entry points: SkCanvas.h Canvas drawing · SkPath.h Geometry paths · SkFont.h Text and fonts · SkImage.h Images
Components 17
Core Drawing
- Canvas drawing
include/core/SkCanvas.h - Geometry paths
include/core/SkPath.h - Text and fonts
include/core/SkFont.h - Drawing surfaces
include/core/SkSurface.h
Image Media
- Images
include/core/SkImage.h - Pixel metadata
include/core/SkImageInfo.h - Image decoding
include/codec/SkCodec.h - Image encoding
include/encode/SkEncoder.h
Rendering
- Image and color effects
include/effects/SkRuntimeEffect.h - Raster execution
src/core/SkRasterPipeline.cpp - Raster pipeline builder
src/sksl/codegen/SkSLRasterPipelineBuilder.cpp - Ganesh GPU
include/gpu/ganesh/GrDirectContext.h - Graphite GPU
src/gpu/graphite/PipelineManager.cpp
Higher-Level Modules
- Paragraph layout
modules/skparagraph/src/ParagraphImpl.cpp - Skottie animation
modules/skottie/src/SlotManager.cpp - Drawing capture
src/capture/SkCaptureManager.cpp
Other components
- Library user
Connections 9
- Library user → Canvas drawing: draws with
README - Library user → Geometry paths: draws geometry
README - Library user → Text and fonts: draws text
README - Library user → Images: draws images
README - Library user → Image decoding: uses decoding
- Library user → Image encoding: uses encoding
- Library user → Image and color effects: applies effects
- Library user → Ganesh GPU: uses GPU rendering
- Library user → Graphite GPU: uses GPU rendering