app/internal/gpu: rename opClip to clipOp

To better match ClipOp, which was renamed from OpClip.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-07 16:21:50 +02:00
parent eaa4efe5af
commit 4d66669a9e
+5 -5
View File
@@ -119,12 +119,12 @@ type material struct {
uvOffset f32.Point uvOffset f32.Point
} }
// opClip structure must match opClip in package ui/draw. // clipOp is the shadow of draw.ClipOp.
type opClip struct { type clipOp struct {
bounds f32.Rectangle bounds f32.Rectangle
} }
func (op *opClip) decode(data []byte) { func (op *clipOp) decode(data []byte) {
if opconst.OpType(data[0]) != opconst.TypeClip { if opconst.OpType(data[0]) != opconst.TypeClip {
panic("invalid op") panic("invalid op")
} }
@@ -139,7 +139,7 @@ func (op *opClip) decode(data []byte) {
Y: math.Float32frombits(bo.Uint32(data[13:])), Y: math.Float32frombits(bo.Uint32(data[13:])),
}, },
} }
*op = opClip{ *op = clipOp{
bounds: r, bounds: r,
} }
} }
@@ -656,7 +656,7 @@ loop:
aux = encOp.Data[opconst.TypeAuxLen:] aux = encOp.Data[opconst.TypeAuxLen:]
auxKey = encOp.Key auxKey = encOp.Key
case opconst.TypeClip: case opconst.TypeClip:
var op opClip var op clipOp
op.decode(encOp.Data) op.decode(encOp.Data)
off := state.t.Transform(f32.Point{}) off := state.t.Transform(f32.Point{})
state.clip = state.clip.Intersect(op.bounds.Add(off)) state.clip = state.clip.Intersect(op.bounds.Add(off))