diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 2c1008dad..79915fb77 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -180,7 +180,7 @@ func NewScreenFramebufferImage(width, height int) *Image { return i } -func (i *Image) Fill(r, g, b, a uint8) { +func (i *Image) Fill(r, g, b, a byte) { theImages.makeStaleIfDependingOn(i) i.fill(r, g, b, a) } @@ -191,7 +191,7 @@ func (i *Image) clearForInitialization() { i.fill(0, 0, 0, 0) } -func (i *Image) fill(r, g, b, a uint8) { +func (i *Image) fill(r, g, b, a byte) { if i.priority { panic("restorable: clear cannot be called on a priority image") } @@ -533,7 +533,7 @@ func (i *Image) restore() error { gimg.ReplacePixels(i.basePixels.Slice(), 0, 0, w, h) } else { // Clear the image explicitly. - pix := make([]uint8, w*h*4) + pix := make([]byte, w*h*4) gimg.ReplacePixels(pix, 0, 0, w, h) } for _, c := range i.drawTrianglesHistory { diff --git a/internal/restorable/images.go b/internal/restorable/images.go index bb202caf9..4c91bb369 100644 --- a/internal/restorable/images.go +++ b/internal/restorable/images.go @@ -90,6 +90,9 @@ func RestoreIfNeeded() error { return theImages.restore() } +// Images returns all the current images. +// +// This is for testing usage. func Images() []image.Image { var imgs []image.Image for img := range theImages.images {