Blink286

blink::GraphicsContext


Listen Later

immediate drawing API that records to a display list.

 Painters for layout objects use GraphicsContext to “draw”—but in modern Blink those calls get recorded into a display list (PaintRecord) backed by Skia commands. This recording is scoped and batched between BeginRecording(...)/EndRecording(). (Chromium Git Repositories)

Key methods (how display items get their pixels)

  • Recording: BeginRecording(const FloatRect&) → sk_sp EndRecording() — wraps a run of drawing commands for later replay. (Chromium Git Repositories)

  • Draw ops (representative): DrawRect, DrawImage(...), DrawText(...), BeginLayer/EndLayer — the stuff that becomes Skia ops inside display items. (Chromium Git Repositories)

Important fields

  • cc::PaintCanvas* canvas_ (owned by recorder), PaintRecorder paint_recorder_ — actual recording guts;

  • float device_scale_factor_, state stacks/flags — needed for correct pixel snapping/appearance. (Chromium Git Repositories)

Hands off to: PaintController, which packages these recorded ops into chunks/items.


...more
View all episodesView all episodes
Download on the App Store

Blink286By Free Debreuil