Documentation
¶
Index ¶
- type Gio
- func (r *Gio) Dimensions() layout.Dimensions
- func (r *Gio) HasNativeGradients() bool
- func (r *Gio) RenderClippedImage(img image.Image, m canvas.Matrix, path *canvas.Path)
- func (r *Gio) RenderClippedText(text *canvas.Text, m canvas.Matrix, path *canvas.Path)
- func (r *Gio) RenderImage(img image.Image, m canvas.Matrix)
- func (r *Gio) RenderPath(path *canvas.Path, style canvas.Style, m canvas.Matrix)
- func (r *Gio) RenderText(text *canvas.Text, m canvas.Matrix)
- func (r *Gio) SetGradientScale(scale float32)
- func (r *Gio) SetRasterResolution(resolution canvas.Resolution)
- func (r *Gio) Size() (float64, float64)
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 NewContain ¶
NewContain returns a Gio renderer that fills the constraints either horizontally or vertically, whichever is met first.
func NewStretch ¶
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 ¶
HasNativeGradients 用于判断外层缩放变化时是否需要重建操作记录。
func (*Gio) RenderClippedImage ¶
RenderClippedImage 保留源图片局部、Y 向上的裁剪路径,不先生成整张掩模图片。
func (*Gio) RenderClippedText ¶
RenderClippedText 与 canvas 的文字局部裁剪坐标保持一致。
func (*Gio) RenderImage ¶
RenderImage renders an image to the canvas using a transformation matrix.
func (*Gio) RenderPath ¶
RenderPath renders a path to the canvas using a style and a transformation matrix.
func (*Gio) RenderText ¶
RenderText renders a text object to the canvas using a transformation matrix.
func (*Gio) SetGradientScale ¶
SetGradientScale 告知渲染器调用方在外层施加的等比缩放。Gio 当前 GPU 后端不会将该缩放自动应用到 LinearGradientOp 的色轴,须在记录时补偿。 外层平移使用整数像素;其他外层变换应合入 RenderPath 的矩阵。
func (*Gio) SetRasterResolution ¶
func (r *Gio) SetRasterResolution(resolution canvas.Resolution)
SetRasterResolution 设置非原生画笔回退的页面像素密度(像素/毫米),须包含 内外层缩放。未设置或值无效时保留 150 DPI;单张回退图仍最多 2048×2048。 调用方若重放缓存操作,目标密度变化后须重新记录才能提高采样质量。