mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
gpu: [compute] skip encoding roundtrip for path data
Since clip.Path now encodes paths in the format expected by elements.comp, use that data directly instead of a roundtrip through drawOps.buildVerts. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-6
@@ -8,8 +8,8 @@ import (
|
||||
"math"
|
||||
|
||||
"gioui.org/f32"
|
||||
"gioui.org/internal/byteslice"
|
||||
"gioui.org/internal/opconst"
|
||||
"gioui.org/internal/ops"
|
||||
"gioui.org/internal/scene"
|
||||
"gioui.org/op"
|
||||
)
|
||||
@@ -156,7 +156,7 @@ func (p *Path) QuadTo(ctrl, to f32.Point) {
|
||||
data := p.ops.Write(scene.CommandSize + 4)
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
encodeCommand(data[4:], scene.Quad(p.pen, ctrl, to, false))
|
||||
ops.EncodeCommand(data[4:], scene.Quad(p.pen, ctrl, to, false))
|
||||
p.pen = to
|
||||
p.hasSegments = true
|
||||
}
|
||||
@@ -392,7 +392,3 @@ func (o Outline) Op() Op {
|
||||
outline: true,
|
||||
}
|
||||
}
|
||||
|
||||
func encodeCommand(out []byte, cmd scene.Command) {
|
||||
copy(out, byteslice.Uint32(cmd[:]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user