mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/restorable: reduce more duplicated regions
This commit is contained in:
parent
f3b49e6543
commit
8f2097d55e
@ -486,6 +486,7 @@ func (i *Image) readPixelsFromGPU(graphicsDriver graphicsdriver.Graphics) error
|
||||
defer func() {
|
||||
i.regionsCache = i.regionsCache[:0]
|
||||
}()
|
||||
i.regionsCache = removeDuplicatedRegions(i.regionsCache)
|
||||
rs = i.regionsCache
|
||||
}
|
||||
|
||||
@ -627,6 +628,7 @@ func (i *Image) restore(graphicsDriver graphicsdriver.Graphics) error {
|
||||
defer func() {
|
||||
i.regionsCache = i.regionsCache[:0]
|
||||
}()
|
||||
i.regionsCache = removeDuplicatedRegions(i.regionsCache)
|
||||
|
||||
for _, r := range i.regionsCache {
|
||||
if r.Empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user