# google/skia architecture

> Architecture diagram of the GitHub repository google/skia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google/skia
- Repository: https://github.com/google/skia

## Overview

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: [`include/core/SkCanvas.h`](https://github.com/google/skia/blob/main/include/core/SkCanvas.h) (Canvas drawing), [`include/core/SkPath.h`](https://github.com/google/skia/blob/main/include/core/SkPath.h) (Geometry paths), [`include/core/SkFont.h`](https://github.com/google/skia/blob/main/include/core/SkFont.h) (Text and fonts), [`include/core/SkImage.h`](https://github.com/google/skia/blob/main/include/core/SkImage.h) (Images)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core Drawing"]
  node_canvas["Canvas drawing<br/>[SkCanvas.h]"]
  node_paths["Geometry paths<br/>[SkPath.h]"]
  node_text["Text and fonts<br/>[SkFont.h]"]
  node_surface["Drawing surfaces<br/>[SkSurface.h]"]
end

subgraph group_media["Image Media"]
  node_images["Images<br/>[SkImage.h]"]
  node_image_info["Pixel metadata<br/>[SkImageInfo.h]"]
  node_decode["Image decoding<br/>[SkCodec.h]"]
  node_encode["Image encoding<br/>[SkEncoder.h]"]
end

subgraph group_render["Rendering"]
  node_effects["Image and color effects<br/>[SkRuntimeEffect.h]"]
  node_raster["Raster execution"]
  node_raster_builder["Raster pipeline builder"]
  node_ganesh["Ganesh GPU<br/>[GrDirectContext.h]"]
  node_graphite["Graphite GPU"]
end

subgraph group_modules["Higher-Level Modules"]
  node_paragraph["Paragraph layout<br/>[ParagraphImpl.cpp]"]
  node_skottie["Skottie animation<br/>[SlotManager.cpp]"]
  node_capture["Drawing capture"]
end

node_user(("Library user"))

node_user -->|"draws with"| node_canvas
node_user -->|"draws geometry"| node_paths
node_user -->|"draws text"| node_text
node_user -->|"draws images"| node_images
node_user -.->|"uses decoding"| node_decode
node_user -.->|"uses encoding"| node_encode
node_user -.->|"applies effects"| node_effects
node_user -.->|"uses GPU rendering"| node_ganesh
node_user -.->|"uses GPU rendering"| node_graphite

click node_canvas "https://github.com/google/skia/blob/main/include/core/SkCanvas.h"
click node_paths "https://github.com/google/skia/blob/main/include/core/SkPath.h"
click node_text "https://github.com/google/skia/blob/main/include/core/SkFont.h"
click node_surface "https://github.com/google/skia/blob/main/include/core/SkSurface.h"
click node_images "https://github.com/google/skia/blob/main/include/core/SkImage.h"
click node_image_info "https://github.com/google/skia/blob/main/include/core/SkImageInfo.h"
click node_decode "https://github.com/google/skia/blob/main/include/codec/SkCodec.h"
click node_encode "https://github.com/google/skia/blob/main/include/encode/SkEncoder.h"
click node_effects "https://github.com/google/skia/blob/main/include/effects/SkRuntimeEffect.h"
click node_raster "https://github.com/google/skia/blob/main/src/core/SkRasterPipeline.cpp"
click node_raster_builder "https://github.com/google/skia/blob/main/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp"
click node_ganesh "https://github.com/google/skia/blob/main/include/gpu/ganesh/GrDirectContext.h"
click node_graphite "https://github.com/google/skia/blob/main/src/gpu/graphite/PipelineManager.cpp"
click node_paragraph "https://github.com/google/skia/blob/main/modules/skparagraph/src/ParagraphImpl.cpp"
click node_skottie "https://github.com/google/skia/blob/main/modules/skottie/src/SlotManager.cpp"
click node_capture "https://github.com/google/skia/blob/main/src/capture/SkCaptureManager.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_canvas,node_paths,node_text,node_surface,node_user toneBlue
class node_images,node_image_info,node_decode,node_encode toneAmber
class node_effects,node_raster,node_raster_builder,node_ganesh,node_graphite toneMint
class node_paragraph,node_skottie,node_capture toneRose
```

## Components

### Core Drawing

- [Canvas drawing](https://github.com/google/skia/blob/main/include/core/SkCanvas.h): `include/core/SkCanvas.h`
- [Geometry paths](https://github.com/google/skia/blob/main/include/core/SkPath.h): `include/core/SkPath.h`
- [Text and fonts](https://github.com/google/skia/blob/main/include/core/SkFont.h): `include/core/SkFont.h`
- [Drawing surfaces](https://github.com/google/skia/blob/main/include/core/SkSurface.h): `include/core/SkSurface.h`

### Image Media

- [Images](https://github.com/google/skia/blob/main/include/core/SkImage.h): `include/core/SkImage.h`
- [Pixel metadata](https://github.com/google/skia/blob/main/include/core/SkImageInfo.h): `include/core/SkImageInfo.h`
- [Image decoding](https://github.com/google/skia/blob/main/include/codec/SkCodec.h): `include/codec/SkCodec.h`
- [Image encoding](https://github.com/google/skia/blob/main/include/encode/SkEncoder.h): `include/encode/SkEncoder.h`

### Rendering

- [Image and color effects](https://github.com/google/skia/blob/main/include/effects/SkRuntimeEffect.h): `include/effects/SkRuntimeEffect.h`
- [Raster execution](https://github.com/google/skia/blob/main/src/core/SkRasterPipeline.cpp): `src/core/SkRasterPipeline.cpp`
- [Raster pipeline builder](https://github.com/google/skia/blob/main/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp): `src/sksl/codegen/SkSLRasterPipelineBuilder.cpp`
- [Ganesh GPU](https://github.com/google/skia/blob/main/include/gpu/ganesh/GrDirectContext.h): `include/gpu/ganesh/GrDirectContext.h`
- [Graphite GPU](https://github.com/google/skia/blob/main/src/gpu/graphite/PipelineManager.cpp): `src/gpu/graphite/PipelineManager.cpp`

### Higher-Level Modules

- [Paragraph layout](https://github.com/google/skia/blob/main/modules/skparagraph/src/ParagraphImpl.cpp): `modules/skparagraph/src/ParagraphImpl.cpp`
- [Skottie animation](https://github.com/google/skia/blob/main/modules/skottie/src/SlotManager.cpp): `modules/skottie/src/SlotManager.cpp`
- [Drawing capture](https://github.com/google/skia/blob/main/src/capture/SkCaptureManager.cpp): `src/capture/SkCaptureManager.cpp`

### Other components

- **Library user**

## Connections

- Library user → Canvas drawing: draws with (evidence: `README`)
- Library user → Geometry paths: draws geometry (evidence: `README`)
- Library user → Text and fonts: draws text (evidence: `README`)
- Library user → Images: draws images (evidence: `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
