gpu,internal/ops: move gpu.clipOp to ops.ClipOp

We're about to use clip.Ops for pointer areas; this change makes the
decoding accessible from the router package.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-10-25 11:20:14 +02:00
parent 9548dbe901
commit 1eab4b84a6
3 changed files with 42 additions and 41 deletions
+4 -3
View File
@@ -1772,9 +1772,10 @@ func (c *collector) collect(root *op.Ops, viewport image.Point, texOps *[]textur
pathData.key = encOp.Key
pathData.hash = hash
case ops.TypeClip:
var op clipOp
op.decode(encOp.Data)
c.addClip(&state, fview, op.bounds, pathData.data, pathData.key, pathData.hash, strWidth, true)
var op ops.ClipOp
op.Decode(encOp.Data)
bounds := layout.FRect(op.Bounds)
c.addClip(&state, fview, bounds, pathData.data, pathData.key, pathData.hash, strWidth, true)
pathData.data = nil
strWidth = 0
case ops.TypePopClip: