From 8f2097d55ee27227909ca567e87b32374f1dccc9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 9 Mar 2023 23:17:02 +0900 Subject: [PATCH] internal/restorable: reduce more duplicated regions --- internal/restorable/image.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 557e3c9bf..008c03a72 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -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() {