mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
internal/ops: switch quad encoding to compute format
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+7
-5
@@ -8,8 +8,10 @@ import (
|
||||
"math"
|
||||
|
||||
"gioui.org/f32"
|
||||
"gioui.org/internal/byteslice"
|
||||
"gioui.org/internal/opconst"
|
||||
"gioui.org/internal/ops"
|
||||
"gioui.org/internal/scene"
|
||||
"gioui.org/op"
|
||||
)
|
||||
|
||||
@@ -155,11 +157,7 @@ func (p *Path) QuadTo(ctrl, to f32.Point) {
|
||||
data := p.ops.Write(ops.QuadSize + 4)
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[0:], uint32(p.contour))
|
||||
ops.EncodeQuad(data[4:], ops.Quad{
|
||||
From: p.pen,
|
||||
Ctrl: ctrl,
|
||||
To: to,
|
||||
})
|
||||
encodeCommand(data[4:], scene.Quad(p.pen, ctrl, to, false))
|
||||
p.pen = to
|
||||
p.hasSegments = true
|
||||
}
|
||||
@@ -395,3 +393,7 @@ func (o Outline) Op() Op {
|
||||
outline: true,
|
||||
}
|
||||
}
|
||||
|
||||
func encodeCommand(out []byte, cmd scene.Command) {
|
||||
copy(out, byteslice.Slice(cmd[:]))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user