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) { func (i *Image) resolvePendingPixels(keepPendingPixels bool) {
if i.needsToResolvePixels { if !i.needsToResolvePixels {
i.img.ReplacePixels(i.pixels, nil) return
if !keepPendingPixels {
i.pixels = nil
}
i.needsToResolvePixels = false
} }
i.img.ReplacePixels(i.pixels, nil)
if !keepPendingPixels {
i.pixels = nil
}
i.needsToResolvePixels = false
} }
func (i *Image) MarkDisposed() { func (i *Image) MarkDisposed() {