Documentation
¶
Index ¶
- type Gio
- func (r *Gio) CachePathClips() func()
- func (r *Gio) Dimensions() layout.Dimensions
- func (r *Gio) HasNativeGradients() bool
- func (r *Gio) PushPathClip(path *canvas.Path, matrix canvas.Matrix) func()
- func (r *Gio) RenderCanvasWithBlend(scene *canvas.Canvas, view canvas.Matrix) bool
- func (r *Gio) RenderClippedImage(img image.Image, m canvas.Matrix, path *canvas.Path)
- func (r *Gio) RenderClippedPath(path *canvas.Path, style canvas.Style, matrix canvas.Matrix, clip *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) RenderVectorDisplay(display *canvas.VectorDisplay, view canvas.Matrix) bool
- 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) CachePathClips ¶ added in v0.2.3
func (r *Gio) CachePathClips() func()
CachePathClips 仅在一次重放内复用掩模路径,避免跨 Ops.Reset 持有失效的宏。
func (*Gio) Dimensions ¶
func (r *Gio) Dimensions() layout.Dimensions
Dimensions returns the dimensions for Gio.
func (*Gio) HasNativeGradients ¶
HasNativeGradients 用于判断外层缩放变化时是否需要重建操作记录。
func (*Gio) PushPathClip ¶ added in v0.2.3
PushPathClip 保持路径裁剪为 GPU 矢量操作,不生成掩模位图。
func (*Gio) RenderCanvasWithBlend ¶ added in v0.2.3
RenderCanvasWithBlend 为直接消费场景的调用方准备矢量叠底记录。 每次调用都重新准备,不缓存可变场景或源图片;重复显示应保存 scene.PrepareVectorDisplay() 并重放返回值。阅读器通过后台 PrepareDisplay 复用。
func (*Gio) RenderClippedImage ¶
RenderClippedImage 保留源图片局部、Y 向上的裁剪路径,不先生成整张掩模图片。
func (*Gio) RenderClippedPath ¶ added in v0.2.3
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) RenderVectorDisplay ¶ added in v0.2.3
RenderVectorDisplay 处理高颜色数 Darken 图片的有界回退。路径显示记录仍 只保留一条图片记录;Gio 无法直接表达 Darken 的逐通道 min,因此在固定 分辨率下栅格化源场景,再作为一张普通图片上传。
func (*Gio) SetGradientScale ¶
SetGradientScale 告知渲染器调用方在外层施加的等比缩放。Gio 当前 GPU 后端不会将该缩放自动应用到 LinearGradientOp 的色轴,须在记录时补偿。 外层平移使用整数像素;其他外层变换应合入 RenderPath 的矩阵。
func (*Gio) SetRasterResolution ¶
func (r *Gio) SetRasterResolution(resolution canvas.Resolution)
SetRasterResolution 设置非原生画笔回退的页面像素密度(像素/毫米),须包含 内外层缩放。未设置或值无效时保留 150 DPI;单张回退图仍最多 2048×2048。 调用方若重放缓存操作,目标密度变化后须重新记录才能提高采样质量。