mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
ui: build paths as ops
Instead of allocating and constructing a clip path, store path data directly in op lists. Use separate op lists for cached text layout paths. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -221,12 +221,12 @@ func (c *coverer) release() {
|
||||
}
|
||||
}
|
||||
|
||||
func buildPath(ctx *context, p *path.Path) *pathData {
|
||||
func buildPath(ctx *context, p []byte) *pathData {
|
||||
buf := ctx.CreateBuffer()
|
||||
ctx.BindBuffer(gl.ARRAY_BUFFER, buf)
|
||||
ctx.BufferData(gl.ARRAY_BUFFER, gl.BytesView(p.Vertices), gl.STATIC_DRAW)
|
||||
ctx.BufferData(gl.ARRAY_BUFFER, p, gl.STATIC_DRAW)
|
||||
return &pathData{
|
||||
ncurves: len(p.Vertices),
|
||||
ncurves: len(p) / path.VertStride,
|
||||
data: buf,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user