mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
internal/ops,gpu: remove transform fields from ops.Key
The transformation information in ops.Key is a layer violation. Introduce a key type specific to package gpu and use that instead. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-14
@@ -5,7 +5,6 @@ package ops
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
"gioui.org/f32"
|
||||
"gioui.org/internal/opconst"
|
||||
"gioui.org/op"
|
||||
)
|
||||
@@ -29,10 +28,9 @@ type EncodedOp struct {
|
||||
|
||||
// Key is a unique key for a given op.
|
||||
type Key struct {
|
||||
ops *op.Ops
|
||||
pc int
|
||||
version int
|
||||
sx, hx, sy, hy float32
|
||||
ops *op.Ops
|
||||
pc int
|
||||
version int
|
||||
}
|
||||
|
||||
// Shadow of op.MacroOp.
|
||||
@@ -80,15 +78,6 @@ func NewPC(ops *op.Ops) PC {
|
||||
}
|
||||
}
|
||||
|
||||
func (k Key) SetTransform(t f32.Affine2D) Key {
|
||||
sx, hx, _, hy, sy, _ := t.Elems()
|
||||
k.sx = sx
|
||||
k.hx = hx
|
||||
k.hy = hy
|
||||
k.sy = sy
|
||||
return k
|
||||
}
|
||||
|
||||
func (r *Reader) Decode() (EncodedOp, bool) {
|
||||
if r.ops == nil {
|
||||
return EncodedOp{}, false
|
||||
|
||||
Reference in New Issue
Block a user