mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
pixels: Remove IsStale
This commit is contained in:
parent
56732d9a23
commit
e0894879f1
@ -194,10 +194,7 @@ func (i *imageImpl) ensurePixels(context *opengl.Context) error {
|
||||
if i.disposed {
|
||||
return nil
|
||||
}
|
||||
if !i.pixels.IsStale() {
|
||||
return nil
|
||||
}
|
||||
if err := i.pixels.Reset(context); err != nil {
|
||||
if err := i.pixels.ResetIfStale(context); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
@ -47,10 +47,6 @@ func NewPixels(image *graphics.Image) *Pixels {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Pixels) IsStale() bool {
|
||||
return p.stale
|
||||
}
|
||||
|
||||
func (p *Pixels) MakeStale() {
|
||||
p.basePixels = nil
|
||||
p.baseColor = nil
|
||||
@ -134,6 +130,13 @@ func (p *Pixels) Reset(context *opengl.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Pixels) ResetIfStale(context *opengl.Context) error {
|
||||
if !p.stale {
|
||||
return nil
|
||||
}
|
||||
return p.Reset(context)
|
||||
}
|
||||
|
||||
func (p *Pixels) HasDependency() bool {
|
||||
if p.stale {
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user