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:
Elias Naur
2019-06-02 16:43:28 +02:00
parent 9f58ed0fea
commit 1e38eec0ab
15 changed files with 248 additions and 160 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"fmt"
"image"
"gioui.org/ui/draw"
"gioui.org/ui"
"gioui.org/ui/layout"
"golang.org/x/image/math/fixed"
)
@@ -35,7 +35,7 @@ type Layout struct {
type Face interface {
Layout(str string, singleLine bool, maxWidth int) *Layout
Path(str String) *draw.Path
Path(str String) ui.OpBlock
}
type Alignment uint8