mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Remove 'resetRestoringState'
This is basically a revert of 2d079b123f
As filling can happen on a part of a shared image, resetting the
restoring state was wrong.
This commit is contained in:
parent
e931494c66
commit
b8eeded538
5
image.go
5
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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user