~eliasnaur/gio

23a839a29d27c27c50efaa4fd3479308a0a90f97 — Elias Naur 6 months ago f655027
widget: clip by most complex shape last

In the new compute renderer, clipping to a complex shape is slower than
filling it. Swap the clip shapes for drawing text so that the text shape
itself is last, and therefore used for filling.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M widget/label.go
M widget/label.go => widget/label.go +1 -1
@@ 178,8 178,8 @@ func (l Label) Layout(gtx layout.Context, s text.Shaper, font text.Font, size un
		}
		stack := op.Save(gtx.Ops)
		op.Offset(layout.FPt(off)).Add(gtx.Ops)
		s.Shape(font, textSize, l).Add(gtx.Ops)
		clip.Rect(cl.Sub(off)).Add(gtx.Ops)
		s.Shape(font, textSize, l).Add(gtx.Ops)
		paint.PaintOp{}.Add(gtx.Ops)
		stack.Load()
	}