Debian Codegraph @

docs/architecture/CPU.dot

raw
1 // Skia CPU Backend Dataflow Diagram
2 // This helps show how data flows through the CPU backend during a draw.
3 //
4 // LEGEND:
5 //
6 // Colors:
7 // - Blue: Actors/Processors (Objects that perform actions)
8 // - Yellow: Data/Configuration (Objects that hold information)
9 //
10 // Line Styles:
11 // - Solid: Data Flow (Objects passed in as parameters in function calls)
12 // - Dashed: Owns (An object holds a smart pointer (sk_sp) to another)
13 // - Dotted: Borrows (An object holds a raw pointer or temporary view of another)
14
15 digraph SkiaCPUBackend {
16 rankdir=TB;
17 splines=ortho;
18 node [shape=box, style="rounded"];
19
20 subgraph cluster_api {
21 label="API Layer";
22 style="rounded";
23 SkCanvas [label="SkCanvas\n(e.g., drawPath)", style=filled, fillcolor=lightblue];
24 SkSurface [label="SkSurface", style=filled, fillcolor=lightblue];
25 SkPath [label="SkPath", style=filled, fillcolor=lightyellow];
26 SkPathRef [label="SkPathRef\n(Heap-allocated Geometry)", style=filled, fillcolor=lightyellow];
27 SkImage [label="SkImage\n(Immutable Pixels)", style=filled, fillcolor=lightyellow];
28
29 SkPaintRecord [
30 label="{SkPaint | { Color | Style | Stroke Width } | { Stroke Cap | Stroke Join | Stroke Miter Limit } | { <blender> SkBlender | <colorfilter> SkColorFilter | <patheffect> SkPathEffect } | { <maskfilter> SkMaskFilter\n(blur) | <shader> SkShader\n(gradients, etc) | <imagefilter> SkImageFilter\n(shadows, etc) }}",
31 shape=record,
32 style=filled,
33 fillcolor=lightyellow
34 ];
35 }
36
37 subgraph cluster_font_management {
38 label="Font Management";
39 style="rounded";
40 SkFontMgr [label="SkFontMgr\n(Font Discovery)", style=filled, fillcolor=lightblue];
41 SkTypeface [label="SkTypeface\n(Font Data)", style=filled, fillcolor=lightyellow];
42 SkFont [label="SkFont\n(Text Style)", style=filled, fillcolor=lightyellow];
43 }
44
45 subgraph cluster_cpu_backend {
46 label="CPU Backend";
47 style="rounded";
48 SkDevice [label="SkBitmapDevice\n(Stateful)", style=filled, fillcolor=lightblue];
49 SkDraw [label="SkDraw\n(Stateless Orchestrator)", style=filled, fillcolor=lightblue];
50 SkScan [label="SkScan\n(Shape -> Scanlines)", style=filled, fillcolor=lightblue];
51 SkRasterPipelineBlitter [label="SkRasterPipelineBlitter", style=filled, fillcolor=lightblue];
52 SkRasterPipeline [label="SkRasterPipeline\n(Pixel Processing Stages)", style=filled, fillcolor=lightblue];
53 SkImage_Raster [label="SkImage_Raster\n(subclass)", style=filled, fillcolor=lightyellow];
54 SkBitmap [label="SkBitmap\n(Pixel Accessor)", style=filled, fillcolor=lightyellow];
55 SkPixmap [label="SkPixmap\n(Pixel View)", style=filled, fillcolor=lightyellow];
56 SkPixelRef [label="SkPixelRef\n(Pixel Owner)", style=filled, fillcolor=lightyellow];
57 }
58
59 // Relationships
60 SkSurface -> SkCanvas [style=dashed];
61 SkSurface -> SkImage;
62 SkCanvas -> SkDevice;
63 SkPath -> SkCanvas;
64 SkPath -> SkPathRef [style=dashed];
65 SkPaintRecord -> SkCanvas;
66 SkFont -> SkCanvas;
67 SkImage -> SkCanvas;
68
69 SkFontMgr -> SkTypeface;
70 SkFont -> SkTypeface [style=dashed];
71
72 SkDevice -> SkDraw;
73 SkDevice -> SkBitmap [style=dashed];
74
75 SkDraw -> SkScan;
76 SkDraw -> SkRasterPipelineBlitter;
77
78 SkScan -> SkRasterPipelineBlitter;
79
80 SkRasterPipelineBlitter -> SkRasterPipeline;
81 SkRasterPipeline -> SkPixmap;
82
83 // Pixel Ownership Story
84 SkImage -> SkImage_Raster [style=dashed];
85 SkImage_Raster -> SkBitmap [style=dashed];
86 SkBitmap -> SkPixelRef [style=dashed];
87 SkBitmap -> SkPixmap [style=dashed];
88 SkPixmap -> SkPixelRef [style=dotted];
89 }