render

package
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package render provides the public API for creating a widget.Canvas backed by a gg.Context.

This package is a thin wrapper around the internal render implementation. Host applications use it to bridge the gogpu/gg 2D rasterizer with the ui widget drawing pipeline.

cc := ggcanvas.Context()                       // *gg.Context
canvas := render.NewCanvas(cc, width, height)  // widget.Canvas
window.DrawTo(canvas)                          // draw widget tree

Package render provides the public API for creating a widget.Canvas backed by a gg.Context.

This package is a thin wrapper around the internal render implementation. Host applications use it to bridge the gogpu/gg 2D rasterizer with the ui widget drawing pipeline:

cc := ggcanvas.Context()                       // *gg.Context
canvas := render.NewCanvas(cc, width, height)  // widget.Canvas
window.DrawTo(canvas)                          // draw widget tree

The returned widget.Canvas supports all drawing operations required by widgets: rectangles, rounded rectangles, text, lines, clipping, and push/pop state. GPU-accelerated operations (SDF shapes, clip regions) are handled transparently by the underlying gg.Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCanvas

func NewCanvas(dc *gg.Context, width, height int) widget.Canvas

NewCanvas creates a widget.Canvas backed by the given gg.Context.

The width and height specify the canvas dimensions in logical pixels. The gg.Context should already be created with matching dimensions.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL