gio

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0, MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gio

type Gio struct {
	// contains filtered or unexported fields
}

func New

func New(gtx layout.Context, width, height float64) *Gio

New returns a Gio renderer of fixed size.

func NewContain

func NewContain(gtx layout.Context, width, height float64) *Gio

NewContain returns a Gio renderer that fills the constraints either horizontally or vertically, whichever is met first.

func NewStretch

func NewStretch(gtx layout.Context, width, height float64) *Gio

NewStretch returns a Gio renderer that stretches the view to fit the constraints.

func (*Gio) Dimensions

func (r *Gio) Dimensions() layout.Dimensions

Dimensions returns the dimensions for Gio.

func (*Gio) HasNativeGradients

func (r *Gio) HasNativeGradients() bool

HasNativeGradients 用于判断外层缩放变化时是否需要重建操作记录。

func (*Gio) RenderClippedImage

func (r *Gio) RenderClippedImage(img image.Image, m canvas.Matrix, path *canvas.Path)

RenderClippedImage 保留源图片局部、Y 向上的裁剪路径,不先生成整张掩模图片。

func (*Gio) RenderClippedText

func (r *Gio) RenderClippedText(text *canvas.Text, m canvas.Matrix, path *canvas.Path)

RenderClippedText 与 canvas 的文字局部裁剪坐标保持一致。

func (*Gio) RenderImage

func (r *Gio) RenderImage(img image.Image, m canvas.Matrix)

RenderImage renders an image to the canvas using a transformation matrix.

func (*Gio) RenderPath

func (r *Gio) RenderPath(path *canvas.Path, style canvas.Style, m canvas.Matrix)

RenderPath renders a path to the canvas using a style and a transformation matrix.

func (*Gio) RenderText

func (r *Gio) RenderText(text *canvas.Text, m canvas.Matrix)

RenderText renders a text object to the canvas using a transformation matrix.

func (*Gio) SetGradientScale

func (r *Gio) SetGradientScale(scale float32)

SetGradientScale 告知渲染器调用方在外层施加的等比缩放。Gio 当前 GPU 后端不会将该缩放自动应用到 LinearGradientOp 的色轴,须在记录时补偿。 外层平移使用整数像素;其他外层变换应合入 RenderPath 的矩阵。

func (*Gio) SetRasterResolution

func (r *Gio) SetRasterResolution(resolution canvas.Resolution)

SetRasterResolution 设置非原生画笔回退的页面像素密度(像素/毫米),须包含 内外层缩放。未设置或值无效时保留 150 DPI;单张回退图仍最多 2048×2048。 调用方若重放缓存操作,目标密度变化后须重新记录才能提高采样质量。

func (*Gio) Size

func (r *Gio) Size() (float64, float64)

Size returns the size of the canvas in millimeters.

Jump to

Keyboard shortcuts

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