pixels: Bug fix: Remove IsCleared: pixels state might not match with actual state

This commit is contained in:
Hajime Hoshi 2016-07-25 10:22:37 +09:00
parent c0eb01d69e
commit 939284820c
2 changed files with 0 additions and 10 deletions

View File

@ -115,9 +115,6 @@ func (i *imageImpl) Fill(clr color.Color) error {
if i.disposed {
return errors.New("ebiten: image is already disposed")
}
if clr == color.Transparent && i.pixels.IsCleared() {
return nil
}
i.pixels.Fill(clr)
return i.image.Fill(clr)
}
@ -131,9 +128,6 @@ func (i *imageImpl) clearIfVolatile() error {
if !i.volatile {
return nil
}
if i.pixels.IsCleared() {
return nil
}
i.pixels.Clear()
return i.image.Fill(color.Transparent)
}

View File

@ -60,10 +60,6 @@ func (p *Pixels) Clear() {
p.drawImageHistory = nil
}
func (p *Pixels) IsCleared() bool {
return p.basePixels == nil && p.baseColor == nil && p.drawImageHistory == nil
}
func (p *Pixels) Fill(clr color.Color) {
p.basePixels = nil
p.baseColor = clr