restorable: Avoid unneeded discarding images

This commit is contained in:
Hajime Hoshi 2018-02-28 15:56:51 +09:00
parent dca60a2520
commit 8ef0f1ac6a

View File

@ -172,11 +172,11 @@ func (i *Image) ReplacePixels(pixels []byte) {
// DrawImage draws a given image img to the image. // DrawImage draws a given image img to the image.
func (i *Image) DrawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) { func (i *Image) DrawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) {
theImages.makeStaleIfDependingOn(i)
vs := img.vertices(sx0, sy0, sx1, sy1, geom) vs := img.vertices(sx0, sy0, sx1, sy1, geom)
if vs == nil { if vs == nil {
return return
} }
theImages.makeStaleIfDependingOn(i)
if img.stale || img.volatile || !IsRestoringEnabled() { if img.stale || img.volatile || !IsRestoringEnabled() {
i.makeStale() i.makeStale()
} else { } else {