internal/buffered: refactoring

This commit is contained in:
Hajime Hoshi 2022-03-21 04:36:32 +09:00
parent b3f4d6c522
commit fbcbd2a001

View File

@ -116,13 +116,15 @@ func (i *Image) invalidatePendingPixels() {
}
func (i *Image) resolvePendingPixels(keepPendingPixels bool) {
if i.needsToResolvePixels {
i.img.ReplacePixels(i.pixels, nil)
if !keepPendingPixels {
i.pixels = nil
}
i.needsToResolvePixels = false
if !i.needsToResolvePixels {
return
}
i.img.ReplacePixels(i.pixels, nil)
if !keepPendingPixels {
i.pixels = nil
}
i.needsToResolvePixels = false
}
func (i *Image) MarkDisposed() {