From 3faa674e320b57ddf1009d04de9e939e27aa645d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 14 Feb 2019 00:54:02 +0900 Subject: [PATCH] restorable: Don't call (*graphicscommand.Image).Pixels twice --- internal/restorable/image.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/restorable/image.go b/internal/restorable/image.go index 91f9937ea..e4914a185 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -416,9 +416,10 @@ func (i *Image) makeStaleIfDependingOn(target *Image) { // readPixelsFromGPU reads the pixels from GPU and resolves the image's 'stale' state. func (i *Image) readPixelsFromGPU() { + pix := i.image.Pixels() i.basePixels = &Pixels{ - pixels: i.image.Pixels(), - length: len(i.image.Pixels()), + pixels: pix, + length: len(pix), } i.drawImageHistory = nil i.stale = false