diff --git a/image.go b/image.go index 5ca6785af..038db1a85 100644 --- a/image.go +++ b/image.go @@ -123,10 +123,7 @@ func (i *Image) Fill(clr color.Color) error { if af < 1.0 { op.CompositeMode = CompositeModeCopy } - // As Fill will change all the pixels of the image into the same color, all the information for restoring - // will be invalidated. - // TODO: This is a little hacky. Is there a better way? - i.mipmap.resetRestoringState() + // TODO: As all the pixels will be changed, this image can reset the information for restoring. i.DrawImage(emptyImage, op) return nil } diff --git a/internal/restorable/image.go b/internal/restorable/image.go index ffcef300b..a50d7fa83 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -223,14 +223,7 @@ func (i *Image) clear() { } clearImage(i.image) - i.ResetRestoringState() -} -// ResetRestoringState resets all the information for restoring. -// ResetRestoringState doen't affect the underlying image. -// -// After ResetRestoringState, the image is assumed to be cleared. -func (i *Image) ResetRestoringState() { i.basePixels = Pixels{} i.drawTrianglesHistory = nil i.stale = false diff --git a/internal/shareable/shareable.go b/internal/shareable/shareable.go index e25cb97ba..ef0242928 100644 --- a/internal/shareable/shareable.go +++ b/internal/shareable/shareable.go @@ -342,15 +342,6 @@ func (i *Image) ClearFramebuffer() { i.backend.restorable.Clear() } -func (i *Image) ResetRestoringState() { - backendsM.Lock() - defer backendsM.Unlock() - if i.backend == nil { - return - } - i.backend.restorable.ResetRestoringState() -} - func (i *Image) ReplacePixels(p []byte) { backendsM.Lock() defer backendsM.Unlock() diff --git a/mipmap.go b/mipmap.go index fdb6fce59..3448fdfb3 100644 --- a/mipmap.go +++ b/mipmap.go @@ -144,10 +144,6 @@ func (m *mipmap) clearFramebuffer() { m.orig.ClearFramebuffer() } -func (m *mipmap) resetRestoringState() { - m.orig.ResetRestoringState() -} - // mipmapLevel returns an appropriate mipmap level for the given determinant of a geometry matrix. // // mipmapLevel panics if det is NaN or 0.