mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 20:42:07 +01:00
internal/buffered: refactoring
This commit is contained in:
parent
b3f4d6c522
commit
fbcbd2a001
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user