mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +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() {
|
defer func() {
|
||||||
i.regionsCache = i.regionsCache[:0]
|
i.regionsCache = i.regionsCache[:0]
|
||||||
}()
|
}()
|
||||||
|
i.regionsCache = removeDuplicatedRegions(i.regionsCache)
|
||||||
rs = i.regionsCache
|
rs = i.regionsCache
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -627,6 +628,7 @@ func (i *Image) restore(graphicsDriver graphicsdriver.Graphics) error {
|
|||||||
defer func() {
|
defer func() {
|
||||||
i.regionsCache = i.regionsCache[:0]
|
i.regionsCache = i.regionsCache[:0]
|
||||||
}()
|
}()
|
||||||
|
i.regionsCache = removeDuplicatedRegions(i.regionsCache)
|
||||||
|
|
||||||
for _, r := range i.regionsCache {
|
for _, r := range i.regionsCache {
|
||||||
if r.Empty() {
|
if r.Empty() {
|
||||||
|
Loading…
Reference in New Issue
Block a user