diff --git a/app/internal/egl/egl.go b/app/internal/egl/egl.go index cc028028..5e8558e4 100644 --- a/app/internal/egl/egl.go +++ b/app/internal/egl/egl.go @@ -36,12 +36,11 @@ type eglContext struct { } var ( - nilEGLDisplay _EGLDisplay - nilEGLSurface _EGLSurface - nilEGLContext _EGLContext - nilEGLConfig _EGLConfig - nilEGLNativeWindowType NativeWindowType - EGL_DEFAULT_DISPLAY NativeDisplayType + nilEGLDisplay _EGLDisplay + nilEGLSurface _EGLSurface + nilEGLContext _EGLContext + nilEGLConfig _EGLConfig + EGL_DEFAULT_DISPLAY NativeDisplayType ) const ( diff --git a/app/internal/window/os_wayland.go b/app/internal/window/os_wayland.go index 7fdb9218..700c307f 100644 --- a/app/internal/window/os_wayland.go +++ b/app/internal/window/os_wayland.go @@ -1001,13 +1001,6 @@ func (w *window) isAnimating() bool { return w.animating || w.fling.anim.Active() } -func (w *window) kill(err error) { - if w.pendingErr == nil { - w.pendingErr = err - } - w.dead = true -} - func (w *window) draw(sync bool) { w.flushScroll() w.mu.Lock() diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index 5d8406ac..fa6f7a31 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -203,11 +203,9 @@ func (w *x11Window) atom(name string, onlyIfExists bool) C.Atom { // in x11window.loop. // type x11EventHandler struct { - w *x11Window - text []byte - xev *C.XEvent - status C.Status - keysym C.KeySym + w *x11Window + text []byte + xev *C.XEvent } // handleEvents returns true if the window needs to be redrawn. diff --git a/gpu/gpu.go b/gpu/gpu.go index 4a91e9a2..29e37a9b 100644 --- a/gpu/gpu.go +++ b/gpu/gpu.go @@ -272,11 +272,6 @@ const ( materialTexture ) -const ( - attribPos = 0 - attribUV = 1 -) - func New(ctx backend.Device) (*GPU, error) { defFBO := ctx.CurrentFramebuffer() g := &GPU{ diff --git a/gpu/path.go b/gpu/path.go index 707bf727..5396ed1d 100644 --- a/gpu/path.go +++ b/gpu/path.go @@ -107,14 +107,6 @@ const ( pathBatchSize = 10000 ) -const ( - attribPathCorner = 0 - attribPathMaxY = 1 - attribPathFrom = 2 - attribPathCtrl = 3 - attribPathTo = 4 -) - func newPather(ctx backend.Device) *pather { return &pather{ ctx: ctx, @@ -217,6 +209,9 @@ func (s *fboSet) resize(ctx backend.Device, sizes []image.Point) { } tex, err := ctx.NewTexture(backend.TextureFormatFloat, sz.X, sz.Y, backend.FilterNearest, backend.FilterNearest, backend.BufferBindingTexture|backend.BufferBindingFramebuffer) + if err != nil { + panic(err) + } fbo, err := ctx.NewFramebuffer(tex, 0) if err != nil { panic(err) diff --git a/io/system/system.go b/io/system/system.go index 5b970919..fe672653 100644 --- a/io/system/system.go +++ b/io/system/system.go @@ -23,9 +23,6 @@ type FrameEvent struct { // Frame replaces the window's frame with the new // frame. Frame func(frame *op.Ops) - // Whether this draw is system generated and needs a complete - // frame before proceeding. - sync bool } // Config defines the essential properties of @@ -96,7 +93,7 @@ func (l Stage) String() string { } } -func (_ FrameEvent) ImplementsEvent() {} -func (_ StageEvent) ImplementsEvent() {} -func (_ *CommandEvent) ImplementsEvent() {} -func (_ DestroyEvent) ImplementsEvent() {} +func (FrameEvent) ImplementsEvent() {} +func (StageEvent) ImplementsEvent() {} +func (*CommandEvent) ImplementsEvent() {} +func (DestroyEvent) ImplementsEvent() {} diff --git a/layout/flex.go b/layout/flex.go index 71d36533..f1b241f4 100644 --- a/layout/flex.go +++ b/layout/flex.go @@ -36,8 +36,6 @@ type FlexChild struct { // Spacing determine the spacing mode for a Flex. type Spacing uint8 -type flexMode uint8 - const ( // SpaceEnd leaves space at the end. SpaceEnd Spacing = iota diff --git a/op/op.go b/op/op.go index c4def563..49a3dc02 100644 --- a/op/op.go +++ b/op/op.go @@ -95,11 +95,10 @@ type Ops struct { // StackOp saves and restores the operation state // in a stack-like manner. type StackOp struct { - stackDepth int - id stackID - macroID int - active bool - ops *Ops + id stackID + macroID int + active bool + ops *Ops } // MacroOp records a list of operations for later use. diff --git a/widget/material/button.go b/widget/material/button.go index 562cf5ea..a6e70367 100644 --- a/widget/material/button.go +++ b/widget/material/button.go @@ -132,13 +132,6 @@ func toPointF(p image.Point) f32.Point { return f32.Point{X: float32(p.X), Y: float32(p.Y)} } -func toRectF(r image.Rectangle) f32.Rectangle { - return f32.Rectangle{ - Min: toPointF(r.Min), - Max: toPointF(r.Max), - } -} - func drawInk(gtx *layout.Context, c widget.Click) { d := gtx.Now().Sub(c.Time) t := float32(d.Seconds()) diff --git a/widget/material/icon.go b/widget/material/icon.go index 6931bff9..0247ad02 100644 --- a/widget/material/icon.go +++ b/widget/material/icon.go @@ -17,7 +17,6 @@ import ( type Icon struct { Color color.RGBA src []byte - size unit.Value // Cached values. op paint.ImageOp imgSize int