internal/restorable: remove ImageTypeRestorable

Updates #805
This commit is contained in:
Hajime Hoshi 2024-01-09 03:33:53 +09:00
parent 4f3e00ec3a
commit 8c2d4e1408
2 changed files with 3 additions and 14 deletions

View File

@ -652,13 +652,9 @@ func (i *Image) allocate(forbiddenBackends []*backend, asSource bool) {
panic(fmt.Sprintf("atlas: the image being put on an atlas is too big: width: %d, height: %d", i.width, i.height))
}
typ := restorable.ImageTypeRegular
if i.imageType == ImageTypeVolatile {
typ = restorable.ImageTypeVolatile
}
i.backend = &backend{
restorable: restorable.NewImage(wp, hp, typ),
source: asSource && typ == restorable.ImageTypeRegular,
restorable: restorable.NewImage(wp, hp, restorable.ImageTypeRegular),
source: asSource && i.imageType == ImageTypeRegular,
}
return
}
@ -701,12 +697,8 @@ loop:
height *= 2
}
typ := restorable.ImageTypeRegular
if i.imageType == ImageTypeVolatile {
typ = restorable.ImageTypeVolatile
}
b := &backend{
restorable: restorable.NewImage(width, height, typ),
restorable: restorable.NewImage(width, height, restorable.ImageTypeRegular),
page: packing.NewPage(width, height, maxSize),
source: asSource,
}

View File

@ -31,9 +31,6 @@ const (
// ImageTypeScreen indicates the image is used as an actual screen.
ImageTypeScreen
// ImageTypeVolatile indicates the image is cleared whenever a frame starts.
ImageTypeVolatile
)
// Image represents an image.