mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
gpu,op/clip: implement dashed stroked paths
Signed-off-by: Sebastien Binet <s@sbinet.org>
This commit is contained in:
committed by
Elias Naur
parent
ac14320bec
commit
e71bf13c9a
@@ -21,6 +21,7 @@ type Op struct {
|
||||
|
||||
outline bool
|
||||
stroke StrokeStyle
|
||||
dashes DashSpec
|
||||
}
|
||||
|
||||
func (p Op) Add(o *op.Ops) {
|
||||
@@ -42,6 +43,15 @@ func (p Op) Add(o *op.Ops) {
|
||||
data[10] = uint8(p.stroke.Join)
|
||||
}
|
||||
|
||||
if p.dashes.phase != 0 || p.dashes.size > 0 {
|
||||
data := o.Write(opconst.TypeDashLen)
|
||||
data[0] = byte(opconst.TypeDash)
|
||||
bo := binary.LittleEndian
|
||||
bo.PutUint32(data[1:], math.Float32bits(p.dashes.phase))
|
||||
data[5] = p.dashes.size // FIXME(sbinet) uint16? uint32?
|
||||
p.dashes.spec.Add(o)
|
||||
}
|
||||
|
||||
data := o.Write(opconst.TypeClipLen)
|
||||
data[0] = byte(opconst.TypeClip)
|
||||
bo := binary.LittleEndian
|
||||
|
||||
Reference in New Issue
Block a user